btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / li / libsidplayfp / package.nix
blob0367e4e3e41af67d6502edb06b4f4242ee55bf94
2   stdenv,
3   lib,
4   fetchFromGitHub,
5   makeFontsConf,
6   nix-update-script,
7   testers,
8   autoreconfHook,
9   docSupport ? true,
10   doxygen,
11   graphviz,
12   libexsid,
13   libgcrypt,
14   perl,
15   pkg-config,
16   unittest-cpp,
17   xa,
20 stdenv.mkDerivation (finalAttrs: {
21   pname = "libsidplayfp";
22   version = "2.11.0";
24   src = fetchFromGitHub {
25     owner = "libsidplayfp";
26     repo = "libsidplayfp";
27     rev = "v${finalAttrs.version}";
28     fetchSubmodules = true;
29     hash = "sha256-O6VzHjJT3k1uLI0bjBDRntLqAZdMurs8onLZ6L6NlIU=";
30   };
32   outputs = [ "out" ] ++ lib.optionals docSupport [ "doc" ];
34   postPatch = ''
35     patchShebangs .
36   '';
38   strictDeps = true;
40   nativeBuildInputs =
41     [
42       autoreconfHook
43       perl
44       pkg-config
45       xa
46     ]
47     ++ lib.optionals docSupport [
48       doxygen
49       graphviz
50     ];
52   buildInputs = [
53     libexsid
54     libgcrypt
55   ];
57   checkInputs = [ unittest-cpp ];
59   enableParallelBuilding = true;
61   configureFlags = [
62     (lib.strings.enableFeature true "hardsid")
63     (lib.strings.withFeature true "gcrypt")
64     (lib.strings.withFeature true "exsid")
65     (lib.strings.enableFeature finalAttrs.finalPackage.doCheck "tests")
66   ];
68   # Make Doxygen happy with the setup, reduce log noise
69   env.FONTCONFIG_FILE = lib.optionalString docSupport (makeFontsConf {
70     fontDirectories = [ ];
71   });
73   preBuild = ''
74     # Reduce noise from fontconfig during doc building
75     export XDG_CACHE_HOME=$TMPDIR
76   '';
78   buildFlags = [ "all" ] ++ lib.optionals docSupport [ "doc" ];
80   doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
82   postInstall = lib.optionalString docSupport ''
83     mkdir -p $doc/share/doc/libsidplayfp
84     mv docs/html $doc/share/doc/libsidplayfp/
85   '';
87   passthru = {
88     tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
89     updateScript = nix-update-script { };
90   };
92   meta = {
93     description = "Library to play Commodore 64 music derived from libsidplay2";
94     longDescription = ''
95       libsidplayfp is a C64 music player library which integrates
96       the reSID SID chip emulation into a cycle-based emulator
97       environment, constantly aiming to improve emulation of the
98       C64 system and the SID chips.
99     '';
100     homepage = "https://github.com/libsidplayfp/libsidplayfp";
101     changelog = "https://github.com/libsidplayfp/libsidplayfp/releases/tag/v${finalAttrs.version}";
102     license = with lib.licenses; [ gpl2Plus ];
103     maintainers = with lib.maintainers; [
104       ramkromberg
105       OPNA2608
106     ];
107     platforms = lib.platforms.all;
108     pkgConfigModules = [
109       "libsidplayfp"
110       "libstilview"
111     ];
112   };