zandronum: bundle fmod, fix libraries
This commit is contained in:
parent
1cc9d9ef2c
commit
dca2e720bc
|
@ -1,9 +1,11 @@
|
||||||
{ stdenv, lib, fetchhg, cmake, pkgconfig, makeWrapper
|
{ stdenv, lib, fetchhg, cmake, pkgconfig, makeWrapper, callPackage
|
||||||
, SDL, mesa, bzip2, zlib, fmod, libjpeg, fluidsynth, openssl, sqlite-amalgamation
|
, soundfont-fluid, SDL, mesa, bzip2, zlib, libjpeg, fluidsynth, openssl, sqlite-amalgamation, gtk2
|
||||||
, serverOnly ? false
|
, serverOnly ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let suffix = lib.optionalString serverOnly "-server";
|
let
|
||||||
|
suffix = lib.optionalString serverOnly "-server";
|
||||||
|
fmod = callPackage ./fmod.nix { };
|
||||||
|
|
||||||
# FIXME: drop binary package when upstream fixes their protocol versioning
|
# FIXME: drop binary package when upstream fixes their protocol versioning
|
||||||
in stdenv.mkDerivation {
|
in stdenv.mkDerivation {
|
||||||
|
@ -18,7 +20,7 @@ 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 ]
|
buildInputs = [ openssl bzip2 zlib SDL libjpeg ]
|
||||||
++ lib.optionals (!serverOnly) [ mesa fmod fluidsynth ];
|
++ lib.optionals (!serverOnly) [ mesa fmod fluidsynth gtk2 ];
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake pkgconfig makeWrapper ];
|
nativeBuildInputs = [ cmake pkgconfig makeWrapper ];
|
||||||
|
|
||||||
|
@ -26,6 +28,11 @@ in stdenv.mkDerivation {
|
||||||
ln -s ${sqlite-amalgamation}/* sqlite/
|
ln -s ${sqlite-amalgamation}/* sqlite/
|
||||||
sed -ie 's| restrict| _restrict|g' dumb/include/dumb.h \
|
sed -ie 's| restrict| _restrict|g' dumb/include/dumb.h \
|
||||||
dumb/src/it/*.c
|
dumb/src/it/*.c
|
||||||
|
'' + lib.optionalString serverOnly ''
|
||||||
|
sed -i \
|
||||||
|
-e "s@/usr/share/sounds/sf2/@${soundfont-fluid}/share/soundfonts/@g" \
|
||||||
|
-e "s@FluidR3_GM.sf2@FluidR3_GM2-2.sf2@g" \
|
||||||
|
src/sound/music_fluidsynth_mididevice.cpp
|
||||||
'';
|
'';
|
||||||
|
|
||||||
cmakeFlags =
|
cmakeFlags =
|
||||||
|
@ -39,27 +46,26 @@ in stdenv.mkDerivation {
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
mkdir -p $out/share/zandronum
|
mkdir -p $out/lib/zandronum
|
||||||
cp zandronum${suffix} \
|
cp zandronum${suffix} \
|
||||||
zandronum.pk3 \
|
*.pk3 \
|
||||||
skulltag_actors.pk3 \
|
|
||||||
${lib.optionalString (!serverOnly) "liboutput_sdl.so"} \
|
${lib.optionalString (!serverOnly) "liboutput_sdl.so"} \
|
||||||
$out/share/zandronum
|
$out/lib/zandronum
|
||||||
|
|
||||||
# For some reason, while symlinks work for binary version, they don't for source one.
|
# For some reason, while symlinks work for binary version, they don't for source one.
|
||||||
makeWrapper $out/share/zandronum/zandronum${suffix} $out/bin/zandronum${suffix}
|
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/share/zandronum/zandronum):$out/share/zandronum \
|
patchelf --set-rpath $(patchelf --print-rpath $out/lib/zandronum/zandronum):$out/lib/zandronum \
|
||||||
$out/share/zandronum/zandronum
|
$out/lib/zandronum/zandronum
|
||||||
'';
|
'';
|
||||||
|
|
||||||
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";
|
||||||
maintainers = with maintainers; [ lassulus ];
|
maintainers = with maintainers; [ lassulus ];
|
||||||
license = stdenv.lib.licenses.unfree;
|
license = licenses.unfreeRedistributable;
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
{ stdenv, fetchurl }:
|
||||||
|
|
||||||
|
assert (stdenv.system == "x86_64-linux") || (stdenv.system == "i686-linux");
|
||||||
|
let
|
||||||
|
bits = stdenv.lib.optionalString (stdenv.system == "x86_64-linux") "64";
|
||||||
|
|
||||||
|
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
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
inherit src;
|
||||||
|
|
||||||
|
name = "fmod-${version}";
|
||||||
|
version = "4.24.16";
|
||||||
|
|
||||||
|
dontStrip = true;
|
||||||
|
dontPatchELF = true;
|
||||||
|
dontBuild = true;
|
||||||
|
|
||||||
|
makeFlags = [ "DESTLIBDIR=$(out)/lib" "DESTHDRDIR=$(out)/include" ];
|
||||||
|
|
||||||
|
preInstall = ''
|
||||||
|
mkdir -p $out/lib
|
||||||
|
'';
|
||||||
|
|
||||||
|
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; {
|
||||||
|
description = "Programming library and toolkit for the creation and playback of interactive audio";
|
||||||
|
homepage = "http://www.fmod.org/";
|
||||||
|
license = licenses.unfreeRedistributable;
|
||||||
|
platforms = platforms.linux;
|
||||||
|
maintainers = [ stdenv.lib.maintainers.lassulus ];
|
||||||
|
};
|
||||||
|
}
|
|
@ -16124,7 +16124,6 @@ in
|
||||||
xsokoban = callPackage ../games/xsokoban { };
|
xsokoban = callPackage ../games/xsokoban { };
|
||||||
|
|
||||||
zandronum = callPackage ../games/zandronum {
|
zandronum = callPackage ../games/zandronum {
|
||||||
fmod = fmod42416;
|
|
||||||
cmake = cmake_2_8;
|
cmake = cmake_2_8;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue