2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, copyDesktopItems
|
|
|
|
, fetchurl
|
|
|
|
, ffmpeg
|
|
|
|
, gitUpdater
|
|
|
|
, jre
|
|
|
|
, libarchive
|
|
|
|
, makeDesktopItem
|
|
|
|
, openjfx
|
|
|
|
, stdenvNoCC
|
|
|
|
, wrapGAppsHook
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
pname = "maptool";
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "1.14.3";
|
2024-01-02 11:29:13 +00:00
|
|
|
repoBase = "https://github.com/RPTools/maptool";
|
2023-07-15 17:15:38 +00:00
|
|
|
src = fetchurl {
|
2024-01-02 11:29:13 +00:00
|
|
|
url = "${repoBase}/releases/download/${version}/maptool-${version}-x86_64.pkg.tar.zst";
|
2024-01-25 14:12:00 +00:00
|
|
|
hash = "sha256-KjP6zugQw9r1hvdxqOgTrt4hYMYg+lgjkgkj3tfb38s=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Virtual Tabletop for playing roleplaying games with remote players or face to face";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "maptool";
|
2023-07-15 17:15:38 +00:00
|
|
|
homepage = "https://www.rptools.net/toolbox/maptool/";
|
|
|
|
sourceProvenance = with sourceTypes; [
|
|
|
|
binaryBytecode
|
|
|
|
binaryNativeCode
|
|
|
|
];
|
2024-04-21 15:54:59 +00:00
|
|
|
license = licenses.agpl3Plus;
|
2023-07-15 17:15:38 +00:00
|
|
|
maintainers = with maintainers; [ rhendric ];
|
2024-01-02 11:29:13 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
javafxModules = [ "base" "controls" "media" "swing" "web" "fxml" "graphics" ];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
appClasspath = "share/${pname}";
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
classpath =
|
|
|
|
lib.concatMap (mod: [
|
|
|
|
"${openjfx}/modules_src/javafx.${mod}/module-info.java"
|
|
|
|
"${openjfx}/modules/javafx.${mod}"
|
|
|
|
"${openjfx}/modules_libs/javafx.${mod}"
|
|
|
|
]) javafxModules ++
|
2024-01-02 11:29:13 +00:00
|
|
|
[ "$out/${appClasspath}/*" ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
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;
|
2024-01-02 11:29:13 +00:00
|
|
|
dontConfigure = true;
|
2023-07-15 17:15:38 +00:00
|
|
|
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
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
dest=$out/${appClasspath}
|
|
|
|
install -dm755 "$dest"
|
|
|
|
bsdtar -xf "$src" -C "$dest" --strip-components 4 opt/maptool/lib/app/{'*.jar',readme}
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
dest=$out/share/icons/hicolor/256x256/apps
|
2024-01-02 11:29:13 +00:00
|
|
|
install -dm755 "$dest"
|
|
|
|
bsdtar -xOf "$src" opt/maptool/lib/MapTool.png > "$dest"/${rdnsName}.png
|
|
|
|
|
|
|
|
dest=$out/bin
|
|
|
|
install -dm755 "$dest"
|
|
|
|
makeWrapper ${jre}/bin/java "$dest"/${binName} \
|
|
|
|
"''${gappsWrapperArgs[@]}" \
|
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ ffmpeg ]} \
|
|
|
|
--add-flags "${lib.concatStringsSep " " jvmArgs} net.rptools.maptool.client.LaunchInstructions"
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.updateScript = gitUpdater {
|
|
|
|
url = "${repoBase}.git";
|
|
|
|
ignoredVersions = "-";
|
|
|
|
};
|
|
|
|
}
|