forked from mirrors/nixpkgs
quake3: refactor wrapper, fix pak collisions
This commit is contained in:
parent
f42e0dc9fd
commit
e80b22369d
|
@ -1,18 +0,0 @@
|
|||
source $stdenv/setup
|
||||
|
||||
mkdir -p $out/baseq3
|
||||
for i in $paks; do
|
||||
if test -d "$i/baseq3"; then
|
||||
ln -s "$i/baseq3"/* $out/baseq3/
|
||||
fi
|
||||
done
|
||||
|
||||
# We add Mesa to the end of $LD_LIBRARY_PATH to provide fallback
|
||||
# software rendering. GCC is needed so that libgcc_s.so can be found
|
||||
# when Mesa is used.
|
||||
makeWrapper $game/ioquake3.* $out/bin/quake3 \
|
||||
--suffix-each LD_LIBRARY_PATH ':' "$mesa/lib $gcc/lib" \
|
||||
--add-flags "+set fs_basepath $out +set r_allowSoftwareGL 1"
|
||||
|
||||
makeWrapper $game/ioq3ded.* $out/bin/quake3-server \
|
||||
--add-flags "+set fs_basepath $out"
|
|
@ -1,21 +1,32 @@
|
|||
{ stdenv, fetchurl, mesa, ioquake3, makeWrapper }:
|
||||
{ stdenv, buildEnv, lib, fetchurl, mesa_noglu, ioquake3, makeWrapper }:
|
||||
|
||||
{ paks, name ? (stdenv.lib.head paks).name, description ? "" }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "${name}-${ioquake3.name}";
|
||||
let
|
||||
libPath = lib.makeLibraryPath [ mesa_noglu stdenv.cc.cc ];
|
||||
env = buildEnv {
|
||||
name = "quake3-env";
|
||||
paths = [ ioquake3 ] ++ paks;
|
||||
};
|
||||
|
||||
builder = ./builder.sh;
|
||||
in stdenv.mkDerivation {
|
||||
name = "${name}-${ioquake3.name}";
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
inherit paks mesa;
|
||||
buildCommand = ''
|
||||
mkdir -p $out/bin
|
||||
|
||||
game = ioquake3;
|
||||
# We add Mesa to the end of $LD_LIBRARY_PATH to provide fallback
|
||||
# software rendering. GCC is needed so that libgcc_s.so can be found
|
||||
# when Mesa is used.
|
||||
makeWrapper ${env}/ioquake3.* $out/bin/quake3 \
|
||||
--suffix-each LD_LIBRARY_PATH ':' "${libPath}" \
|
||||
--add-flags "+set fs_basepath ${env} +set r_allowSoftwareGL 1"
|
||||
|
||||
gcc = stdenv.cc.cc;
|
||||
|
||||
preferLocalBuild = true;
|
||||
makeWrapper ${env}/ioq3ded.* $out/bin/quake3-server \
|
||||
--add-flags "+set fs_basepath ${env}"
|
||||
'';
|
||||
|
||||
meta = {
|
||||
inherit description;
|
||||
|
|
Loading…
Reference in a new issue