vgmstream: fix build on darwin (#457253)
This commit is contained in:
@@ -13,51 +13,26 @@
|
|||||||
libao,
|
libao,
|
||||||
speex,
|
speex,
|
||||||
nix-update-script,
|
nix-update-script,
|
||||||
|
|
||||||
|
audaciousSupport ? stdenv.hostPlatform.isLinux,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
assert lib.assertMsg (
|
||||||
# https://github.com/vgmstream/vgmstream/blob/1b6a7915bf98ca14a71a0d44bef7a2c6a75c686d/cmake/dependencies/atrac9.cmake
|
audaciousSupport -> stdenv.hostPlatform.isLinux
|
||||||
atrac9-src = fetchFromGitHub {
|
) "Only Linux supports building the Audacious plugin.";
|
||||||
owner = "Thealexbarney";
|
|
||||||
repo = "LibAtrac9";
|
|
||||||
rev = "6a9e00f6c7abd74d037fd210b6670d3cdb313049";
|
|
||||||
hash = "sha256-n47CzIbh8NxJ4GzKLjZQeS27k2lGx08trC1m4AOzVZc=";
|
|
||||||
};
|
|
||||||
|
|
||||||
# https://github.com/vgmstream/vgmstream/blob/1b6a7915bf98ca14a71a0d44bef7a2c6a75c686d/cmake/dependencies/celt.cmake
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
celt-0_6_1-src = fetchzip {
|
|
||||||
url = "https://downloads.xiph.org/releases/celt/celt-0.6.1.tar.gz";
|
|
||||||
hash = "sha256-DI1z10mTDQOn/R1FssaegmOa6ZNx3bXNiWHwLnytJWw=";
|
|
||||||
};
|
|
||||||
celt-0_11_0-src = fetchzip {
|
|
||||||
url = "https://downloads.xiph.org/releases/celt/celt-0.11.0.tar.gz";
|
|
||||||
hash = "sha256-JI3b44iCxQ29bqJGNH/L18pEuWiTFZ2132ceaqe8U0E=";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
pname = "vgmstream";
|
pname = "vgmstream";
|
||||||
version = "2055";
|
version = "2055";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "vgmstream";
|
owner = "vgmstream";
|
||||||
repo = "vgmstream";
|
repo = "vgmstream";
|
||||||
tag = "r${version}";
|
tag = "r${finalAttrs.version}";
|
||||||
hash = "sha256-GNsoWCTLDd49T639lKkLoyBWpWYocDP6gZB2e8ZUyEU=";
|
hash = "sha256-GNsoWCTLDd49T639lKkLoyBWpWYocDP6gZB2e8ZUyEU=";
|
||||||
};
|
};
|
||||||
|
|
||||||
passthru.updateScript = nix-update-script {
|
outputs = [ "out" ] ++ lib.optional audaciousSupport "audacious";
|
||||||
attrPath = "vgmstream";
|
|
||||||
extraArgs = [
|
|
||||||
"--version-regex"
|
|
||||||
"r(.*)"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = [
|
|
||||||
"out"
|
|
||||||
"audacious"
|
|
||||||
];
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
cmake
|
cmake
|
||||||
@@ -71,8 +46,8 @@ stdenv.mkDerivation rec {
|
|||||||
libvorbis
|
libvorbis
|
||||||
libao
|
libao
|
||||||
speex
|
speex
|
||||||
audacious-bare
|
]
|
||||||
];
|
++ lib.optional audaciousSupport audacious-bare;
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
substituteInPlace cmake/dependencies/audacious.cmake \
|
substituteInPlace cmake/dependencies/audacious.cmake \
|
||||||
@@ -83,20 +58,49 @@ stdenv.mkDerivation rec {
|
|||||||
# Therefore, CELT_0110_PATH needs to point to a mutable directory.
|
# Therefore, CELT_0110_PATH needs to point to a mutable directory.
|
||||||
lib.optionalString (stdenv.system == "x86_64-linux") ''
|
lib.optionalString (stdenv.system == "x86_64-linux") ''
|
||||||
mkdir -p dependencies/celt-0.11.0/
|
mkdir -p dependencies/celt-0.11.0/
|
||||||
cp -r ${celt-0_11_0-src}/* dependencies/celt-0.11.0/
|
cp -r ${finalAttrs.passthru.sources.celt-0_11_0-src}/* dependencies/celt-0.11.0/
|
||||||
chmod -R +w dependencies/celt-0.11.0/
|
chmod -R +w dependencies/celt-0.11.0/
|
||||||
'';
|
'';
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
"-DATRAC9_PATH=${atrac9-src}"
|
"-DATRAC9_PATH=${finalAttrs.passthru.sources.atrac9-src}"
|
||||||
|
(lib.cmakeBool "BUILD_AUDACIOUS" audaciousSupport)
|
||||||
]
|
]
|
||||||
# Only supported on x86_64-linux
|
# Only supported on x86_64-linux
|
||||||
++ lib.optionals (stdenv.system == "x86_64-linux") [
|
++ lib.optionals (stdenv.system == "x86_64-linux") [
|
||||||
"-DCELT_0061_PATH=${celt-0_6_1-src}"
|
"-DCELT_0061_PATH=${finalAttrs.passthru.sources.celt-0_6_1-src}"
|
||||||
"-DCELT_0110_PATH=../dependencies/celt-0.11.0"
|
"-DCELT_0110_PATH=../dependencies/celt-0.11.0"
|
||||||
# libg719_decode omitted because it doesn't have a free software license
|
# libg719_decode omitted because it doesn't have a free software license
|
||||||
];
|
];
|
||||||
|
|
||||||
|
passthru = {
|
||||||
|
updateScript = nix-update-script {
|
||||||
|
attrPath = "vgmstream";
|
||||||
|
extraArgs = [
|
||||||
|
"--version-regex"
|
||||||
|
"r(.*)"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
sources = {
|
||||||
|
# https://github.com/vgmstream/vgmstream/blob/1b6a7915bf98ca14a71a0d44bef7a2c6a75c686d/cmake/dependencies/atrac9.cmake
|
||||||
|
atrac9-src = fetchFromGitHub {
|
||||||
|
owner = "Thealexbarney";
|
||||||
|
repo = "LibAtrac9";
|
||||||
|
rev = "6a9e00f6c7abd74d037fd210b6670d3cdb313049";
|
||||||
|
hash = "sha256-n47CzIbh8NxJ4GzKLjZQeS27k2lGx08trC1m4AOzVZc=";
|
||||||
|
};
|
||||||
|
# https://github.com/vgmstream/vgmstream/blob/1b6a7915bf98ca14a71a0d44bef7a2c6a75c686d/cmake/dependencies/celt.cmake
|
||||||
|
celt-0_6_1-src = fetchzip {
|
||||||
|
url = "https://downloads.xiph.org/releases/celt/celt-0.6.1.tar.gz";
|
||||||
|
hash = "sha256-DI1z10mTDQOn/R1FssaegmOa6ZNx3bXNiWHwLnytJWw=";
|
||||||
|
};
|
||||||
|
celt-0_11_0-src = fetchzip {
|
||||||
|
url = "https://downloads.xiph.org/releases/celt/celt-0.11.0.tar.gz";
|
||||||
|
hash = "sha256-JI3b44iCxQ29bqJGNH/L18pEuWiTFZ2132ceaqe8U0E=";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Library for playback of various streamed audio formats used in video games";
|
description = "Library for playback of various streamed audio formats used in video games";
|
||||||
homepage = "https://vgmstream.org";
|
homepage = "https://vgmstream.org";
|
||||||
@@ -110,4 +114,4 @@ stdenv.mkDerivation rec {
|
|||||||
++ optional (stdenv.system == "x86_64-linux") bsd2;
|
++ optional (stdenv.system == "x86_64-linux") bsd2;
|
||||||
platforms = with platforms; unix;
|
platforms = with platforms; unix;
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user