2018-02-24 13:06:44 +01:00
|
|
|
{ stdenv, fetchFromGitHub, makeDesktopItem, makeWrapper, cmake, libjpeg, zlib, libpng, libGL, SDL2 }:
|
2017-08-24 08:33:28 +02:00
|
|
|
|
2017-09-03 15:18:18 +02: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";
|
|
|
|
categories = "Game;";
|
|
|
|
};
|
|
|
|
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";
|
|
|
|
categories = "Game;";
|
|
|
|
};
|
2019-08-13 23:52:01 +02:00
|
|
|
in stdenv.mkDerivation {
|
2019-06-29 18:25:35 +02:00
|
|
|
pname = "OpenJK";
|
2019-10-26 14:20:36 +02:00
|
|
|
version = "2019-10-25";
|
2017-08-24 08:33:28 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "JACoders";
|
|
|
|
repo = "OpenJK";
|
2019-10-26 14:20:36 +02:00
|
|
|
rev = "e9116155052ef6a22135a1806a10e959aa9a1e00";
|
|
|
|
sha256 = "1f1bz1g2ksw4m3rnbh6fdsawcrpbfjdmq1gs2xj0q450yb840l3z";
|
2017-08-24 08:33:28 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
dontAddPrefix = true;
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper cmake ];
|
2018-02-24 13:06:44 +01:00
|
|
|
buildInputs = [ libjpeg zlib libpng libGL SDL2 ];
|
2017-08-24 08:33:28 +02:00
|
|
|
|
2017-08-24 18:41:27 +02:00
|
|
|
# move from $out/JediAcademy to $out/opt/JediAcademy
|
2017-08-24 08:33:28 +02:00
|
|
|
preConfigure = ''
|
|
|
|
cmakeFlagsArray=("-DCMAKE_INSTALL_PREFIX=$out/opt")
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2017-09-03 15:18:18 +02:00
|
|
|
mkdir -p $out/bin $out/share/applications $out/share/icons/hicolor/128x128/apps
|
2017-08-24 08:33:28 +02:00
|
|
|
prefix=$out/opt/JediAcademy
|
2017-09-03 15:18:18 +02:00
|
|
|
|
2017-08-24 08:33:28 +02:00
|
|
|
makeWrapper $prefix/openjk.* $out/bin/jamp --run "cd $prefix"
|
|
|
|
makeWrapper $prefix/openjk_sp.* $out/bin/jasp --run "cd $prefix"
|
|
|
|
makeWrapper $prefix/openjkded.* $out/bin/openjkded --run "cd $prefix"
|
2017-09-03 15:18:18 +02:00
|
|
|
|
|
|
|
cp $src/shared/icons/OpenJK_Icon_128.png $out/share/icons/hicolor/128x128/apps
|
|
|
|
ln -s ${jamp}/share/applications/* $out/share/applications
|
|
|
|
ln -s ${jasp}/share/applications/* $out/share/applications
|
2017-08-24 08:33:28 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "An open-source engine for Star Wars Jedi Academy game";
|
|
|
|
homepage = https://github.com/JACoders/OpenJK;
|
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ gnidorah ];
|
|
|
|
};
|
|
|
|
}
|