Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 SDL2,
7 libGLU,
8 libGL,
9 zlib,
10 libjpeg,
11 libogg,
12 libvorbis,
13 libX11,
14 openal,
15 curl,
16 copyDesktopItems,
17 makeDesktopItem,
18}:
19
20stdenv.mkDerivation rec {
21 pname = "dhewm3";
22 version = "1.5.4";
23
24 src = fetchFromGitHub {
25 owner = "dhewm";
26 repo = "dhewm3";
27 rev = version;
28 sha256 = "sha256-losqnxnjRPOczjrRPyyOxCeg9TNScXLcXADgo9Bxm5k=";
29 };
30
31 # Add libGLU libGL linking
32 patchPhase = ''
33 sed -i 's/\<idlib\()\?\)$/idlib GL\1/' neo/CMakeLists.txt
34 '';
35
36 preConfigure = ''
37 cd "$(ls -d dhewm3-*.src)"/neo
38 '';
39
40 nativeBuildInputs = [
41 cmake
42 copyDesktopItems
43 ];
44 buildInputs = [
45 SDL2
46 libGLU
47 libGL
48 libX11
49 zlib
50 libjpeg
51 libogg
52 libvorbis
53 openal
54 curl
55 ];
56
57 desktopItems = [
58 (makeDesktopItem {
59 name = "dhewm3";
60 exec = "dhewm3";
61 desktopName = "Doom 3";
62 categories = [ "Game" ];
63 })
64 ];
65
66 hardeningDisable = [ "format" ];
67
68 meta = with lib; {
69 homepage = "https://github.com/dhewm/dhewm3";
70 description = "Doom 3 port to SDL";
71 mainProgram = "dhewm3";
72 license = lib.licenses.gpl3;
73 maintainers = [ ];
74 platforms = with platforms; linux;
75 };
76}