void-packages/srcpkgs/brltty/template
Đoàn Trần Công Danh c6ce65d3d0 srcpkgs/b*: convert patches to -Np1
```sh

git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

81 lines
2.2 KiB
Bash

# Template file for 'brltty'
pkgname=brltty
version=6.1
revision=1
build_style=gnu-configure
configure_args="--enable-gpm --with-screen-driver=lx,sc
--with-tables-directory=/usr/share/brltty PYTHON=/usr/bin/python3"
hostmakedepends="pkg-config python3-Cython"
makedepends="ncurses-devel alsa-lib-devel gpm-devel icu-devel python3-devel libbluetooth-devel"
short_desc="Braille display driver for Linux/Unix"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later, LGPL-2.1-or-later"
homepage="http://mielke.cc/brltty/"
distfiles="http://mielke.cc/brltty/archive/brltty-${version}.tar.xz"
checksum=4a28e3f1879aee9082f9ce4100fd4053be47add7f8ab0f2af6d6a20590934b62
python_version=3
case "$XBPS_TARGET_MACHINE" in
i686*|x86_64*) configure_args="${configure_args} --with-ports-package=glibc";;
*) configure_args="${configure_args} --with-ports-package=none";;
esac
# glibc is a misnomer here, it's just ioperm inb outp and friends, works
# fine with musl.
pre_configure() {
case "$XBPS_TARGET_MACHINE" in
*-musl) # There is no ldconfig in musl libc
sed -e "s;/sbin/ldconfig -n;echo;" -i configure
esac
export PYTHON_LIBS="-L${XBPS_CROSS_BASE}/usr/lib -lpython${py3_ver}${py3_abiver}"
export PYTHON_CPPFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
}
post_configure() {
case "$XBPS_TARGET_MACHINE" in
arm*-musl) # Fix erroneously detected "#define HAVE_SYS_IO_H 1"
sed -i config.h -e"s;#define HAVE_SYS_IO_H 1;#undef HAVE_SYS_IO_H;"
esac
}
pre_build() {
if [ "$CROSS_BUILD" ]; then
for f in ${XBPS_CROSS_BASE}/${py3_lib}/_sysconfigdata_*; do
f=${f##*/}
export _PYTHON_SYSCONFIGDATA_NAME=${f%.py}
done
export PYTHONPATH=${XBPS_CROSS_BASE}/${py3_lib}
fi
}
pre_install() {
pre_build
}
do_install() {
make INSTALL_ROOT=${DESTDIR} install
vsv $pkgname
vsconf Documents/brltty.conf
vdoc Documents/ChangeLog
vcopy Documents/Manual-BRLTTY usr/share/doc/${pkgname}
}
brltty-devel_package() {
short_desc+=" - development files"
depends="${sourcepkg}-${version}_${revision}"
pkg_install() {
vmove usr/bin/brltty-config
vmove usr/include
vmove "usr/lib/*.a"
vmove "usr/lib/*.so"
vmove usr/share/man/man3
}
}
python3-brlapi_package() {
short_desc+=" - Python3 bindings"
pkg_install() {
vmove ${py3_sitelib}
}
}