void-packages/srcpkgs/p7zip/template
Đoàn Trần Công Danh 49cb564d14 srcpkgs/p*: convert patches to -Np1
* par 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

47 lines
1.5 KiB
Bash

# Template file for 'p7zip'
pkgname=p7zip
version=16.02
revision=5
wrksrc="${pkgname}_${version}"
hostmakedepends="yasm nasm"
short_desc="Command-line version of the 7zip compressed file archive"
maintainer="Orphaned <orphan@voidlinux.org>"
license="LGPL-2.1-or-later"
homepage="http://p7zip.sourceforge.net/"
distfiles="${SOURCEFORGE_SITE}/${pkgname}/${pkgname}_${version}_src_all.tar.bz2"
checksum=5eb20ac0e2944f6cb9c2d51dd6c4518941c185347d4089ea89087ffdd6e2341f
CXXFLAGS="-Wno-narrowing"
do_configure() {
case "$XBPS_TARGET_MACHINE" in
i686*) cp makefile.linux_x86_asm_gcc_4.X makefile.machine;;
x86_64*) cp makefile.linux_amd64_asm makefile.machine;;
*) cp makefile.linux_any_cpu_gcc_4.X makefile.machine;;
esac
sed -e "s,g++,${CXX}," -i makefile.machine
sed -e "s,gcc,${CC}," -i makefile.machine
}
do_build() {
make all3 OPTFLAGS="$CXXFLAGS" ${makejobs}
}
do_install() {
make install DEST_DIR="${DESTDIR}" DEST_HOME="/usr" \
DEST_MAN="/usr/share/man" \
DEST_SHARE_DOC="/usr/share/doc/${pkgname}"
find ${DESTDIR}/usr/share/doc/$pkgname -type d -exec chmod 755 {} \;
mkdir -p ${DESTDIR}/usr/share/licenses/p7zip/
mv ${DESTDIR}/usr/share/doc/p7zip/DOC/copying.txt \
${DESTDIR}/usr/share/licenses/p7zip/LICENSE
}
p7zip-unrar_package() {
short_desc+=" - RAR support"
license="custom:freeware"
depends="${sourcepkg}-${version}_${revision}"
repository=nonfree
pkg_install() {
vmove usr/lib/p7zip/Codecs/Rar.so
vlicense DOC/unRarLicense.txt LICENSE
}
}