3353bf4722
```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 ```
46 lines
1.3 KiB
Bash
46 lines
1.3 KiB
Bash
# Template file for 'xsane'
|
|
pkgname=xsane
|
|
version=0.999
|
|
revision=4
|
|
hostmakedepends="pkg-config sane-devel gettext"
|
|
makedepends="gtk+-devel lcms-devel sane-devel gimp-devel"
|
|
depends="sane"
|
|
short_desc="GTK-based X11 frontend for SANE"
|
|
maintainer="Orphaned <orphan@voidlinux.org>"
|
|
license="GPL-2.0-or-later"
|
|
homepage="http://www.xsane.org"
|
|
distfiles="${DEBIAN_SITE}/main/x/xsane/xsane_${version}.orig.tar.gz"
|
|
checksum=5782d23e67dc961c81eef13a87b17eb0144cae3d1ffc5cf7e0322da751482b4b
|
|
|
|
post_patch() {
|
|
vsed -i -e 's/DATADIRNAME=.*/DATADIRNAME=share/' \
|
|
-e 's,/usr/local/include,/usr/include,' \
|
|
configure
|
|
}
|
|
|
|
do_build() {
|
|
local _args="--prefix=/usr --sbindir=/usr/bin --mandir=/usr/share/man
|
|
--target=${XBPS_CROSS_TRIPLET} --host=${XBPS_CROSS_TRIPLET}
|
|
--build=${XBPS_TRIPLET}"
|
|
./configure ${_args} --enable-gimp
|
|
make ${makejobs}
|
|
mv src/xsane{,-gimp}
|
|
make clean
|
|
echo "=== ./configure ${_args} --disable-gimp"
|
|
./configure ${_args} --disable-gimp
|
|
make ${makejobs}
|
|
}
|
|
|
|
do_install() {
|
|
make DESTDIR="${DESTDIR}" install
|
|
}
|
|
|
|
xsane-gimp_package() {
|
|
short_desc+=" - plugin for GIMP"
|
|
depends="${sourcepkg}>=${version}_${revision}"
|
|
pkg_install() {
|
|
vbin src/xsane-gimp
|
|
vmkdir usr/lib/gimp/2.0/plug-ins
|
|
ln -s /usr/bin/xsane-gimp ${PKGDESTDIR}/usr/lib/gimp/2.0/plug-ins/xsane
|
|
}
|
|
}
|