2023-08-10 07:59:29 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, openjdk20, maven, makeDesktopItem, copyDesktopItems, makeWrapper, glib, wrapGAppsHook }:
|
2021-04-12 18:23:04 +00:00
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
let
|
|
|
|
jdk = openjdk20.override (lib.optionalAttrs stdenv.isLinux {
|
|
|
|
enableJavaFX = true;
|
|
|
|
});
|
|
|
|
maven' = maven.override {
|
|
|
|
inherit jdk;
|
|
|
|
};
|
|
|
|
selectSystem = attrs:
|
|
|
|
attrs.${stdenv.hostPlatform.system}
|
|
|
|
or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
|
|
|
in
|
|
|
|
maven'.buildMavenPackage rec {
|
2021-04-12 18:23:04 +00:00
|
|
|
pname = "scenebuilder";
|
2023-08-10 07:59:29 +00:00
|
|
|
version = "20.0.0";
|
2021-04-12 18:23:04 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gluonhq";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-08-10 07:59:29 +00:00
|
|
|
hash = "sha256-Og+dzkJ6+YH0fD4HJw8gUKGgvQuNw17BxgzZMP/bEA0=";
|
2021-04-12 18:23:04 +00:00
|
|
|
};
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
buildDate = "2022-10-07T00:00:00+01:00"; # v20.0.0 release date
|
|
|
|
mvnParameters = "-Dmaven.test.skip -Dproject.build.outputTimestamp=${buildDate} -DbuildTimestamp=${buildDate}";
|
|
|
|
mvnHash = selectSystem {
|
2024-01-13 08:15:51 +00:00
|
|
|
x86_64-linux = "sha256-QwxA3lKVkRG5CV2GIwfVFPOj112pHr7bDlZJD6KwrHc=";
|
|
|
|
aarch64-linux = "sha256-cO5nHSvv2saBuAjq47A+GW9vFWEM+ysXyZgI0Oe/F70=";
|
2021-04-12 18:23:04 +00:00
|
|
|
};
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
nativeBuildInputs = [ copyDesktopItems makeWrapper glib wrapGAppsHook ];
|
2021-04-12 18:23:04 +00:00
|
|
|
|
|
|
|
dontWrapGApps = true; # prevent double wrapping
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
mkdir -p $out/bin $out/share/java $out/share/{${pname},icons/hicolor/128x128/apps}
|
|
|
|
cp app/target/lib/scenebuilder-${version}-SNAPSHOT-all.jar $out/share/java/${pname}.jar
|
|
|
|
|
|
|
|
cp app/src/main/resources/com/oracle/javafx/scenebuilder/app/SB_Logo.png $out/share/icons/hicolor/128x128/apps/scenebuilder.png
|
2021-04-12 18:23:04 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
2023-08-10 07:59:29 +00:00
|
|
|
makeWrapper ${jdk}/bin/java $out/bin/${pname} \
|
|
|
|
--add-flags "--add-modules javafx.web,javafx.fxml,javafx.swing,javafx.media" \
|
|
|
|
--add-flags "--add-opens=javafx.fxml/javafx.fxml=ALL-UNNAMED" \
|
|
|
|
--add-flags "-cp $out/share/java/${pname}.jar" \
|
|
|
|
--add-flags "com.oracle.javafx.scenebuilder.app.SceneBuilderApp" \
|
|
|
|
"''${gappsWrapperArgs[@]}"
|
2021-04-12 18:23:04 +00:00
|
|
|
'';
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
desktopItems = [ (makeDesktopItem {
|
|
|
|
name = "scenebuilder";
|
|
|
|
exec = "scenebuilder";
|
|
|
|
icon = "scenebuilder";
|
|
|
|
comment = "A visual, drag'n'drop, layout tool for designing JavaFX application user interfaces.";
|
|
|
|
desktopName = "Scene Builder";
|
|
|
|
mimeTypes = [ "application/java" "application/java-vm" "application/java-archive" ];
|
|
|
|
categories = [ "Development" ];
|
|
|
|
}) ];
|
2021-04-12 18:23:04 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2022-06-16 17:23:12 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2021-04-12 18:23:04 +00:00
|
|
|
description = "A visual, drag'n'drop, layout tool for designing JavaFX application user interfaces.";
|
|
|
|
homepage = "https://gluonhq.com/products/scene-builder/";
|
2022-06-16 17:23:12 +00:00
|
|
|
sourceProvenance = with sourceTypes; [
|
|
|
|
fromSource
|
|
|
|
binaryBytecode # deps
|
|
|
|
];
|
2021-04-12 18:23:04 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ wirew0rm ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|
2023-08-10 07:59:29 +00:00
|
|
|
|