void-packages/srcpkgs/z3/template
Đoàn Trần Công Danh e2a21ccfd6 srcpkgs/z*: 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

51 lines
1.4 KiB
Bash

# Template file for 'z3'
pkgname=z3
version=4.8.11
revision=1
wrksrc="${pkgname}-${pkgname}-${version}"
build_style=configure
configure_args="--prefix=/usr -g --python $(vopt_if ocaml --ml)"
make_build_args="-C build all examples"
make_install_args="-C build install"
hostmakedepends="python3 which $(vopt_if ocaml 'ocaml ocaml-findlib')"
makedepends="libgomp-devel gmp-devel $(vopt_if ocaml 'ocaml-zarith ncurses-devel')"
depends="python3 python3-setuptools"
short_desc="Z3 theorem prover and SMT solver (command line + Python3 module)"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="MIT"
homepage="https://github.com/Z3Prover/z3"
distfiles="https://github.com/Z3Prover/z3/archive/z3-${version}.tar.gz"
checksum=99e912b9af76a17f8827f89afcf4da117736f3877a8bbdd737c548c6541009d7
build_options="ocaml"
desc_option_ocaml="Enable support for OCaml bindings"
shlib_provides="libz3.so"
subpackages="$(vopt_if ocaml z3-ocaml)"
if [ -z "$CROSS_BUILD" ]; then
build_options_default="ocaml"
fi
do_check() {
make ${MAKEJOBS} -C build test
./build/test-z3 /a
}
post_install() {
vbin build/z3_tptp
vbin build/maxsat
if [ "$build_option_ocaml" ]; then
vmkdir usr/lib/ocaml/Z3/stublibs
mv ${DESTDIR}/usr/lib/ocaml/Z3/dllz3ml.so ${DESTDIR}/usr/lib/ocaml/Z3/stublibs
fi
vlicense LICENSE.txt
}
z3-ocaml_package() {
short_desc="Z3 theorem prover and SMT solver (OCaml bindings)"
depends="z3>=${version}_${revision}"
pkg_install() {
vmove usr/lib/ocaml
}
}