pd: fix musl

This commit is contained in:
Enno Boland 2019-08-29 10:17:57 +02:00
parent d062c4ee53
commit fef4971f1d
No known key found for this signature in database
GPG key ID: D09964719BDE9971
2 changed files with 20 additions and 1 deletions

View file

@ -0,0 +1,15 @@
--- src/x_text.c.orig 2019-08-29 10:11:27.734179939 +0200
+++ src/x_text.c 2019-08-29 10:12:06.392225034 +0200
@@ -475,9 +475,10 @@ found in msvcrt (which indeed it isn't i
on this, just call qsort if we're Microsoft and single-instance. I hope nobody
will try to compile multi-instance Pd for 32-bit windows, but if they
do, they might run into my qsort_s problem again. */
-#if defined(_WIN32) && !defined(PDINSTANCE)
+#if (!defined(__GLIBC__) || defined(_WIN32)) && !defined(PDINSTANCE)
#define MICROSOFT_STUPID_SORT
-static void *stupid_zkeyinfo;
+#include <threads.h>
+thread_local static void *stupid_zkeyinfo;
static int stupid_sortcompare(const void *z1, const void *z2) {
return (text_sortcompare(z1, z2, stupid_zkeyinfo)); }
#endif

View file

@ -1,7 +1,7 @@
# Template file for 'pd'
pkgname=pd
version=0.50.0
revision=1
revision=2
_ver=${version%.*}-${version##*.}
wrksrc="$pkgname-$_ver"
build_style=gnu-configure
@ -15,6 +15,10 @@ license="BSD-3-Clause"
homepage="https://puredata.info"
distfiles="http://msp.ucsd.edu/Software/pd-$_ver.src.tar.gz"
checksum=faeacdc24054cc6ce6be801ff5dd3eb7890352295d56c03406c5b85256b1e441
case "$XBPS_TARGET_MACHINE" in
*-musl) # Causes pd to fail if qsort is used without thread local storage.
CFLAGS="-DMICROSOFT_STUPID_SORT" ;;
esac
pre_configure() {
./autogen.sh