void-packages/srcpkgs/libdbus-c++/template
Đoàn Trần Công Danh 861ac185a6 srcpkgs/l*: 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 'libdbus-c++'
pkgname=libdbus-c++
version=0.9.2pw
revision=1
wrksrc="${pkgname//+/-}-${version}"
build_style=gnu-configure
configure_args="--enable-glib --disable-ecore"
hostmakedepends="automake libtool pkg-config"
makedepends="dbus-devel glib-devel"
short_desc="C++ API for D-BUS"
maintainer="Duncaen <mail@duncano.de>"
license="LGPL-2.1-or-later"
homepage="http://dbus-cplusplus.sourceforge.net/"
distfiles="https://github.com/pkgw/dbus-cplusplus/releases/download/v${version}/libdbus-c---${version}.tar.gz"
checksum=4f140668f2529ecbdce99afbb89f8a977aa47a36248d5f4943b3660316752ee8
if [ -n "$CROSS_BUILD" ]; then
hostmakedepends+=" libdbus-c++-devel dbus-devel glib-devel"
fi
pre_configure() {
NOCONFIGURE=1 autoreconf -fi
}
post_install() {
if [ -n "$CROSS_BUILD" ]; then
# Re-build tools for the target architecture
sed -i tools/Makefile \
-e "s;^\(CXX =\).*;\1 $CXX;" \
-e "s;^\(CFLAGS =\).*;\1 $CFLAGS;" \
-e "s;^\(CXXFLAGS =\).*;\1 $CXXFLAGS;" \
-e "s;^\(LDFLAGS =\).*;\1 $LDFLAGS;" \
-e "/^libdbus_cxx_la/d" \
-e "s;#\(libdbus_cxx_la = .*\);\1;"
make -C tools clean
make -C tools ${makejobs}
vbin tools/dbusxx-xml2cpp
vbin tools/dbusxx-introspect
fi
}
libdbus-c++-devel_package() {
short_desc+=" - development files"
depends="${sourcepkg}-${version}_${revision}"
pkg_install() {
vmove usr/include
vmove "usr/lib/*.a"
vmove "usr/lib/*.so"
vmove usr/lib/pkgconfig
}
}