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

59 lines
2 KiB
Bash

# Template file for 'clucene'
pkgname=clucene
version=2.3.3.4
revision=9
wrksrc=${pkgname}-core-${version}
build_style=cmake
configure_args="-DENABLE_ASCII_MODE=OFF -DENABLE_PACKAGING=OFF
-DBUILD_CONTRIBS_LIB:BOOL=ON -DLIB_DESTINATION:PATH=/usr/lib
-DLUCENE_SYS_INCLUDES:PATH=/usr/include"
hostmakedepends="pkg-config"
makedepends="zlib-devel boost-devel"
short_desc="Text search engine written in C++"
homepage="http://clucene.sourceforge.net/"
license="LGPL-2+/ASL-2.0"
maintainer="Orphaned <orphan@voidlinux.org>"
distfiles="${SOURCEFORGE_SITE}/${pkgname}/${pkgname}-core-${version}.tar.gz"
checksum=ddfdc433dd8ad31b5c5819cc4404a8d2127472a3b720d3e744e8c51d79732eab
if [ "$XBPS_TARGET_LIBC" = musl ]; then
# threading segfaults on musl
configure_args+=" -DDISABLE_MULTITHREADING=BOOL:ON"
else
configure_args+=" -DDISABLE_MULTITHREADING=OFF"
fi
if [ "$CROSS_BUILD" ]; then
configure_args+=" -D_CL_HAVE_PTHREAD_MUTEX_RECURSIVE_EXITCODE=0"
configure_args+=" -D_CL_HAVE_PTHREAD_MUTEX_RECURSIVE_EXITCODE__TRYRUN_OUTPUT=0"
configure_args+=" -D_CL_HAVE_GCC_ATOMIC_FUNCTIONS_EXITCODE=0"
configure_args+=" -D_CL_HAVE_GCC_ATOMIC_FUNCTIONS_EXITCODE__TRYRUN_OUTPUT=0"
configure_args+=" -D_CL_HAVE_TRY_BLOCKS_EXITCODE=0"
configure_args+=" -D_CL_HAVE_TRY_BLOCKS_EXITCODE__TRYRUN_OUTPUT=0"
configure_args+=" -D_CL_HAVE_NAMESPACES_EXITCODE=0"
configure_args+=" -D_CL_HAVE_NAMESPACES_EXITCODE__TRYRUN_OUTPUT=0"
configure_args+=" -D_CL_HAVE_NO_SNPRINTF_BUG_EXITCODE=0"
configure_args+=" -D_CL_HAVE_NO_SNPRINTF_BUG_EXITCODE__TRYRUN_OUTPUT=0"
configure_args+=" -DLUCENE_STATIC_CONSTANT_SYNTAX_EXITCODE=0"
configure_args+=" -DLUCENE_STATIC_CONSTANT_SYNTAX_EXITCODE__TRYRUN_OUTPUT=0"
fi
do_check() {
cd build
make ${makejobs} cl_test
mkdir -p tmp
cd bin
TMP=../tmp ./cl_test
}
clucene-devel_package() {
depends="${sourcepkg}>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove "usr/lib/*.so"
vmove usr/lib/CLuceneConfig.cmake
vmove usr/lib/pkgconfig
}
}