From 96739ecb7abfbb97e3bacadeb13ff4f9c94e76e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Buchm=C3=BCller?= Date: Sun, 12 Nov 2017 22:55:26 +0100 Subject: [PATCH] motion: fix musl --- .../patches/musl-no-pthread_getname_np.patch | 29 +++++++++++++++++++ srcpkgs/motion/template | 6 ---- 2 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 srcpkgs/motion/patches/musl-no-pthread_getname_np.patch diff --git a/srcpkgs/motion/patches/musl-no-pthread_getname_np.patch b/srcpkgs/motion/patches/musl-no-pthread_getname_np.patch new file mode 100644 index 00000000000..6e0ce0ceb02 --- /dev/null +++ b/srcpkgs/motion/patches/musl-no-pthread_getname_np.patch @@ -0,0 +1,29 @@ +--- motion.c 2017-11-11 04:47:06.000000000 +0100 ++++ motion.c 2017-11-12 22:49:59.866870114 +0100 +@@ -3774,11 +3774,15 @@ + + #if ((!defined(BSD) && HAVE_PTHREAD_SETNAME_NP) || defined(__APPLE__)) + char currname[16]; ++#if defined(__GLIBC__) + pthread_getname_np(pthread_self(), currname, sizeof(currname)); + snprintf(threadname, sizeof(currname), "%s",currname); + #else + snprintf(threadname, 8, "%s","Unknown"); + #endif ++#else ++ snprintf(threadname, 8, "%s","Unknown"); ++#endif + + } + int util_check_passthrough(struct context *cnt){ +--- logger.c 2017-11-11 04:47:06.000000000 +0100 ++++ logger.c 2017-11-12 22:53:58.717887149 +0100 +@@ -207,7 +207,7 @@ + errno_save = errno; + + char threadname[32] = "unknown"; +-#if ((!defined(BSD) && HAVE_PTHREAD_SETNAME_NP) || defined(__APPLE__)) ++#if ((!defined(BSD) && HAVE_PTHREAD_SETNAME_NP && defined(__GLIBC__)) || defined(__APPLE__)) + pthread_getname_np(pthread_self(), threadname, sizeof(threadname)); + #endif + diff --git a/srcpkgs/motion/template b/srcpkgs/motion/template index 184fddd3e27..d516c9a4c47 100644 --- a/srcpkgs/motion/template +++ b/srcpkgs/motion/template @@ -13,12 +13,6 @@ homepage="https://motion-project.github.io/" distfiles="https://github.com/Motion-Project/motion/archive/release-${version}.tar.gz" checksum=277029c80df0d37deefbbea6d15c66a9067d9166fe8f76eb5f90aa6e97aa9741 -case "$XBPS_TARGET_MACHINE" in - *-musl) broken=yes - ;; -esac - - pre_configure() { autoreconf -fi }