summary refs log tree commit diff
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2022-12-03 02:59:06 +0100
committerWeijia Wang <9713184+wegank@users.noreply.github.com>2022-12-03 02:59:06 +0100
commitc27f6444ac472df00af01bd528b2966168f297e4 (patch)
tree1b52f460158677f85ac82a106316279e5a126b57
parentb3600b548eee0d25ffb0d5e7e0ea7461420c4a95 (diff)
downloadnixpkgs-c27f6444ac472df00af01bd528b2966168f297e4.tar
nixpkgs-c27f6444ac472df00af01bd528b2966168f297e4.tar.gz
nixpkgs-c27f6444ac472df00af01bd528b2966168f297e4.tar.bz2
nixpkgs-c27f6444ac472df00af01bd528b2966168f297e4.tar.lz
nixpkgs-c27f6444ac472df00af01bd528b2966168f297e4.tar.xz
nixpkgs-c27f6444ac472df00af01bd528b2966168f297e4.tar.zst
nixpkgs-c27f6444ac472df00af01bd528b2966168f297e4.zip
aacgain: 1.9.0 -> 2.0.0
-rw-r--r--pkgs/applications/audio/aacgain/default.nix81
1 files changed, 29 insertions, 52 deletions
diff --git a/pkgs/applications/audio/aacgain/default.nix b/pkgs/applications/audio/aacgain/default.nix
index 517a53a5fec..62a72fea62a 100644
--- a/pkgs/applications/audio/aacgain/default.nix
+++ b/pkgs/applications/audio/aacgain/default.nix
@@ -1,68 +1,45 @@
-{ lib, stdenv, fetchFromGitLab, fetchpatch }:
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, autoconf
+, automake
+, libtool
+, faad2
+, mp4v2
+}:
 
 stdenv.mkDerivation rec {
   pname = "aacgain";
-  version = "1.9.0";
+  version = "2.0.0";
 
-  src = fetchFromGitLab {
-    owner = "mulx";
-    repo = "aacgain";
-    rev = "7c29dccd878ade1301710959aeebe87a8f0828f5";
-    sha256 = "07hl432vsscqg01b6wr99qmsj4gbx0i02x4k565432y6zpfmaxm0";
+  src = fetchFromGitHub {
+    owner = "dgilman";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-9Y23Zh7q3oB4ha17Fpm1Hu2+wtQOA1llj6WDUAO2ARU=";
   };
 
-  hardeningDisable = [ "format" ];
-
-  # -Wnarrowing is enabled by default in recent GCC versions,
-  # causing compilation to fail.
-  NIX_CFLAGS_COMPILE = "-Wno-narrowing";
-
   postPatch = ''
-    (
-      cd mp4v2
-      patch -p0 < ${fetchpatch {
-        name = "fix_missing_ptr_deref.patch";
-        url = "https://aur.archlinux.org/cgit/aur.git/plain/fix_missing_ptr_deref.patch?h=aacgain-cvs&id=e1a19c920f57063e64bab75cb0d8624731f6e3d7";
-        sha256 = "1cq7r005nvmwdjb25z80grcam7jv6k57jnl2bh349mg3ajmslbq9";
-      }}
-    )
-  '';
-
-  configurePhase = ''
-    runHook preConfigure
-    cd mp4v2
-    ./configure
-
-    cd ../faad2
-    ./configure
-
-    cd ..
-    ./configure
-    runHook postConfigure
+    cp -R ${faad2.src}/* 3rdparty/faad2
+    cp -R ${mp4v2.src}/* 3rdparty/mp4v2
+    chmod -R +w 3rdparty
   '';
 
-  buildPhase = ''
-    runHook preBuild
-    cd mp4v2
-    make libmp4v2.la
-
-    cd ../faad2
-    make LDFLAGS=-static
+  nativeBuildInputs = [
+    cmake
+    autoconf
+    automake
+    libtool
+  ];
 
-    cd ..
-    make
-    runHook postBuild
-  '';
-
-  installPhase = ''
-    install -D aacgain/aacgain "$out/bin/aacgain"
-  '';
+  NIX_CFLAGS_COMPILE = "-Wno-error=narrowing";
 
   meta = with lib; {
     description = "ReplayGain for AAC files";
-    homepage = "https://aacgain.altosdesign.com";
-    license = licenses.gpl2;
-    platforms = platforms.linux;
+    homepage = "https://github.com/dgilman/aacgain";
+    license = licenses.gpl2Plus;
+    platforms = platforms.unix;
     maintainers = [ maintainers.robbinch ];
   };
 }