c987560802
```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 ```
59 lines
1.5 KiB
Bash
59 lines
1.5 KiB
Bash
# Template file for 'cln'
|
|
pkgname=cln
|
|
version=1.3.6
|
|
revision=1
|
|
build_style=gnu-configure
|
|
makedepends="gmp-devel"
|
|
short_desc="Class library (C++) for numbers"
|
|
maintainer="Orphaned <orphan@voidlinux.org>"
|
|
license="GPL-2.0-only"
|
|
homepage="https://www.ginac.de/CLN/"
|
|
distfiles="${homepage}/${pkgname}-${version}.tar.bz2"
|
|
checksum=f492530e8879bda529009b6033e1923c8f4aae843149fc28c667c20b094d984a
|
|
|
|
case "$XBPS_TARGET_MACHINE" in
|
|
arm*|aarch64*) CPPFLAGS="-DNO_ASM";;
|
|
esac
|
|
|
|
pre_configure() {
|
|
if [ "$CROSS_BUILD" ]; then
|
|
local ENDIAN="UNKNOWN"
|
|
local LBITS=$XBPS_TARGET_WORDSIZE
|
|
local LBYTES=$(($XBPS_TARGET_WORDSIZE / 8))
|
|
local INTPARAM_H=${wrksrc}/include/cln/intparam.h
|
|
local FLOATPARAM_H=${wrksrc}/include/cln/floatparam.h
|
|
|
|
if [ "$XBPS_TARGET_ENDIAN" = "be" ]; then
|
|
ENDIAN="BIG"
|
|
fi
|
|
if [ "$XBPS_TARGET_ENDIAN" = "le" ]; then
|
|
ENDIAN="LITTLE"
|
|
fi
|
|
|
|
# Make substitutions in intparam.h
|
|
sed ${FILESDIR}/intparam.h \
|
|
-e "s;@LBITS@;$LBITS;g" \
|
|
-e "s;@LBYTES@;$LBYTES;g" \
|
|
-e "s;@ENDIAN@;$ENDIAN;g" \
|
|
-e "s;@endian@;${ENDIAN,,};g" \
|
|
> ${INTPARAM_H}
|
|
|
|
# No substitutions in floatparam.h
|
|
cat ${FILESDIR}/floatparam.h \
|
|
> ${FLOATPARAM_H}
|
|
|
|
configure_args+=" cl_cv_file_intparam_h=$INTPARAM_H"
|
|
configure_args+=" cl_cv_file_floatparam_h=$FLOATPARAM_H"
|
|
fi
|
|
}
|
|
|
|
cln-devel_package() {
|
|
short_desc+=" - development files"
|
|
depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
|
|
pkg_install() {
|
|
vmove usr/include
|
|
vmove usr/lib/libcln.so
|
|
vmove usr/lib/libcln.a
|
|
vmove usr/lib/pkgconfig
|
|
}
|
|
}
|