nixpkgs/pkgs/by-name/li/libsidplayfp/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

114 lines
2.6 KiB
Nix

{
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.11.0";
src = fetchFromGitHub {
owner = "libsidplayfp";
repo = "libsidplayfp";
rev = "v${finalAttrs.version}";
fetchSubmodules = true;
hash = "sha256-O6VzHjJT3k1uLI0bjBDRntLqAZdMurs8onLZ6L6NlIU=";
};
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
env.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 = {
description = "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";
changelog = "https://github.com/libsidplayfp/libsidplayfp/releases/tag/v${finalAttrs.version}";
license = with lib.licenses; [ gpl2Plus ];
maintainers = with lib.maintainers; [
ramkromberg
OPNA2608
];
platforms = lib.platforms.all;
pkgConfigModules = [
"libsidplayfp"
"libstilview"
];
};
})