2018-07-21 02:44:44 +02:00
|
|
|
{ stdenv, buildEnv, lib, libGL, ioquake3, makeWrapper }:
|
2016-01-04 13:36:49 +01:00
|
|
|
|
2021-01-15 05:31:39 +01:00
|
|
|
{ paks, name ? (lib.head paks).name, description ? "" }:
|
2006-01-28 00:51:36 +01:00
|
|
|
|
2016-09-24 11:49:34 +02:00
|
|
|
let
|
2018-02-24 13:06:44 +01:00
|
|
|
libPath = lib.makeLibraryPath [ libGL stdenv.cc.cc ];
|
2016-09-24 11:49:34 +02:00
|
|
|
env = buildEnv {
|
|
|
|
name = "quake3-env";
|
|
|
|
paths = [ ioquake3 ] ++ paks;
|
|
|
|
};
|
2016-01-04 13:36:49 +01:00
|
|
|
|
2016-09-24 11:49:34 +02:00
|
|
|
in stdenv.mkDerivation {
|
|
|
|
name = "${name}-${ioquake3.name}";
|
2008-06-14 22:55:48 +02:00
|
|
|
|
2016-01-04 13:36:49 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
2016-09-24 11:49:34 +02:00
|
|
|
buildCommand = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
|
|
|
|
# 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"
|
2006-10-11 18:45:55 +02:00
|
|
|
|
2016-09-24 11:49:34 +02:00
|
|
|
makeWrapper ${env}/ioq3ded.* $out/bin/quake3-server \
|
|
|
|
--add-flags "+set fs_basepath ${env}"
|
|
|
|
'';
|
2016-01-04 13:36:49 +01:00
|
|
|
|
2006-10-11 18:45:55 +02:00
|
|
|
meta = {
|
|
|
|
inherit description;
|
|
|
|
};
|
2006-01-28 00:51:36 +01:00
|
|
|
}
|