2021-01-15 05:31:39 +01:00
|
|
|
{ lib, stdenv, fetchurl, SDL, SDL_mixer, SDL_net
|
2019-11-10 17:44:34 +01:00
|
|
|
, libGLU ? null
|
|
|
|
, libGL ? null
|
2018-07-23 23:27:03 +02:00
|
|
|
, useOpenGL ? stdenv.hostPlatform == stdenv.buildPlatform
|
|
|
|
}:
|
2010-08-11 22:14:25 +02:00
|
|
|
|
2019-11-10 17:44:34 +01:00
|
|
|
assert useOpenGL -> libGL != null && libGLU != null;
|
|
|
|
|
2018-07-23 23:27:03 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2010-08-11 22:14:25 +02:00
|
|
|
name = "prboom-2.5.0";
|
|
|
|
src = fetchurl {
|
2020-04-01 03:11:51 +02:00
|
|
|
url = "mirror://sourceforge/prboom/prboom-2.5.0.tar.gz";
|
2010-08-11 22:14:25 +02:00
|
|
|
sha256 = "1bjb04q8dk232956k30qlpq6q0hxb904yh1nflr87jcc1x3iqv12";
|
|
|
|
};
|
|
|
|
|
2018-07-23 23:27:03 +02:00
|
|
|
buildInputs = [ SDL SDL_mixer SDL_net ]
|
2021-01-15 05:31:39 +01:00
|
|
|
++ lib.optionals useOpenGL [ libGL libGLU ];
|
2010-08-11 22:14:25 +02:00
|
|
|
|
2018-07-23 23:27:03 +02:00
|
|
|
doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
|
|
|
|
|
|
|
|
configureFlags = [
|
2021-01-15 05:31:39 +01:00
|
|
|
(lib.enableFeature useOpenGL "gl")
|
|
|
|
(lib.enableFeature doCheck "sdltest")
|
|
|
|
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
2018-07-23 23:27:03 +02:00
|
|
|
"--disable-cpu-opt"
|
|
|
|
"--without-x"
|
|
|
|
"ac_cv_type_uid_t=yes"
|
|
|
|
"ac_cv_type_gid_t=yes"
|
|
|
|
];
|
|
|
|
|
2021-01-15 05:31:39 +01:00
|
|
|
postInstall = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
|
2018-07-23 23:27:03 +02:00
|
|
|
mv $out/games/ $out/bin
|
|
|
|
'';
|
2010-08-11 22:14:25 +02:00
|
|
|
}
|