void-packages/srcpkgs/freeimage/template
Đoàn Trần Công Danh be5369a0cb srcpkgs/f*: convert patches to -Np1
* fpc is kept at -Np0

```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

70 lines
1.8 KiB
Bash

# Template file for 'freeimage'
pkgname=freeimage
version=3.18.0
revision=3
wrksrc=FreeImage
build_style=gnu-makefile
hostmakedepends="unzip"
short_desc="Support library for popular graphics image formats"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later, FreeImage"
homepage="http://freeimage.sourceforge.net/"
distfiles="${SOURCEFORGE_SITE}/freeimage/Source%20Distribution/FreeImage${version//./}.zip"
checksum=f41379682f9ada94ea7b34fe86bf9ee00935a3147be41b6569c9605a53e438fd
CFLAGS="-fPIC -DPIC -fexceptions -fvisibility=hidden -DPNG_POWERPC_VSX_OPT=0"
CXXFLAGS="${CFLAGS} -Wno-ctor-dtor-privacy"
subpackages="freeimage-plus freeimage-devel freeimage-plus-devel"
post_patch() {
mkdir /tmp/fi
mv ${wrksrc}/* /tmp/fi
cp -a /tmp/fi ${wrksrc}/fip
mv /tmp/fi ${wrksrc}
}
do_build() {
cd ${wrksrc}/fi
make ${makejobs}
cd ${wrksrc}/fip
make -f Makefile.fip ${makejobs}
}
do_install() {
cd ${wrksrc}/fi
make DESTDIR="${DESTDIR}" install
vlicense license-fi.txt LICENSE
}
freeimage-plus_package() {
short_desc+=" (plus)"
pkg_install() {
cd ${wrksrc}/fip
make -f Makefile.fip DESTDIR="${PKGDESTDIR}" install
vlicense license-fi.txt LICENSE
}
}
freeimage-devel_package() {
short_desc+=" - development files"
depends="freeimage>=${version}_${revision}"
pkg_install() {
vmove usr/include
vmove usr/lib/libfreeimage.a
vmove usr/lib/libfreeimage.so
}
}
freeimage-plus-devel_package() {
short_desc+=" (plus) - development files"
depends="freeimage-plus>=${version}_${revision}"
pkg_install() {
DESTDIR="${DESTDIR/freeimage-/freeimage-plus-}"
vmove usr/include
vmove usr/lib/libfreeimageplus.a
vmove usr/lib/libfreeimageplus.so
# vmkdir usr/lib
# mv ${_destdir}/usr/include ${PKGDESTDIR}/usr
# mv ${_destdir}/usr/lib/libfreeimageplus.{a,so} ${PKGDESTDIR}/usr/lib
}
}