diff --git a/srcpkgs/asio/patches/musl_strerror_r.patch b/srcpkgs/asio/patches/musl_strerror_r.patch new file mode 100644 index 0000000000..b5fb0f306a --- /dev/null +++ b/srcpkgs/asio/patches/musl_strerror_r.patch @@ -0,0 +1,11 @@ +--- include/asio/impl/error_code.ipp 2015-03-23 21:28:30.000000000 +0100 ++++ include/asio/impl/error_code.ipp 2015-07-12 14:49:24.720507062 +0200 +@@ -100,7 +100,7 @@ + #elif defined(__MACH__) && defined(__APPLE__) \ + || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) \ + || defined(_AIX) || defined(__hpux) || defined(__osf__) \ +- || defined(__ANDROID__) ++ || defined(__ANDROID__) || defined(MUSL_LIBC) + char buf[256] = ""; + using namespace std; + strerror_r(value, buf, sizeof(buf)); diff --git a/srcpkgs/asio/template b/srcpkgs/asio/template index 2ced8a955e..a791c3b946 100644 --- a/srcpkgs/asio/template +++ b/srcpkgs/asio/template @@ -1,7 +1,7 @@ # Template file for 'asio' pkgname=asio version=1.10.6 -revision=1 +revision=2 build_style=gnu-configure makedepends="boost-devel" depends="boost-devel" @@ -11,3 +11,11 @@ license="Boost" homepage="http://asio.sourceforge.net" distfiles="${SOURCEFORGE_SITE}/asio/asio-${version}.tar.bz2" checksum=e0d71c40a7b1f6c1334008fb279e7361b32a063e020efd21e40d9d8ff037195e + +pre_configure() { + case "$XBPS_TARGET_MACHINE" in + *-musl) # Enable strerror_r(3) version for musl libc + sed -e "/#define ASIO_IMPL_ERROR_CODE_IPP/a #define MUSL_LIBC" \ + -i ${wrksrc}/include/asio/impl/error_code.ipp + esac +}