From ffa32613fa4da5c5226a4fa0b24ab3d55d458ddb Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 8 Jan 2014 14:24:02 +0100 Subject: [PATCH] xbps: cross musl support. --- ..._impl.h-remove-__-BEGIN-END-_DECLS-t.patch | 33 +++++++++++++++++++ ...fine-_BSD_SOURCE-for-strlcpy-with-mu.patch | 27 +++++++++++++++ srcpkgs/xbps/template | 12 +++++-- 3 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/xbps/patches/0001-include-xbps_api_impl.h-remove-__-BEGIN-END-_DECLS-t.patch create mode 100644 srcpkgs/xbps/patches/0002-lib-initend.c-define-_BSD_SOURCE-for-strlcpy-with-mu.patch diff --git a/srcpkgs/xbps/patches/0001-include-xbps_api_impl.h-remove-__-BEGIN-END-_DECLS-t.patch b/srcpkgs/xbps/patches/0001-include-xbps_api_impl.h-remove-__-BEGIN-END-_DECLS-t.patch new file mode 100644 index 00000000000..50aa6e755bb --- /dev/null +++ b/srcpkgs/xbps/patches/0001-include-xbps_api_impl.h-remove-__-BEGIN-END-_DECLS-t.patch @@ -0,0 +1,33 @@ +From 3042dcd7aaaa9bb2970cc60ee72c8632ff8ac5b6 Mon Sep 17 00:00:00 2001 +From: Juan RP +Date: Tue, 7 Jan 2014 21:19:03 +0100 +Subject: [PATCH 1/2] include/xbps_api_impl.h: remove __{BEGIN,END}_DECLS to + make musl happy. + +--- + include/xbps_api_impl.h | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/include/xbps_api_impl.h b/include/xbps_api_impl.h +index 1e94346..497477e 100644 +--- a/include/xbps_api_impl.h ++++ b/include/xbps_api_impl.h +@@ -92,8 +92,6 @@ + + #endif + +-__BEGIN_DECLS +- + /** + * @private + * From lib/external/dewey.c +@@ -263,6 +261,4 @@ void HIDDEN xbps_pkg_find_conflicts(struct xbps_handle *, + */ + const char HIDDEN *vpkg_user_conf(struct xbps_handle *, const char *, bool); + +-__END_DECLS +- + #endif /* !_XBPS_API_IMPL_H_ */ +-- +1.8.5.2 + diff --git a/srcpkgs/xbps/patches/0002-lib-initend.c-define-_BSD_SOURCE-for-strlcpy-with-mu.patch b/srcpkgs/xbps/patches/0002-lib-initend.c-define-_BSD_SOURCE-for-strlcpy-with-mu.patch new file mode 100644 index 00000000000..08d2868d2d8 --- /dev/null +++ b/srcpkgs/xbps/patches/0002-lib-initend.c-define-_BSD_SOURCE-for-strlcpy-with-mu.patch @@ -0,0 +1,27 @@ +From ae81cd1ea9c98ac3bf61ba581e3b3c63255465bd Mon Sep 17 00:00:00 2001 +From: Juan RP +Date: Tue, 7 Jan 2014 21:20:42 +0100 +Subject: [PATCH 2/2] lib/initend.c: define _BSD_SOURCE for strlcpy() with + musl. + +--- + lib/initend.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/lib/initend.c b/lib/initend.c +index 21d3bc5..00ef1a4 100644 +--- a/lib/initend.c ++++ b/lib/initend.c +@@ -27,7 +27,9 @@ + #include + #include + #include ++#define _BSD_SOURCE /* required by strlcpy with musl */ + #include ++#undef _BSD_SOURCE + #include + #include + #include +-- +1.8.5.2 + diff --git a/srcpkgs/xbps/template b/srcpkgs/xbps/template index ae1f72e9ab8..bb2baedc5b9 100644 --- a/srcpkgs/xbps/template +++ b/srcpkgs/xbps/template @@ -1,14 +1,15 @@ # Template file for 'xbps' pkgname=xbps version=0.28.1 -revision=1 +revision=2 bootstrap=yes -depends="xbps-triggers" +patch_args="-Np1" conf_files="/etc/xbps/xbps.conf" replaces="xbps>=0" build_style=configure configure_args="--prefix=/usr --sysconfdir=/etc --enable-static --enable-debug" makedepends="zlib-devel openssl-devel libarchive-devel>=3.1.2 confuse-devel" +depends="xbps-triggers" short_desc="The XBPS package system utilities" maintainer="Juan RP " homepage="http://www.voidlinux.eu/xbps" @@ -32,6 +33,13 @@ else fi +case "$XBPS_TARGET_MACHINE" in + *-musl) + # XXX disable SSP for cross musl builds for now. + CFLAGS="-fno-stack-protector" + ;; +esac + do_fetch() { git clone -b 0.28 git://github.com/voidlinux/xbps.git xbps-${version} }