diff --git a/srcpkgs/pd/patches/musl-no-qsort_r.patch b/srcpkgs/pd/patches/musl-no-qsort_r.patch new file mode 100644 index 00000000000..dbc65956d0e --- /dev/null +++ b/srcpkgs/pd/patches/musl-no-qsort_r.patch @@ -0,0 +1,14 @@ +Index: src/x_text.c +=================================================================== +--- src/x_text.c.orig ++++ src/x_text.c +@@ -475,7 +475,8 @@ equal: + * Both are not available in Emscripten, Android or older MSVC versions. + * 'stupid_sortcompare' is thread-safe but not reentrant. + */ +-#if defined(_WIN32) || defined(__EMSCRIPTEN__) || defined(__ANDROID__) ++#if defined(_WIN32) || defined(__EMSCRIPTEN__) || defined(__ANDROID__) \ ++ || (defined(__linux__) && !defined(__GLIBC__)) + #define STUPID_SORT + static PERTHREAD void *stupid_zkeyinfo; + static int stupid_sortcompare(const void *z1, const void *z2) diff --git a/srcpkgs/pd/template b/srcpkgs/pd/template index f40acaf9733..544afccd541 100644 --- a/srcpkgs/pd/template +++ b/srcpkgs/pd/template @@ -15,10 +15,6 @@ license="BSD-3-Clause" homepage="https://puredata.info" distfiles="http://msp.ucsd.edu/Software/pd-$_ver.src.tar.gz" checksum=52591f18316e9f2471ca21c3d6b41c56336e0615ec40a093232e95cc230bfcc1 -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