about summary refs log tree commit diff
path: root/pkgs/development/libraries
diff options
context:
space:
mode:
authorNick Cao <nickcao@nichi.co>2023-12-29 11:00:48 -0500
committerGitHub <noreply@github.com>2023-12-29 11:00:48 -0500
commit2aaa30fd50660ac75276833efc467f006a8da225 (patch)
treebe81759b822475a12f8dc1f34965633ff21bd269 /pkgs/development/libraries
parent139b0cde02775384f6437a9b054946756ff4a7d7 (diff)
parentf4e3ecb31e90dbcf6aaa4f6b317e2a198b054b06 (diff)
Merge pull request #277381 from OPNA2608/update/libsidplayfp
{,lib}sidplayfp: 2.5.0 -> 2.5.1, cleanups
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r--pkgs/development/libraries/libsidplayfp/default.nix95
1 files changed, 65 insertions, 30 deletions
diff --git a/pkgs/development/libraries/libsidplayfp/default.nix b/pkgs/development/libraries/libsidplayfp/default.nix
index b8b62781d0a69..fbfdc0b7ff0de 100644
--- a/pkgs/development/libraries/libsidplayfp/default.nix
+++ b/pkgs/development/libraries/libsidplayfp/default.nix
@@ -4,38 +4,55 @@
 , fetchpatch
 , makeFontsConf
 , nix-update-script
+, testers
 , autoreconfHook
-, pkg-config
-, perl
-, unittest-cpp
-, xa
-, libgcrypt
-, libexsid
 , docSupport ? true
 , doxygen
 , graphviz
+, libexsid
+, libgcrypt
+, perl
+, pkg-config
+, unittest-cpp
+, xa
 }:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "libsidplayfp";
-  version = "2.5.0";
+  version = "2.5.1";
 
   src = fetchFromGitHub {
     owner = "libsidplayfp";
     repo = "libsidplayfp";
-    rev = "v${version}";
+    rev = "v${finalAttrs.version}";
     fetchSubmodules = true;
-    sha256 = "sha256-KCp/8UjVl8e3+4s1FD4GvHP7AUAS+eIB7RWhmgm5GIA=";
+    hash = "sha256-1e1QDSJ8CjLU794saba2auCKko7p2ylrdI0JWhh8Kco=";
   };
 
+  outputs = [
+    "out"
+  ] ++ lib.optionals docSupport [
+    "doc"
+  ];
+
   patches = [
     # Pull autoconf-2.72 compatibility fix:
     #   https://github.com/libsidplayfp/libsidplayfp/pull/103
+    # Remove when version > 2.5.1
     (fetchpatch {
-      name = "autoconf-2.72";
-      url = "https://github.com/libsidplayfp/libsidplayfp/commit/b8fff55f6aaa005a3899b59e70cd8730f962641b.patch";
+      name = "0001-libsidplayfp-autoconf-2.72-compat.patch";
+      url = "https://github.com/libsidplayfp/libsidplayfp/commit/2b1b41beb5099d5697e3f8416d78f27634732a9e.patch";
       hash = "sha256-5Hk202IuHUBow7HnnPr2/ieWFjKDuHLQjQ9mJUML9q8=";
     })
+
+    # Fix --disable-tests logic
+    # https://github.com/libsidplayfp/libsidplayfp/pull/108
+    # Remove when version > 2.5.1
+    (fetchpatch {
+      name = "0002-libsidplayfp-Fix-autoconf-logic-for-tests-option.patch";
+      url = "https://github.com/libsidplayfp/libsidplayfp/commit/39dd2893b6186c4932d17b529bb62627b742b742.patch";
+      hash = "sha256-ErdfPvu8R81XxdHu2TaV87OpLFlRhJai51QcYUIkUZ4=";
+    })
   ];
 
   postPatch = ''
@@ -44,30 +61,35 @@ stdenv.mkDerivation rec {
 
   strictDeps = true;
 
-  nativeBuildInputs = [ autoreconfHook pkg-config perl xa ]
-    ++ lib.optionals docSupport [ doxygen graphviz ];
-
-  buildInputs = [ libgcrypt libexsid ];
+  nativeBuildInputs = [
+    autoreconfHook
+    perl
+    pkg-config
+    xa
+  ] ++ lib.optionals docSupport [
+    doxygen
+    graphviz
+  ];
 
-  doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
+  buildInputs = [
+    libexsid
+    libgcrypt
+  ];
 
-  checkInputs = [ unittest-cpp ];
+  checkInputs = [
+    unittest-cpp
+  ];
 
   enableParallelBuilding = true;
 
-  installTargets = [ "install" ]
-    ++ lib.optionals docSupport [ "doc" ];
-
-  outputs = [ "out" ]
-    ++ lib.optionals docSupport [ "doc" ];
-
   configureFlags = [
-    "--enable-hardsid"
-    "--with-gcrypt"
-    "--with-exsid"
-  ]
-  ++ lib.optional doCheck "--enable-tests";
+    (lib.strings.enableFeature true "hardsid")
+    (lib.strings.withFeature true "gcrypt")
+    (lib.strings.withFeature true "exsid")
+    (lib.strings.enableFeature finalAttrs.finalPackage.doCheck "tests")
+  ];
 
+  # Make Doxygen happy with the setup, reduce log noise
   FONTCONFIG_FILE = lib.optionalString docSupport (makeFontsConf { fontDirectories = [ ]; });
 
   preBuild = ''
@@ -75,12 +97,21 @@ stdenv.mkDerivation rec {
     export XDG_CACHE_HOME=$TMPDIR
   '';
 
+  buildFlags = [
+    "all"
+  ] ++ lib.optionals docSupport [
+    "doc"
+  ];
+
+  doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
+
   postInstall = lib.optionalString docSupport ''
     mkdir -p $doc/share/doc/libsidplayfp
     mv docs/html $doc/share/doc/libsidplayfp/
   '';
 
   passthru = {
+    tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
     updateScript = nix-update-script { };
   };
 
@@ -96,5 +127,9 @@ stdenv.mkDerivation rec {
     license = with licenses; [ gpl2Plus ];
     maintainers = with maintainers; [ ramkromberg OPNA2608 ];
     platforms = platforms.all;
+    pkgConfigModules = [
+      "libsidplayfp"
+      "libstilview"
+    ];
   };
-}
+})