1 { lib, stdenv, fetchFromGitHub, makeDesktopItem, makeWrapper, cmake, libjpeg, zlib, libpng, libGL, SDL2 }:
4 jamp = makeDesktopItem rec {
7 icon = "OpenJK_Icon_128";
8 comment = "Open Source Jedi Academy game released by Raven Software";
9 desktopName = "Jedi Academy (Multi Player)";
10 genericName = "Jedi Academy";
11 categories = [ "Game" ];
13 jasp = makeDesktopItem rec {
16 icon = "OpenJK_Icon_128";
17 comment = "Open Source Jedi Academy game released by Raven Software";
18 desktopName = "Jedi Academy (Single Player)";
19 genericName = "Jedi Academy";
20 categories = [ "Game" ];
22 josp = makeDesktopItem rec {
25 icon = "OpenJK_Icon_128";
26 comment = "Open Source Jedi Outcast game released by Raven Software";
27 desktopName = "Jedi Outcast (Single Player)";
28 genericName = "Jedi Outcast";
29 categories = [ "Game" ];
31 in stdenv.mkDerivation {
33 version = "unstable-2022-01-30";
35 src = fetchFromGitHub {
38 rev = "235fb9e1a9c4537a603b2e54e444327d20d198a3";
39 sha256 = "sha256-DqP6wnu5sE7lQJGEdsEPOc6FIaJjqxt5ANKZ5eiabC4=";
44 nativeBuildInputs = [ makeWrapper cmake ];
45 buildInputs = [ libjpeg zlib libpng libGL SDL2 ];
47 outputs = [ "out" "openjo" "openja" ];
49 # move from $out/JediAcademy to $out/opt/JediAcademy
51 cmakeFlagsArray=("-DCMAKE_INSTALL_PREFIX=$out/opt")
53 cmakeFlags = ["-DBuildJK2SPEngine:BOOL=ON"
54 "-DBuildJK2SPGame:BOOL=ON"
55 "-DBuildJK2SPRdVanilla:BOOL=ON"];
58 mkdir -p $out/bin $openja/bin $openjo/bin
59 mkdir -p $openja/share/applications $openjo/share/applications
60 mkdir -p $openja/share/icons/hicolor/128x128/apps $openjo/share/icons/hicolor/128x128/apps
61 mkdir -p $openja/opt $openjo/opt
62 mv $out/opt/JediAcademy $openja/opt/
63 mv $out/opt/JediOutcast $openjo/opt/
64 jaPrefix=$openja/opt/JediAcademy
65 joPrefix=$openjo/opt/JediOutcast
67 makeWrapper $jaPrefix/openjk.* $openja/bin/jamp --chdir "$jaPrefix"
68 makeWrapper $jaPrefix/openjk_sp.* $openja/bin/jasp --chdir "$jaPrefix"
69 makeWrapper $jaPrefix/openjkded.* $openja/bin/openjkded --chdir "$jaPrefix"
70 makeWrapper $joPrefix/openjo_sp.* $openjo/bin/josp --chdir "$joPrefix"
72 cp $src/shared/icons/OpenJK_Icon_128.png $openjo/share/icons/hicolor/128x128/apps
73 cp $src/shared/icons/OpenJK_Icon_128.png $openja/share/icons/hicolor/128x128/apps
74 ln -s ${jamp}/share/applications/* $openja/share/applications
75 ln -s ${jasp}/share/applications/* $openja/share/applications
76 ln -s ${josp}/share/applications/* $openjo/share/applications
77 ln -s $openja/bin/* $out/bin
78 ln -s $openjo/bin/* $out/bin
83 description = "An open-source engine for Star Wars Jedi Academy game";
84 homepage = "https://github.com/JACoders/OpenJK";
85 license = licenses.gpl2;
86 platforms = platforms.linux;
87 maintainers = with maintainers; [ tgunnoe ];