mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-21 08:01:31 +00:00
sidplayfp: 2.16.2 -> 3.1.0
Co-authored-by: OPNA2608 <opna2608@protonmail.com>
This commit is contained in:
@@ -6,29 +6,75 @@
|
||||
runCommand,
|
||||
testers,
|
||||
alsaSupport ? stdenv.hostPlatform.isLinux,
|
||||
coreaudioSupport ? stdenv.hostPlatform.isDarwin,
|
||||
jackSupport ? stdenv.hostPlatform.isUnix,
|
||||
pulseSupport ? stdenv.hostPlatform.isLinux,
|
||||
alsa-lib,
|
||||
autoreconfHook,
|
||||
pulseSupport ? stdenv.hostPlatform.isLinux,
|
||||
jack2,
|
||||
libpulseaudio,
|
||||
libsidplayfp,
|
||||
makeWrapper,
|
||||
out123Support ? stdenv.hostPlatform.isDarwin,
|
||||
mpg123,
|
||||
perl,
|
||||
pkg-config,
|
||||
}:
|
||||
|
||||
let
|
||||
miniaudioBackends = [
|
||||
"NULL"
|
||||
]
|
||||
++ lib.optional alsaSupport "ALSA"
|
||||
++ lib.optional coreaudioSupport "COREAUDIO"
|
||||
++ lib.optional jackSupport "JACK"
|
||||
++ lib.optional pulseSupport "PULSEAUDIO";
|
||||
|
||||
miniaudioPkgconfigs =
|
||||
lib.optional alsaSupport "alsa"
|
||||
++ lib.optional jackSupport "jack"
|
||||
++ lib.optional pulseSupport "libpulse";
|
||||
|
||||
miniaudioNeedsPkgconfigs = builtins.length miniaudioPkgconfigs > 0;
|
||||
in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "sidplayfp";
|
||||
version = "2.16.2";
|
||||
version = "3.1.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "libsidplayfp";
|
||||
repo = "sidplayfp";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-zvV1BIKkJF/UAZnSgHFqNSiioUH5iB8I7SDqnWQnGj0=";
|
||||
hash = "sha256-wkZ/iJzz1QikNEaI00PFHaeewOrP+lYHF/iaws1aSro=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace Makefile.am \
|
||||
--replace-fail \
|
||||
'AM_CPPFLAGS =' \
|
||||
"AM_CPPFLAGS = ${
|
||||
toString (
|
||||
[
|
||||
# Don't use dlopen() for audio-related libraries
|
||||
"-DMA_NO_RUNTIME_LINKING"
|
||||
|
||||
# Only selected backends
|
||||
"-DMA_ENABLE_ONLY_SPECIFIC_BACKENDS"
|
||||
]
|
||||
++ map (backend: "-DMA_ENABLE_" + backend) miniaudioBackends
|
||||
++ lib.optionals miniaudioNeedsPkgconfigs [
|
||||
"$(pkg-config --cflags ${toString miniaudioPkgconfigs})"
|
||||
]
|
||||
)
|
||||
}" \
|
||||
--replace-fail 'src_sidplayfp_LDADD =' "src_sidplayfp_LDFLAGS = ${
|
||||
toString (
|
||||
lib.optionals miniaudioNeedsPkgconfigs [
|
||||
"$(pkg-config --libs ${toString miniaudioPkgconfigs})"
|
||||
]
|
||||
++ lib.optionals coreaudioSupport [ "-framework CoreAudio" ]
|
||||
)
|
||||
}"
|
||||
'';
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
@@ -43,15 +89,11 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
++ lib.optionals alsaSupport [
|
||||
alsa-lib
|
||||
]
|
||||
++ lib.optionals jackSupport [
|
||||
jack2
|
||||
]
|
||||
++ lib.optionals pulseSupport [
|
||||
libpulseaudio
|
||||
]
|
||||
++ lib.optionals out123Support [
|
||||
mpg123
|
||||
];
|
||||
|
||||
configureFlags = [
|
||||
(lib.strings.withFeature out123Support "out123")
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
Reference in New Issue
Block a user