nixpkgs/pkgs/games/forge-mtg/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

73 lines
1.9 KiB
Nix
Raw Normal View History

{
coreutils,
fetchFromGitHub,
gnused,
lib,
maven,
makeWrapper,
openjdk,
2022-08-28 18:39:53 +00:00
}:
let
version = "1.6.65";
2022-08-28 18:39:53 +00:00
src = fetchFromGitHub {
owner = "Card-Forge";
repo = "forge";
rev = "forge-${version}";
hash = "sha256-MCJl3nBHbX/O24bzD4aQ12eMWxYY2qJC5vomvtsIBek=";
2022-08-28 18:39:53 +00:00
};
# launch4j downloads and runs a native binary during the package phase.
patches = [ ./no-launch4j.patch ];
in
maven.buildMavenPackage {
2022-08-28 18:39:53 +00:00
pname = "forge-mtg";
inherit version src patches;
mvnHash = "sha256-ouF0Ja3oGrlUCcT0PzI5i9FQ+oLdEhE/LvhJ0QGErvI=";
2022-08-28 18:39:53 +00:00
2024-06-02 23:37:37 +00:00
doCheck = false; # Needs a running Xorg
2023-07-31 18:52:36 +00:00
nativeBuildInputs = [ makeWrapper ];
2022-08-28 18:39:53 +00:00
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share/forge
cp -a \
2022-08-28 18:39:53 +00:00
forge-gui-desktop/target/forge.sh \
forge-gui-desktop/target/forge-gui-desktop-${version}-jar-with-dependencies.jar \
2023-05-02 10:18:23 +00:00
forge-gui-mobile-dev/target/forge-adventure.sh \
forge-gui-mobile-dev/target/forge-gui-mobile-dev-${version}-jar-with-dependencies.jar \
forge-adventure/target/forge-adventure-editor.sh \
2022-08-28 18:39:53 +00:00
forge-adventure/target/forge-adventure-${version}-jar-with-dependencies.jar \
forge-gui/res \
$out/share/forge
runHook postInstall
'';
preFixup = ''
2023-05-02 10:18:23 +00:00
for commandToInstall in forge forge-adventure forge-adventure-editor; do
2022-08-28 18:39:53 +00:00
chmod 555 $out/share/forge/$commandToInstall.sh
makeWrapper $out/share/forge/$commandToInstall.sh $out/bin/$commandToInstall \
--prefix PATH : ${
lib.makeBinPath [
coreutils
openjdk
gnused
]
} \
2022-08-28 18:39:53 +00:00
--set JAVA_HOME ${openjdk}/lib/openjdk \
--set SENTRY_DSN ""
done
'';
meta = with lib; {
description = "Magic: the Gathering card game with rules enforcement";
homepage = "https://www.slightlymagic.net/forum/viewforum.php?f=26";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ eigengrau ];
};
}