2020-08-04 06:27:30 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2021-03-19 13:02:10 +00:00
|
|
|
, fetchFromGitHub
|
2021-12-10 13:17:56 +00:00
|
|
|
, fetchpatch
|
2021-06-16 08:53:13 +00:00
|
|
|
, nix-update-script
|
2021-03-19 13:02:10 +00:00
|
|
|
, autoreconfHook
|
2021-01-19 06:50:56 +00:00
|
|
|
, pkg-config
|
2021-03-19 13:02:10 +00:00
|
|
|
, perl
|
|
|
|
, unittest-cpp
|
|
|
|
, xa
|
|
|
|
, libgcrypt
|
|
|
|
, libexsid
|
2020-08-04 06:27:30 +00:00
|
|
|
, docSupport ? true
|
2021-03-19 13:02:10 +00:00
|
|
|
, doxygen
|
|
|
|
, graphviz
|
2020-08-04 06:27:30 +00:00
|
|
|
}:
|
2016-08-05 16:50:36 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libsidplayfp";
|
2021-12-08 11:19:39 +00:00
|
|
|
version = "2.3.1";
|
2016-08-05 16:50:36 +00:00
|
|
|
|
2021-03-19 13:02:10 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "libsidplayfp";
|
|
|
|
repo = "libsidplayfp";
|
|
|
|
rev = "v${version}";
|
|
|
|
fetchSubmodules = true;
|
2021-12-08 11:19:39 +00:00
|
|
|
sha256 = "sha256-Cu5mZzsqAO4X4Y8QAn851zIFPVPwxj5pB+jvA62L108=";
|
2016-08-05 16:50:36 +00:00
|
|
|
};
|
|
|
|
|
2021-12-10 13:17:56 +00:00
|
|
|
patches = [
|
|
|
|
# Fixes test failure on x86_64-darwin
|
|
|
|
# Drop when fix for https://github.com/libsidplayfp/libsidplayfp/issues/39 in a release (>2.3.1)
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/libsidplayfp/libsidplayfp/commit/337020a91caa0113de4f4374e0dc770e4056d2c7.patch";
|
|
|
|
sha256 = "0sd7bqic8k945f05d8sk9mshf5d90ykd7f5p6m0n6v3jjhpwmqlq";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-03-19 13:02:10 +00:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs .
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoreconfHook pkg-config perl xa ]
|
|
|
|
++ lib.optionals docSupport [ doxygen graphviz ];
|
|
|
|
|
|
|
|
buildInputs = [ libgcrypt libexsid ];
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
checkInputs = [ unittest-cpp ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2016-08-05 16:50:36 +00:00
|
|
|
|
|
|
|
installTargets = [ "install" ]
|
2021-03-19 13:02:10 +00:00
|
|
|
++ lib.optionals docSupport [ "doc" ];
|
2016-08-05 16:50:36 +00:00
|
|
|
|
2020-08-04 06:27:30 +00:00
|
|
|
outputs = [ "out" ]
|
2021-03-19 13:02:10 +00:00
|
|
|
++ lib.optionals docSupport [ "doc" ];
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--enable-hardsid"
|
|
|
|
"--with-gcrypt"
|
|
|
|
"--with-exsid"
|
|
|
|
]
|
|
|
|
++ lib.optional doCheck "--enable-tests";
|
2016-08-05 16:50:36 +00:00
|
|
|
|
2021-03-19 13:02:10 +00:00
|
|
|
postInstall = lib.optionalString docSupport ''
|
2016-08-05 16:50:36 +00:00
|
|
|
mkdir -p $doc/share/doc/libsidplayfp
|
|
|
|
mv docs/html $doc/share/doc/libsidplayfp/
|
|
|
|
'';
|
|
|
|
|
2021-06-16 08:53:13 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = nix-update-script {
|
|
|
|
attrPath = pname;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-08-04 06:27:30 +00:00
|
|
|
meta = with lib; {
|
2016-08-05 16:50:36 +00:00
|
|
|
description = "A library to play Commodore 64 music derived from libsidplay2";
|
2021-03-19 13:02:10 +00:00
|
|
|
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";
|
2016-08-05 16:50:36 +00:00
|
|
|
license = with licenses; [ gpl2Plus ];
|
2021-03-19 13:02:10 +00:00
|
|
|
maintainers = with maintainers; [ ramkromberg OPNA2608 ];
|
|
|
|
platforms = platforms.all;
|
2016-08-05 16:50:36 +00:00
|
|
|
};
|
|
|
|
}
|