14 src = fetchFromGitHub {
17 rev = "forge-${version}";
18 sha256 = "sha256-tNPG90mw8HZjp37YJ9JQlOBiVNPRo6xuNur651Adva8=";
21 # launch4j downloads and runs a native binary during the package phase.
22 patches = [ ./no-launch4j.patch ];
24 mavenRepository = stdenv.mkDerivation {
25 pname = "forge-mtg-maven-repository";
26 inherit version src patches;
28 nativeBuildInputs = [ maven ];
32 # Tests need a running Xorg.
33 mvn package -Dmaven.repo.local=$out -DskipTests
39 find $out -type f \( \
40 -name \*.lastUpdated \
41 -o -name resolver-status.properties \
42 -o -name _remote.repositories \) \
47 outputHashAlgo = "sha256";
48 outputHashMode = "recursive";
49 outputHash = "sha256-6FTbYXaF3rBIZov2WJxjG/ovmvimjXFPaFchAduVzI8=";
52 in stdenv.mkDerivation {
54 inherit version src patches;
56 nativeBuildInputs = [ maven makeWrapper ];
60 # Tests need a running Xorg.
61 mvn --offline -Dmaven.repo.local=${mavenRepository} -DskipTests package;
67 mkdir -p $out/bin $out/share/forge
69 forge-gui-desktop/target/forge.sh \
70 forge-gui-desktop/target/forge-gui-desktop-${version}-jar-with-dependencies.jar \
71 forge-adventure/target/forge-adventure.sh \
72 forge-adventure/target/forge-adventure-${version}-jar-with-dependencies.jar \
79 for commandToInstall in forge forge-adventure; do
80 chmod 555 $out/share/forge/$commandToInstall.sh
81 makeWrapper $out/share/forge/$commandToInstall.sh $out/bin/$commandToInstall \
82 --prefix PATH : ${lib.makeBinPath [ coreutils openjdk gnused ]} \
83 --set JAVA_HOME ${openjdk}/lib/openjdk \
89 description = "Magic: the Gathering card game with rules enforcement";
90 homepage = "https://www.slightlymagic.net/forum/viewforum.php?f=26";
91 platforms = openjdk.meta.platforms;
92 license = licenses.gpl3Plus;
93 maintainers = with maintainers; [ eigengrau ];