2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, makeDesktopItem, makeWrapper, cmake, libjpeg, zlib, libpng, libGL, SDL2 }:
|
2017-08-24 06:33:28 +00:00
|
|
|
|
2017-09-03 13:18:18 +00: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 13:18:18 +00: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 13:18:18 +00:00
|
|
|
};
|
2019-08-13 21:52:01 +00:00
|
|
|
in stdenv.mkDerivation {
|
2019-06-29 16:25:35 +00:00
|
|
|
pname = "OpenJK";
|
2020-08-06 06:46:00 +00:00
|
|
|
version = "2020-07-03";
|
2017-08-24 06:33:28 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "JACoders";
|
|
|
|
repo = "OpenJK";
|
2020-08-06 06:46:00 +00:00
|
|
|
rev = "0a336ce4dffe6505e3f754b59732402a1db95752";
|
|
|
|
sha256 = "1xagbz42hi3ivs208mnay2dbgh90pmwwbar2p1yfhj3zl3cghcs8";
|
2017-08-24 06:33:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dontAddPrefix = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper cmake ];
|
2018-02-24 12:06:44 +00:00
|
|
|
buildInputs = [ libjpeg zlib libpng libGL SDL2 ];
|
2017-08-24 06:33:28 +00:00
|
|
|
|
2017-08-24 16:41:27 +00:00
|
|
|
# move from $out/JediAcademy to $out/opt/JediAcademy
|
2017-08-24 06:33:28 +00:00
|
|
|
preConfigure = ''
|
|
|
|
cmakeFlagsArray=("-DCMAKE_INSTALL_PREFIX=$out/opt")
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2017-09-03 13:18:18 +00:00
|
|
|
mkdir -p $out/bin $out/share/applications $out/share/icons/hicolor/128x128/apps
|
2017-08-24 06:33:28 +00:00
|
|
|
prefix=$out/opt/JediAcademy
|
2017-09-03 13:18:18 +00:00
|
|
|
|
2017-08-24 06:33:28 +00: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 13:18:18 +00: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 06:33:28 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-08-24 06:33:28 +00:00
|
|
|
description = "An open-source engine for Star Wars Jedi Academy game";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/JACoders/OpenJK";
|
2017-08-24 06:33:28 +00:00
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
2021-04-29 05:21:13 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2017-08-24 06:33:28 +00:00
|
|
|
};
|
|
|
|
}
|