2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, makeDesktopItem, makeWrapper, cmake, libjpeg, zlib, libpng, libGL, SDL2 }:
|
2017-08-24 07:33:28 +01:00
|
|
|
|
2017-09-03 14:18:18 +01:00
|
|
|
let
|
|
|
|
jamp = makeDesktopItem rec {
|
|
|
|
name = "jamp";
|
|
|
|
exec = name;
|
|
|
|
icon = "OpenJK_Icon_128";
|
|
|
|
comment = "Open Source Jedi Academy game released by Raven Software";
|
|
|
|
desktopName = "Jedi Academy (Multi Player)";
|
|
|
|
genericName = "Jedi Academy";
|
2022-02-22 14:56:15 +00:00
|
|
|
categories = [ "Game" ];
|
2017-09-03 14:18:18 +01:00
|
|
|
};
|
|
|
|
jasp = makeDesktopItem rec {
|
|
|
|
name = "jasp";
|
|
|
|
exec = name;
|
|
|
|
icon = "OpenJK_Icon_128";
|
|
|
|
comment = "Open Source Jedi Academy game released by Raven Software";
|
|
|
|
desktopName = "Jedi Academy (Single Player)";
|
|
|
|
genericName = "Jedi Academy";
|
2022-02-22 14:56:15 +00:00
|
|
|
categories = [ "Game" ];
|
2017-09-03 14:18:18 +01:00
|
|
|
};
|
2022-03-21 00:04:44 +00:00
|
|
|
josp = makeDesktopItem rec {
|
|
|
|
name = "josp";
|
|
|
|
exec = name;
|
|
|
|
icon = "OpenJK_Icon_128";
|
|
|
|
comment = "Open Source Jedi Outcast game released by Raven Software";
|
|
|
|
desktopName = "Jedi Outcast (Single Player)";
|
|
|
|
genericName = "Jedi Outcast";
|
|
|
|
categories = [ "Game" ];
|
|
|
|
};
|
2019-08-13 22:52:01 +01:00
|
|
|
in stdenv.mkDerivation {
|
2019-06-29 17:25:35 +01:00
|
|
|
pname = "OpenJK";
|
2022-03-20 23:53:03 +00:00
|
|
|
version = "unstable-2022-01-30";
|
2017-08-24 07:33:28 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "JACoders";
|
|
|
|
repo = "OpenJK";
|
2022-03-20 23:53:03 +00:00
|
|
|
rev = "235fb9e1a9c4537a603b2e54e444327d20d198a3";
|
|
|
|
sha256 = "sha256-DqP6wnu5sE7lQJGEdsEPOc6FIaJjqxt5ANKZ5eiabC4=";
|
2017-08-24 07:33:28 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
dontAddPrefix = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper cmake ];
|
2018-02-24 12:06:44 +00:00
|
|
|
buildInputs = [ libjpeg zlib libpng libGL SDL2 ];
|
2017-08-24 07:33:28 +01:00
|
|
|
|
2022-03-21 00:04:44 +00:00
|
|
|
outputs = [ "out" "openjo" "openja" ];
|
|
|
|
|
2017-08-24 17:41:27 +01:00
|
|
|
# move from $out/JediAcademy to $out/opt/JediAcademy
|
2017-08-24 07:33:28 +01:00
|
|
|
preConfigure = ''
|
|
|
|
cmakeFlagsArray=("-DCMAKE_INSTALL_PREFIX=$out/opt")
|
|
|
|
'';
|
2022-03-21 00:04:44 +00:00
|
|
|
cmakeFlags = ["-DBuildJK2SPEngine:BOOL=ON"
|
|
|
|
"-DBuildJK2SPGame:BOOL=ON"
|
|
|
|
"-DBuildJK2SPRdVanilla:BOOL=ON"];
|
2017-08-24 07:33:28 +01:00
|
|
|
|
|
|
|
postInstall = ''
|
2022-03-21 00:04:44 +00:00
|
|
|
mkdir -p $out/bin $openja/bin $openjo/bin
|
|
|
|
mkdir -p $openja/share/applications $openjo/share/applications
|
|
|
|
mkdir -p $openja/share/icons/hicolor/128x128/apps $openjo/share/icons/hicolor/128x128/apps
|
|
|
|
mkdir -p $openja/opt $openjo/opt
|
|
|
|
mv $out/opt/JediAcademy $openja/opt/
|
|
|
|
mv $out/opt/JediOutcast $openjo/opt/
|
|
|
|
jaPrefix=$openja/opt/JediAcademy
|
|
|
|
joPrefix=$openjo/opt/JediOutcast
|
2017-09-03 14:18:18 +01:00
|
|
|
|
2022-04-14 08:50:48 +01:00
|
|
|
makeWrapper $jaPrefix/openjk.* $openja/bin/jamp --chdir "$jaPrefix"
|
|
|
|
makeWrapper $jaPrefix/openjk_sp.* $openja/bin/jasp --chdir "$jaPrefix"
|
|
|
|
makeWrapper $jaPrefix/openjkded.* $openja/bin/openjkded --chdir "$jaPrefix"
|
|
|
|
makeWrapper $joPrefix/openjo_sp.* $openjo/bin/josp --chdir "$joPrefix"
|
2017-09-03 14:18:18 +01:00
|
|
|
|
2022-03-21 00:04:44 +00:00
|
|
|
cp $src/shared/icons/OpenJK_Icon_128.png $openjo/share/icons/hicolor/128x128/apps
|
|
|
|
cp $src/shared/icons/OpenJK_Icon_128.png $openja/share/icons/hicolor/128x128/apps
|
|
|
|
ln -s ${jamp}/share/applications/* $openja/share/applications
|
|
|
|
ln -s ${jasp}/share/applications/* $openja/share/applications
|
|
|
|
ln -s ${josp}/share/applications/* $openjo/share/applications
|
|
|
|
ln -s $openja/bin/* $out/bin
|
|
|
|
ln -s $openjo/bin/* $out/bin
|
|
|
|
rm -rf $out/opt
|
2017-08-24 07:33:28 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-08-24 07:33:28 +01:00
|
|
|
description = "An open-source engine for Star Wars Jedi Academy game";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/JACoders/OpenJK";
|
2017-08-24 07:33:28 +01:00
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
2022-03-21 00:04:44 +00:00
|
|
|
maintainers = with maintainers; [ tgunnoe ];
|
2017-08-24 07:33:28 +01:00
|
|
|
};
|
|
|
|
}
|