zandronum: sound improvements
* Update fmod version to one with PulseAudio support; * Dynamically link FluidSynth instead of using LD_LIBRARY_PATH; * Use system libgme. Fixes sound on some machines.
This commit is contained in:
parent
94f0ef6628
commit
f7c2288cfc
@ -1,5 +1,5 @@
|
|||||||
{ stdenv, lib, fetchhg, cmake, pkgconfig, makeWrapper, callPackage
|
{ stdenv, lib, fetchhg, cmake, pkgconfig, makeWrapper, callPackage
|
||||||
, soundfont-fluid, SDL, libGLU_combined, glew, bzip2, zlib, libjpeg, fluidsynth, openssl, gtk2, python3
|
, soundfont-fluid, SDL, libGL, glew, bzip2, zlib, libjpeg, fluidsynth, openssl, gtk2, python3, libgme
|
||||||
, serverOnly ? false
|
, serverOnly ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
@ -7,6 +7,7 @@ let
|
|||||||
suffix = lib.optionalString serverOnly "-server";
|
suffix = lib.optionalString serverOnly "-server";
|
||||||
fmod = callPackage ./fmod.nix { };
|
fmod = callPackage ./fmod.nix { };
|
||||||
sqlite = callPackage ./sqlite.nix { };
|
sqlite = callPackage ./sqlite.nix { };
|
||||||
|
clientLibPath = lib.makeLibraryPath [ fluidsynth ];
|
||||||
|
|
||||||
in stdenv.mkDerivation {
|
in stdenv.mkDerivation {
|
||||||
name = "zandronum${suffix}-3.0";
|
name = "zandronum${suffix}-3.0";
|
||||||
@ -27,8 +28,8 @@ in stdenv.mkDerivation {
|
|||||||
|
|
||||||
# I have no idea why would SDL and libjpeg be needed for the server part!
|
# I have no idea why would SDL and libjpeg be needed for the server part!
|
||||||
# But they are.
|
# But they are.
|
||||||
buildInputs = [ openssl bzip2 zlib SDL libjpeg sqlite ]
|
buildInputs = [ openssl bzip2 zlib SDL libjpeg sqlite libgme ]
|
||||||
++ lib.optionals (!serverOnly) [ libGLU_combined glew fmod fluidsynth gtk2 ];
|
++ lib.optionals (!serverOnly) [ libGL glew fmod fluidsynth gtk2 ];
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake pkgconfig makeWrapper python3 ];
|
nativeBuildInputs = [ cmake pkgconfig makeWrapper python3 ];
|
||||||
|
|
||||||
@ -44,9 +45,10 @@ in stdenv.mkDerivation {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
cmakeFlags =
|
cmakeFlags =
|
||||||
lib.optional (!serverOnly) "-DFMOD_LIBRARY=${fmod}/lib/libfmodex.so"
|
[ "-DFORCE_INTERNAL_GME=OFF" ]
|
||||||
++ lib.optional serverOnly "-DSERVERONLY=ON"
|
++ (if serverOnly
|
||||||
;
|
then [ "-DSERVERONLY=ON" ]
|
||||||
|
else [ "-DFMOD_LIBRARY=${fmod}/lib/libfmodex.so" ]);
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
@ -59,16 +61,18 @@ in stdenv.mkDerivation {
|
|||||||
*.pk3 \
|
*.pk3 \
|
||||||
${lib.optionalString (!serverOnly) "liboutput_sdl.so"} \
|
${lib.optionalString (!serverOnly) "liboutput_sdl.so"} \
|
||||||
$out/lib/zandronum
|
$out/lib/zandronum
|
||||||
'' + (if (!serverOnly) then
|
makeWrapper $out/lib/zandronum/zandronum${suffix} $out/bin/zandronum${suffix}
|
||||||
''makeWrapper $out/lib/zandronum/zandronum $out/bin/zandronum --prefix LD_LIBRARY_PATH : "$LD_LIBRARY_PATH:${fluidsynth}/lib"''
|
'';
|
||||||
else
|
|
||||||
''makeWrapper $out/lib/zandronum/zandronum${suffix} $out/bin/zandronum${suffix}'');
|
|
||||||
|
|
||||||
postFixup = lib.optionalString (!serverOnly) ''
|
postFixup = lib.optionalString (!serverOnly) ''
|
||||||
patchelf --set-rpath $(patchelf --print-rpath $out/lib/zandronum/zandronum):$out/lib/zandronum \
|
patchelf --set-rpath $(patchelf --print-rpath $out/lib/zandronum/zandronum):$out/lib/zandronum:${clientLibPath} \
|
||||||
$out/lib/zandronum/zandronum
|
$out/lib/zandronum/zandronum
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
passthru = {
|
||||||
|
inherit fmod sqlite;
|
||||||
|
};
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
homepage = http://zandronum.com/;
|
homepage = http://zandronum.com/;
|
||||||
description = "Multiplayer oriented port, based off Skulltag, for Doom and Doom II by id Software";
|
description = "Multiplayer oriented port, based off Skulltag, for Doom and Doom II by id Software";
|
||||||
|
@ -1,52 +1,35 @@
|
|||||||
{ stdenv, fetchurl }:
|
{ stdenv, lib, fetchurl, alsaLib, libpulseaudio }:
|
||||||
|
|
||||||
assert (stdenv.system == "x86_64-linux") || (stdenv.system == "i686-linux");
|
|
||||||
let
|
let
|
||||||
bits = stdenv.lib.optionalString (stdenv.system == "x86_64-linux") "64";
|
bits = stdenv.lib.optionalString (stdenv.system == "x86_64-linux") "64";
|
||||||
|
libPath = lib.makeLibraryPath [ stdenv.cc.cc alsaLib libpulseaudio ];
|
||||||
|
|
||||||
libPath = stdenv.lib.makeLibraryPath
|
|
||||||
[ stdenv.cc.libc stdenv.cc.cc ] + ":${stdenv.cc.cc.lib}/lib64";
|
|
||||||
patchLib = x: "patchelf --set-rpath ${libPath} ${x}";
|
|
||||||
|
|
||||||
src =
|
|
||||||
(if (bits == "64") then
|
|
||||||
fetchurl {
|
|
||||||
url = "http://zandronum.com/essentials/fmod/fmodapi42416linux64.tar.gz";
|
|
||||||
sha256 = "0hkwlzchzzgd7fanqznbv5bs53z2qy8iiv9l2y77l4sg1jwmlm6y";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
fetchurl {
|
|
||||||
url = "http://zandronum.com/essentials/fmod/fmodapi42416linux.tar.gz";
|
|
||||||
sha256 = "13diw3ax2slkr99mwyjyc62b8awc30k0z08cvkpk2p3i1j6f85m5";
|
|
||||||
}
|
|
||||||
);
|
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
inherit src;
|
|
||||||
|
|
||||||
name = "fmod-${version}";
|
name = "fmod-${version}";
|
||||||
version = "4.24.16";
|
version = "4.44.64";
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
|
url = "https://zdoom.org/files/fmod/fmodapi44464linux.tar.gz";
|
||||||
|
sha256 = "047hk92xapwwqj281f4zwl0ih821rrliya70gfj82sdfjh9lz8i1";
|
||||||
|
};
|
||||||
|
|
||||||
dontStrip = true;
|
dontStrip = true;
|
||||||
dontPatchELF = true;
|
dontPatchELF = true;
|
||||||
dontBuild = true;
|
dontBuild = true;
|
||||||
|
|
||||||
makeFlags = [ "DESTLIBDIR=$(out)/lib" "DESTHDRDIR=$(out)/include" ];
|
installPhase = ''
|
||||||
|
install -Dm755 api/lib/libfmodex${bits}-${version}.so $out/lib/libfmodex-${version}.so
|
||||||
preInstall = ''
|
ln -s libfmodex-${version}.so $out/lib/libfmodex.so
|
||||||
mkdir -p $out/lib
|
patchelf --set-rpath ${libPath} $out/lib/libfmodex.so
|
||||||
'';
|
cp -r api/inc $out/include
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
mv $out/lib/libfmodex${bits}-${version}.so $out/lib/libfmodex.so
|
|
||||||
mv $out/lib/libfmodexp${bits}-${version}.so $out/lib/libfmodexp.so
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Programming library and toolkit for the creation and playback of interactive audio";
|
description = "Programming library and toolkit for the creation and playback of interactive audio";
|
||||||
homepage = "http://www.fmod.org/";
|
homepage = http://www.fmod.org/;
|
||||||
license = licenses.unfreeRedistributable;
|
license = licenses.unfreeRedistributable;
|
||||||
platforms = platforms.linux;
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
||||||
maintainers = [ stdenv.lib.maintainers.lassulus ];
|
maintainers = [ maintainers.lassulus ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user