about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libsidplayfp
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libsidplayfp')
-rw-r--r--nixpkgs/pkgs/development/libraries/libsidplayfp/default.nix114
1 files changed, 114 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libsidplayfp/default.nix b/nixpkgs/pkgs/development/libraries/libsidplayfp/default.nix
new file mode 100644
index 000000000000..ba1b003442ff
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsidplayfp/default.nix
@@ -0,0 +1,114 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, makeFontsConf
+, nix-update-script
+, testers
+, autoreconfHook
+, docSupport ? true
+, doxygen
+, graphviz
+, libexsid
+, libgcrypt
+, perl
+, pkg-config
+, unittest-cpp
+, xa
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "libsidplayfp";
+  version = "2.6.0";
+
+  src = fetchFromGitHub {
+    owner = "libsidplayfp";
+    repo = "libsidplayfp";
+    rev = "v${finalAttrs.version}";
+    fetchSubmodules = true;
+    hash = "sha256-6Gbujz20EHQ7s9GaPpEPju+WqePjpduJqb5hcrswTm8=";
+  };
+
+  outputs = [
+    "out"
+  ] ++ lib.optionals docSupport [
+    "doc"
+  ];
+
+  postPatch = ''
+    patchShebangs .
+  '';
+
+  strictDeps = true;
+
+  nativeBuildInputs = [
+    autoreconfHook
+    perl
+    pkg-config
+    xa
+  ] ++ lib.optionals docSupport [
+    doxygen
+    graphviz
+  ];
+
+  buildInputs = [
+    libexsid
+    libgcrypt
+  ];
+
+  checkInputs = [
+    unittest-cpp
+  ];
+
+  enableParallelBuilding = true;
+
+  configureFlags = [
+    (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 = ''
+    # Reduce noise from fontconfig during doc building
+    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 { };
+  };
+
+  meta = with lib; {
+    description = "A library to play Commodore 64 music derived from libsidplay2";
+    longDescription = ''
+      libsidplayfp is a C64 music player library which integrates
+      the reSID SID chip emulation into a cycle-based emulator
+      environment, constantly aiming to improve emulation of the
+      C64 system and the SID chips.
+    '';
+    homepage = "https://github.com/libsidplayfp/libsidplayfp";
+    license = with licenses; [ gpl2Plus ];
+    maintainers = with maintainers; [ ramkromberg OPNA2608 ];
+    platforms = platforms.all;
+    pkgConfigModules = [
+      "libsidplayfp"
+      "libstilview"
+    ];
+  };
+})