mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-21 16:11:22 +00:00
Merge pull request #232728 from rhendric/rhendric/maptool
maptool: init at 1.13.0
This commit is contained in:
119
pkgs/games/maptool/default.nix
Normal file
119
pkgs/games/maptool/default.nix
Normal file
@@ -0,0 +1,119 @@
|
||||
{ lib
|
||||
, copyDesktopItems
|
||||
, fetchurl
|
||||
, ffmpeg
|
||||
, gitUpdater
|
||||
, jre
|
||||
, libarchive
|
||||
, makeDesktopItem
|
||||
, openjfx
|
||||
, stdenvNoCC
|
||||
, wrapGAppsHook
|
||||
}:
|
||||
let
|
||||
pname = "maptool";
|
||||
version = "1.13.0";
|
||||
repoBase = "https://github.com/RPTools/${pname}";
|
||||
src = fetchurl {
|
||||
url = "${repoBase}/releases/download/${version}/MapTool-${version}.jar";
|
||||
hash = "sha256-0jiUYdr2KwMNc8VBgJsEsf4dkrzYfMGwv+jT1RLhUAg=";
|
||||
};
|
||||
|
||||
icon = fetchurl {
|
||||
url = "https://raw.githubusercontent.com/RPTools/${pname}/${version}/package/linux/MapTool.png";
|
||||
hash = "sha256-xkVYjMprTanHu8r4b9PHORI8E1aJp+9KDSP5mqCE8ew=";
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Virtual Tabletop for playing roleplaying games with remote players or face to face";
|
||||
homepage = "https://www.rptools.net/toolbox/maptool/";
|
||||
sourceProvenance = with sourceTypes; [
|
||||
binaryBytecode
|
||||
binaryNativeCode
|
||||
];
|
||||
license = licenses.agpl3;
|
||||
maintainers = with maintainers; [ rhendric ];
|
||||
};
|
||||
|
||||
javafxModules = [ "base" "controls" "media" "swing" "web" "fxml" "graphics" ];
|
||||
|
||||
classpath =
|
||||
lib.concatMap (mod: [
|
||||
"${openjfx}/modules_src/javafx.${mod}/module-info.java"
|
||||
"${openjfx}/modules/javafx.${mod}"
|
||||
"${openjfx}/modules_libs/javafx.${mod}"
|
||||
]) javafxModules ++
|
||||
[ src ];
|
||||
|
||||
jvmArgs = [
|
||||
"-cp" (lib.concatStringsSep ":" classpath)
|
||||
"-Xss8M"
|
||||
"-Dsun.java2d.d3d=false"
|
||||
"-Dfile.encoding=UTF-8"
|
||||
"-Dpolyglot.engine.WarnInterpreterOnly=false"
|
||||
"-XX:+ShowCodeDetailsInExceptionMessages"
|
||||
"--add-opens=java.desktop/java.awt=ALL-UNNAMED"
|
||||
"--add-opens=java.desktop/java.awt.geom=ALL-UNNAMED"
|
||||
"--add-opens=java.desktop/sun.awt.geom=ALL-UNNAMED"
|
||||
"--add-opens=java.base/java.util=ALL-UNNAMED"
|
||||
"--add-opens=javafx.web/javafx.scene.web=ALL-UNNAMED"
|
||||
"--add-opens=javafx.web/com.sun.webkit=ALL-UNNAMED"
|
||||
"--add-opens=javafx.web/com.sun.webkit.dom=ALL-UNNAMED"
|
||||
"--add-opens=java.desktop/javax.swing=ALL-UNNAMED"
|
||||
"--add-opens=java.desktop/sun.awt.shell=ALL-UNNAMED"
|
||||
"--add-opens=java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED"
|
||||
|
||||
# disable telemetry (the empty DSN disables the Sentry library, setting the
|
||||
# environment to Development disables some logic inside MapTool)
|
||||
"-Dsentry.dsn"
|
||||
"-Dsentry.environment=Development"
|
||||
];
|
||||
|
||||
binName = pname;
|
||||
rdnsName = "net.rptools.maptool";
|
||||
in
|
||||
stdenvNoCC.mkDerivation {
|
||||
inherit pname version src meta;
|
||||
|
||||
dontUnpack = true;
|
||||
dontBuild = true;
|
||||
dontWrapGApps = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
copyDesktopItems
|
||||
libarchive
|
||||
wrapGAppsHook
|
||||
];
|
||||
|
||||
desktopItems = [
|
||||
(makeDesktopItem {
|
||||
name = rdnsName;
|
||||
desktopName = "MapTool";
|
||||
icon = rdnsName;
|
||||
exec = binName;
|
||||
comment = meta.description;
|
||||
categories = [ "Game" ];
|
||||
})
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/bin
|
||||
makeWrapper ${jre}/bin/java $out/bin/${binName} \
|
||||
"''${gappsWrapperArgs[@]}" \
|
||||
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ ffmpeg ]} \
|
||||
--add-flags '${lib.concatStringsSep " " jvmArgs} net.rptools.maptool.client.LaunchInstructions'
|
||||
|
||||
dest=$out/share/icons/hicolor/256x256/apps
|
||||
mkdir -p "$dest"
|
||||
ln -s ${icon} "$dest/${rdnsName}.png"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru.updateScript = gitUpdater {
|
||||
url = "${repoBase}.git";
|
||||
ignoredVersions = "-";
|
||||
};
|
||||
}
|
||||
@@ -36776,6 +36776,14 @@ with pkgs;
|
||||
gtk = gtk2;
|
||||
};
|
||||
|
||||
maptool = callPackage ../games/maptool {
|
||||
# MapTool is fussy about which JRE it uses; OpenJDK will leave it hanging
|
||||
# at launch in a class initialization deadlock. MapTool ships Temurin with
|
||||
# their pre-built releases so we might as well use it too.
|
||||
jre = temurin-bin-17;
|
||||
openjfx = openjfx17;
|
||||
};
|
||||
|
||||
mari0 = callPackage ../games/mari0 { };
|
||||
|
||||
manaplus = callPackage ../games/manaplus { stdenv = gcc11Stdenv; };
|
||||
|
||||
Reference in New Issue
Block a user