blob: 7dd6d03d53fb4f679772ab02388f5c94ef4752cb (
plain) (
blame)
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
|
{ stdenv, fetchHumbleBundle, unzip, pkgsi686Linux }:
stdenv.mkDerivation rec {
name = "spaz-${version}";
version = "09182012";
src = fetchHumbleBundle {
name = "spaz-linux-humblebundle-${version}-bin";
md5 = "9b2f28009949f2dff9f3a737e46fabfd";
};
buildInputs = [ pkgsi686Linux.makeWrapper ];
unpackCmd = ''
${unzip}/bin/unzip -qq "$src" 'data/*' || true
'';
dontStrip = true;
buildPhase = let
libs = pkgsi686Linux.lib.makeLibraryPath [
pkgsi686Linux.stdenv.cc.cc pkgsi686Linux.SDL
];
in ''
patchelf --set-interpreter "${pkgsi686Linux.glibc}"/lib/ld-linux.so.* \
--set-rpath "${libs}" SPAZ
'';
installPhase = let
libs = pkgsi686Linux.lib.makeLibraryPath [
pkgsi686Linux.libGL pkgsi686Linux.openal pkgsi686Linux.alsaPlugins
];
in ''
install -vD SPAZ "$out/libexec/spaz/spaz"
cp -rt "$out/libexec/spaz" audio.so common game mods
makeWrapper "$out/libexec/spaz/spaz" "$out/bin/spaz" \
--set LD_LIBRARY_PATH "${libs}"
'';
}
|