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 {
|
|
|
|
x86_64-linux = "sha256-3SFCQ+hyQPtAEx1jSbe/Qtq4dYkfVvU/Kmekzv53o3U=";
|
|
|
|
aarch64-linux = "sha256-AZ1NXzSRyT77W+EjLIb7eWxf7Ztu6XuKjSImRg1lNcw=";
|
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
|
|
|
|