void-packages/srcpkgs/x265/template
Đoàn Trần Công Danh 3353bf4722 srcpkgs/x*: 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

61 lines
1.6 KiB
Bash

# Template file for 'x265'
pkgname=x265
version=3.4
revision=1
_commit="a4f320054d67"
wrksrc="multicoreware-x265_git-${_commit}"
build_wrksrc=source
build_style=cmake
configure_args="-DENABLE_PIC=1"
short_desc="Open Source H.265/HEVC video encoder"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later"
homepage="http://x265.org/"
distfiles="https://bitbucket.org/multicoreware/x265_git/get/${version}.tar.gz"
checksum=7f2771799bea0f53b5ab47603d5bea46ea2a221e047a7ff398115e9976fd5f86
build_options="altivec assembly"
desc_option_altivec="Enable AltiVec support on ppc64 (POWER8 and higher only)"
desc_option_assembly="Enable assembly support on x86/ARM"
case "$XBPS_TARGET_MACHINE" in
ppc64le*) build_options_default="altivec" ;;
# on ARM, enabling it currently fails with undefined reference to
# x265::setupAssemblyPrimitives(x265::EncoderPrimitives&, int)
x86_64*|i686*) build_options_default="assembly" ;;
*) ;;
esac
if [ "$build_option_assembly" ]; then
case "$XBPS_TARGET_MACHINE" in
x86_64*|i686*) hostmakedepends+=" nasm" ;;
*) ;;
esac
fi
case "$XBPS_TARGET_MACHINE" in
ppc64*)
# altivec does not build without power8 being enabled
configure_args+=" -DENABLE_ALTIVEC=$(vopt_if altivec ON OFF)
-DCPU_POWER8=$(vopt_if altivec ON OFF)"
;;
*) configure_args+=" -DENABLE_ASSEMBLY=$(vopt_if assembly ON OFF)" ;;
esac
pre_configure() {
if [ "$CROSS_BUILD" ]; then
vsed -i CMakeLists.txt -e "s; -mcpu=native;;"
fi
}
x265-devel_package() {
depends="${sourcepkg}>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove usr/lib/pkgconfig
vmove "usr/lib/*.so"
vmove "usr/lib/*.a"
}
}