Merge pull request #203130 from wegank/aacgain-bump

This commit is contained in:
Sandro 2022-12-03 05:02:28 +01:00 committed by GitHub
commit 70e765c85e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 67 deletions

View File

@ -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";
}}
)
cp -R ${faad2.src}/* 3rdparty/faad2
cp -R ${mp4v2.src}/* 3rdparty/mp4v2
chmod -R +w 3rdparty
'';
configurePhase = ''
runHook preConfigure
cd mp4v2
./configure
nativeBuildInputs = [
cmake
autoconf
automake
libtool
];
cd ../faad2
./configure
cd ..
./configure
runHook postConfigure
'';
buildPhase = ''
runHook preBuild
cd mp4v2
make libmp4v2.la
cd ../faad2
make LDFLAGS=-static
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 ];
};
}

View File

@ -2,29 +2,17 @@
stdenv.mkDerivation rec {
pname = "mp4v2";
version = "4.1.3";
version = "5.0.1";
src = fetchFromGitHub {
# 2020-06-20: THE current upstream, maintained and used in distros fork.
owner = "TechSmith";
repo = "mp4v2";
rev = "Release-ThirdParty-MP4v2-${version}";
sha256 = "053a0lgy819sbz92cfkq0vmkn2ky39bva554pj4ypky1j6vs04fv";
sha256 = "sha256-OP+oVTH9pqYfHtYL1Kjrs1qey/J40ijLi5Gu8GJnvSY=";
};
patches = [
(fetchurl {
# 2020-06-19: NOTE: # Fix build with C++11
# Close when https://github.com/TechSmith/mp4v2/pull/36 merged/closed.
url = "https://raw.githubusercontent.com/archlinux/svntogit-packages/203f5a72bc97ffe089b424c47b07dd9eaea35713/trunk/libmp4v2-c++11.patch";
sha256 = "0sbn0il7lmk77yrjyb4f0a3z3h8gsmdkscvz5n9hmrrrhrwf672w";
})
] ++ lib.optionals stdenv.cc.isClang [
# unbreak build with Clang≥6 (C++14 by default). Based on https://reviews.freebsd.org/rP458678
./fix-build-clang.patch
];
NIX_CFLAGS_COMPILE = [ "-Wno-error=narrowing" ];
NIX_CFLAGS_COMPILE = "-Wno-error=narrowing";
# `faac' expects `mp4.h'.
postInstall = "ln -s mp4v2/mp4v2.h $out/include/mp4.h";