flac: modernize derivation

KSJ2000 233cd3ff 3bf8a684

+46 -24
+34 -24
pkgs/by-name/fl/flac/package.nix
··· 1 1 { 2 - lib, 3 - stdenv, 4 - fetchFromGitHub, 5 2 cmake, 6 - pandoc, 7 - pkg-config, 8 3 doxygen, 4 + fetchFromGitHub, 9 5 graphviz, 6 + lib, 10 7 libogg, 8 + nix-update-script, 9 + pandoc, 10 + pkg-config, 11 + stdenv, 12 + versionCheckHook, 11 13 }: 12 14 13 - stdenv.mkDerivation rec { 15 + stdenv.mkDerivation (finalAttrs: { 14 16 pname = "flac"; 15 17 version = "1.5.0"; 16 18 17 19 src = fetchFromGitHub { 18 20 owner = "xiph"; 19 21 repo = "flac"; 20 - tag = version; 22 + tag = finalAttrs.version; 21 23 hash = "sha256-B6XRai5UOAtY/7JXNbI3YuBgazi1Xd2ZOs6vvLq9LIs="; 22 24 }; 23 25 24 26 nativeBuildInputs = [ 25 27 cmake 28 + doxygen 29 + graphviz 26 30 pandoc 27 31 pkg-config 28 - doxygen 29 - graphviz 30 32 ]; 31 33 32 - buildInputs = [ 33 - libogg 34 - ]; 34 + buildInputs = [ libogg ]; 35 35 36 - cmakeFlags = lib.optionals (!stdenv.hostPlatform.isStatic) [ 37 - "-DBUILD_SHARED_LIBS=ON" 38 - ]; 36 + cmakeFlags = lib.optionals (!stdenv.hostPlatform.isStatic) [ "-DBUILD_SHARED_LIBS=ON" ]; 39 37 40 38 CFLAGS = [ 41 39 "-O3" ··· 43 41 ]; 44 42 CXXFLAGS = [ "-O3" ]; 45 43 46 - # doCheck = true; # takes lots of time 44 + patches = [ ./package.patch ]; 45 + doCheck = true; 47 46 48 47 outputs = [ 49 48 "bin" 50 49 "dev" 51 - "out" 52 - "man" 53 50 "doc" 51 + "man" 52 + "out" 54 53 ]; 55 54 56 - meta = with lib; { 55 + nativeInstallCheckInputs = [ versionCheckHook ]; 56 + doInstallCheck = true; 57 + versionCheckProgramArg = "--version"; 58 + 59 + passthru.updateScript = nix-update-script { }; 60 + 61 + meta = { 57 62 homepage = "https://xiph.org/flac/"; 58 63 description = "Library and tools for encoding and decoding the FLAC lossless audio file format"; 59 - changelog = "https://xiph.org/flac/changelog.html"; 64 + changelog = "https://github.com/xiph/flac/releases/tag/${finalAttrs.version}"; 60 65 mainProgram = "flac"; 61 - platforms = platforms.all; 62 - license = licenses.bsd3; 63 - maintainers = with maintainers; [ ruuda ]; 66 + platforms = lib.platforms.all; 67 + license = with lib.licenses; [ 68 + bsd3 69 + fdl13Plus 70 + gpl2Plus 71 + lgpl21Plus 72 + ]; 73 + maintainers = with lib.maintainers; [ ruuda ]; 64 74 }; 65 - } 75 + })
+12
pkgs/by-name/fl/flac/package.patch
··· 1 + diff --git a/test/test_replaygain.sh b/test/test_replaygain.sh 2 + index 11fb77dc..b5dea14c 100755 3 + --- a/test/test_replaygain.sh 4 + +++ b/test/test_replaygain.sh 5 + @@ -140,7 +140,4 @@ for ACTION in $REPLAYGAIN_FREQ ; do 6 + done 7 + done 8 + 9 + - 10 + -rm -f $testdir/out.flac $testdir/out.meta 11 + - 12 + exit 0