about summary refs log tree commit diff
path: root/pkgs/applications/audio/cdparanoia
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2022-04-30 13:17:41 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2022-04-30 16:18:20 -0400
commit8a00f0ca38b0c841f5d7a55bca4280bf0b46a96c (patch)
tree550476905844db4226321181f2637760366c885d /pkgs/applications/audio/cdparanoia
parentf153271f124108dc89c1bba2883adf782ad759ff (diff)
cdparanoiaIII: Cleanup
Handle CC the normal way, `unset CC` was from quite old
28b6fb61e651a3e2cca57d087781e7ba6ab45e7c during early macOS experiments
and no longer needed.

Regenerate autoconf stuff unconditionally because it is so old, and
unconditional is just simpler.

Put conditional patches after unconditional ones as is more idiomatic.
Diffstat (limited to 'pkgs/applications/audio/cdparanoia')
-rw-r--r--pkgs/applications/audio/cdparanoia/configure.patch22
-rw-r--r--pkgs/applications/audio/cdparanoia/default.nix25
2 files changed, 36 insertions, 11 deletions
diff --git a/pkgs/applications/audio/cdparanoia/configure.patch b/pkgs/applications/audio/cdparanoia/configure.patch
new file mode 100644
index 0000000000000..81c50cec814ab
--- /dev/null
+++ b/pkgs/applications/audio/cdparanoia/configure.patch
@@ -0,0 +1,22 @@
+diff --git a/configure.in b/configure.ac
+similarity index 90%
+rename from configure.in
+rename to configure.ac
+index 3ad98ca11da..8fad378faf4 100644
+--- a/configure.in
++++ b/configure.ac
+@@ -1,13 +1,8 @@
+ AC_INIT(interface/interface.c)
+ 
+-cp $srcdir/configure.guess $srcdir/config.guess
+-cp $srcdir/configure.sub $srcdir/config.sub
+-
+ AC_CANONICAL_HOST
+ 
+-if test -z "$CC"; then
+-	AC_PROG_CC	
+-fi
++AC_PROG_CC
+ AC_PROG_RANLIB
+ AC_CHECK_PROG(AR,ar,ar)
+ AC_CHECK_PROG(INSTALL,install,install)
diff --git a/pkgs/applications/audio/cdparanoia/default.nix b/pkgs/applications/audio/cdparanoia/default.nix
index 10ff66de77ed4..2c13631624e77 100644
--- a/pkgs/applications/audio/cdparanoia/default.nix
+++ b/pkgs/applications/audio/cdparanoia/default.nix
@@ -1,4 +1,7 @@
-{ lib, stdenv, fetchurl, gnu-config, IOKit, Carbon }:
+{ lib, stdenv, fetchurl
+, updateAutotoolsGnuConfigScriptsHook, autoreconfHook
+, IOKit, Carbon
+}:
 
 stdenv.mkDerivation rec {
   pname = "cdparanoia-III";
@@ -9,7 +12,10 @@ stdenv.mkDerivation rec {
     sha256 = "1pv4zrajm46za0f6lv162iqffih57a8ly4pc69f7y0gfyigb8p80";
   };
 
-  patches = lib.optionals stdenv.isDarwin [
+  patches = [
+    ./fix_private_keyword.patch
+    ./configure.patch
+  ] ++ lib.optionals stdenv.isDarwin [
     (fetchurl {
       url = "https://trac.macports.org/export/70964/trunk/dports/audio/cdparanoia/files/osx_interface.patch";
       sha256 = "1n86kzm2ssl8fdf5wlhp6ncb2bf6b9xlb5vg0mhc85r69prqzjiy";
@@ -18,8 +24,12 @@ stdenv.mkDerivation rec {
       url = "https://trac.macports.org/export/70964/trunk/dports/audio/cdparanoia/files/patch-paranoia_paranoia.c.10.4.diff";
       sha256 = "17l2qhn8sh4jy6ryy5si6ll6dndcm0r537rlmk4a6a8vkn852vad";
     })
-    ] ++ lib.optional stdenv.hostPlatform.isMusl ./utils.patch
-    ++ [./fix_private_keyword.patch];
+  ] ++ lib.optional stdenv.hostPlatform.isMusl ./utils.patch;
+
+  nativeBuildInputs = [
+    updateAutotoolsGnuConfigScriptsHook
+    autoreconfHook
+  ];
 
   propagatedBuildInputs = lib.optionals stdenv.isDarwin [
     Carbon
@@ -28,13 +38,6 @@ stdenv.mkDerivation rec {
 
   hardeningDisable = [ "format" ];
 
-  preConfigure = ''
-    unset CC
-  '' + lib.optionalString (!stdenv.hostPlatform.isx86) ''
-    cp ${gnu-config}/config.sub configure.sub
-    cp ${gnu-config}/config.guess configure.guess
-  '';
-
   # Build system reuses the same object file names for shared and static
   # library. Occasionally fails in the middle:
   #    gcc -O2 -fsigned-char -g -O2 -c scan_devices.c