Merge pull request #165037 from tgunnoe/openjk-updates

openjk: update and add Jedi Outcast output
This commit is contained in:
ajs124 2022-04-10 22:36:09 +01:00 committed by GitHub
commit 5949b253ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,15 +19,24 @@ let
genericName = "Jedi Academy";
categories = [ "Game" ];
};
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" ];
};
in stdenv.mkDerivation {
pname = "OpenJK";
version = "2020-07-03";
version = "unstable-2022-01-30";
src = fetchFromGitHub {
owner = "JACoders";
repo = "OpenJK";
rev = "0a336ce4dffe6505e3f754b59732402a1db95752";
sha256 = "1xagbz42hi3ivs208mnay2dbgh90pmwwbar2p1yfhj3zl3cghcs8";
rev = "235fb9e1a9c4537a603b2e54e444327d20d198a3";
sha256 = "sha256-DqP6wnu5sE7lQJGEdsEPOc6FIaJjqxt5ANKZ5eiabC4=";
};
dontAddPrefix = true;
@ -35,22 +44,39 @@ in stdenv.mkDerivation {
nativeBuildInputs = [ makeWrapper cmake ];
buildInputs = [ libjpeg zlib libpng libGL SDL2 ];
outputs = [ "out" "openjo" "openja" ];
# move from $out/JediAcademy to $out/opt/JediAcademy
preConfigure = ''
cmakeFlagsArray=("-DCMAKE_INSTALL_PREFIX=$out/opt")
'';
cmakeFlags = ["-DBuildJK2SPEngine:BOOL=ON"
"-DBuildJK2SPGame:BOOL=ON"
"-DBuildJK2SPRdVanilla:BOOL=ON"];
postInstall = ''
mkdir -p $out/bin $out/share/applications $out/share/icons/hicolor/128x128/apps
prefix=$out/opt/JediAcademy
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
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"
makeWrapper $jaPrefix/openjk.* $openja/bin/jamp --run "cd $jaPrefix"
makeWrapper $jaPrefix/openjk_sp.* $openja/bin/jasp --run "cd $jaPrefix"
makeWrapper $jaPrefix/openjkded.* $openja/bin/openjkded --run "cd $jaPrefix"
makeWrapper $joPrefix/openjo_sp.* $openjo/bin/josp --run "cd $joPrefix"
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
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
'';
meta = with lib; {
@ -58,6 +84,6 @@ in stdenv.mkDerivation {
homepage = "https://github.com/JACoders/OpenJK";
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = with maintainers; [ ];
maintainers = with maintainers; [ tgunnoe ];
};
}