about summary refs log tree commit diff
path: root/pkgs/tools/misc/timidity/default.nix
diff options
context:
space:
mode:
authorRandy Eckenrode <randy@largeandhighquality.com>2023-09-05 19:49:10 -0400
committerRandy Eckenrode <randy@largeandhighquality.com>2023-09-06 18:05:20 -0400
commit6943a9a6febe3eb9fb8310082ff420896f8fae1e (patch)
tree7a3af13aca629f6a06f453564b0ce9ce392acbe1 /pkgs/tools/misc/timidity/default.nix
parentdba6d77ad232e3a5ffc5e281ebbada4fe0e23981 (diff)
timidity: fix build with clang 16
* Work around failing configure tests. Specify the expected value
  explictly except when that doesn’t work. Otherwise, patch the
  configure script to perform the test correctly with clang 16;
* Add libobjc on Darwin; and
* Use memstreamHook on x86_64-darwin;
Diffstat (limited to 'pkgs/tools/misc/timidity/default.nix')
-rw-r--r--pkgs/tools/misc/timidity/default.nix32
1 files changed, 27 insertions, 5 deletions
diff --git a/pkgs/tools/misc/timidity/default.nix b/pkgs/tools/misc/timidity/default.nix
index d9750b4382562..e88ba3fea3527 100644
--- a/pkgs/tools/misc/timidity/default.nix
+++ b/pkgs/tools/misc/timidity/default.nix
@@ -1,6 +1,14 @@
-{ lib, stdenv, fetchurl
-, pkg-config, buildPackages
-, CoreAudio, alsa-lib, libjack2, ncurses
+{ lib
+, stdenv
+, fetchurl
+, pkg-config
+, memstreamHook
+, CoreAudio
+, libobjc
+, libjack2
+, ncurses
+, alsa-lib
+, buildPackages
 }:
 
 stdenv.mkDerivation rec {
@@ -12,9 +20,15 @@ stdenv.mkDerivation rec {
     sha256 = "1xf8n6dqzvi6nr2asags12ijbj1lwk1hgl3s27vm2szib8ww07qn";
   };
 
-  patches = [ ./timidity-iA-Oj.patch ];
+  patches = [
+    ./timidity-iA-Oj.patch
+    # Fixes misdetection of features by clang 16. The configure script itself is patched because
+    # it is old and does not work nicely with autoreconfHook.
+    ./configure-compat.patch
+  ];
 
-  nativeBuildInputs = [ pkg-config ];
+  nativeBuildInputs = [ pkg-config ]
+    ++ lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [ memstreamHook ];
   buildInputs = [
     libjack2
     ncurses
@@ -22,6 +36,7 @@ stdenv.mkDerivation rec {
     alsa-lib
   ] ++ lib.optionals stdenv.isDarwin [
     CoreAudio
+    libobjc
   ];
 
   configureFlags = [
@@ -36,6 +51,13 @@ stdenv.mkDerivation rec {
   ] ++ lib.optionals stdenv.isDarwin [
     "--enable-audio=darwin,jack"
     "lib_cv_va_val_copy=no"
+    "timidity_cv_ccoption_rdynamic=yes"
+    # These configure tests fail because of incompatible function pointer conversions.
+    "ac_cv_func_vprintf=yes"
+    "ac_cv_func_popen=yes"
+    "ac_cv_func_vsnprintf=yes"
+    "ac_cv_func_snprintf=yes"
+    "ac_cv_func_open_memstream=yes"
   ];
 
   makeFlags = [