-
Notifications
You must be signed in to change notification settings - Fork 0
/
wstsound.nix
65 lines (57 loc) · 1.22 KB
/
wstsound.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{ stdenv
, lib
, cmake
, gtest
, mcfgthreads
, libmodplug
, libogg
, libvorbis
, mpg123
, openal
, opusfile
, libopus
, tinycmmc
}:
stdenv.mkDerivation {
pname = "wstsound";
version = "0.3.0";
src = ./.;
cmakeFlags = [
"-DWARNINGS=ON"
"-DWERROR=ON"
"-DBUILD_TESTS=ON"
"-DBUILD_EXTRA=ON"
];
postFixup = ""
+ (lib.optionalString stdenv.targetPlatform.isWindows ''
# This is rather ugly, but functional. Nix has a win-dll-link.sh
# for this, but that's currently broken:
# https://github.com/NixOS/nixpkgs/issues/38451
mkdir -p $out/bin/
find ${mcfgthreads} -iname "*.dll" -exec ln -sfv {} $out/bin/ \;
find ${stdenv.cc.cc} -iname "*.dll" -exec ln -sfv {} $out/bin/ \;
ln -sfv ${libmodplug}/bin/*.dll $out/bin/
ln -sfv ${libogg}/bin/*.dll $out/bin/
ln -sfv ${libvorbis}/bin/*.dll $out/bin/
ln -sfv ${mpg123}/bin/*.dll $out/bin/
ln -sfv ${openal}/bin/*.dll $out/bin/
ln -sfv ${opusfile}/bin/*.dll $out/bin/
ln -sfv ${libopus}/bin/*.dll $out/bin/
'');
nativeBuildInputs = [
cmake
];
buildInputs = [
tinycmmc
gtest
];
propagatedBuildInputs = [
libmodplug
libogg
libvorbis
mpg123
openal
opusfile
libopus
];
}