From fef4971f1d7961a5354c0817728b86a345214208 Mon Sep 17 00:00:00 2001 From: Enno Boland Date: Thu, 29 Aug 2019 10:17:57 +0200 Subject: [PATCH] pd: fix musl --- srcpkgs/pd/patches/fix-musl.patch | 15 +++++++++++++++ srcpkgs/pd/template | 6 +++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/pd/patches/fix-musl.patch diff --git a/srcpkgs/pd/patches/fix-musl.patch b/srcpkgs/pd/patches/fix-musl.patch new file mode 100644 index 00000000000..6e1d1f0eaa2 --- /dev/null +++ b/srcpkgs/pd/patches/fix-musl.patch @@ -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 ++thread_local static void *stupid_zkeyinfo; + static int stupid_sortcompare(const void *z1, const void *z2) { + return (text_sortcompare(z1, z2, stupid_zkeyinfo)); } + #endif diff --git a/srcpkgs/pd/template b/srcpkgs/pd/template index f798945141a..5f3fb5815a3 100644 --- a/srcpkgs/pd/template +++ b/srcpkgs/pd/template @@ -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