mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-19 11:00:19 +03:00
scenebuilder: 15.0.1 -> 19.0.0
Bump scenebuilder to 19.0.0 as the latest release 20.0.0 depends on
jdk20, which is not packaged in nixpkgs yet.
Since version 15 the build system for scenebuilder was switched from
gradle to maven.
Additionally this commit switches to using a jre which bundles
openjfx. This used to be the default but was changed in ce6bc62
,
which prevented scenebuilder from starting.
This commit is contained in:
parent
aebee3ca2a
commit
f2bdee4337
@ -1,69 +1,46 @@
|
|||||||
{ lib, stdenv, fetchFromGitHub, jdk11, gradle_6, makeDesktopItem, copyDesktopItems, perl, writeText, runtimeShell, makeWrapper, glib, wrapGAppsHook }:
|
{ lib, stdenv, fetchFromGitHub, jre, maven, makeDesktopItem, copyDesktopItems, perl, writeText, runtimeShell, makeWrapper, glib, wrapGAppsHook }:
|
||||||
let
|
maven.buildMavenPackage rec {
|
||||||
gradle = gradle_6;
|
|
||||||
|
|
||||||
pname = "scenebuilder";
|
pname = "scenebuilder";
|
||||||
version = "15.0.1";
|
version = "19.0.0"; # 20.0.0 already available but needs java20 which is not available in nixpkgs yet
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "gluonhq";
|
owner = "gluonhq";
|
||||||
repo = pname;
|
repo = pname;
|
||||||
rev = version;
|
rev = version;
|
||||||
sha256 = "0dqlpfgr9qpmk62zsnhzw4q6n0swjqy00294q0kb4djp3jn47iz4";
|
hash = "sha256-No0yMAVmM5T++h74ZZIufaHmJBOzYhI0EtfOEGWGzis=";
|
||||||
};
|
};
|
||||||
|
|
||||||
deps = stdenv.mkDerivation {
|
inherit jre;
|
||||||
name = "${pname}-deps";
|
|
||||||
inherit src;
|
|
||||||
|
|
||||||
nativeBuildInputs = [ jdk11 perl gradle ];
|
buildDate = "2022-10-07T00:00:00+01:00"; # v20.0.0 release date
|
||||||
|
mvnParameters = "-Dmaven.test.skip -Dproject.build.outputTimestamp=${buildDate} -DbuildTimestamp=${buildDate}";
|
||||||
|
mvnHash = "sha256-G4WjQVRawNITSGh/e+fb6fVe80WSd0swT3uPIQOlif4=";
|
||||||
|
|
||||||
buildPhase = ''
|
nativeBuildInputs = [ copyDesktopItems maven makeWrapper glib wrapGAppsHook ];
|
||||||
export GRADLE_USER_HOME=$(mktemp -d);
|
|
||||||
gradle --no-daemon build -x test
|
|
||||||
'';
|
|
||||||
|
|
||||||
# Mavenize dependency paths
|
dontWrapGApps = true; # prevent double wrapping
|
||||||
# e.g. org.codehaus.groovy/groovy/2.4.0/{hash}/groovy-2.4.0.jar -> org/codehaus/groovy/groovy/2.4.0/groovy-2.4.0.jar
|
|
||||||
installPhase = ''
|
|
||||||
find $GRADLE_USER_HOME/caches/modules-2 -type f -regex '.*\.\(jar\|pom\)' \
|
|
||||||
| perl -pe 's#(.*/([^/]+)/([^/]+)/([^/]+)/[0-9a-f]{30,40}/([^/\s]+))$# ($x = $2) =~ tr|\.|/|; "install -Dm444 $1 \$out/$x/$3/$4/$5" #e' \
|
|
||||||
| sh
|
|
||||||
'';
|
|
||||||
|
|
||||||
outputHashAlgo = "sha256";
|
installPhase = ''
|
||||||
outputHashMode = "recursive";
|
runHook preInstall
|
||||||
outputHash = "01dkayad68g3zpzdnjwrc0h6s7s6n619y5b576snc35l8g2r5sgd";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Point to our local deps repo
|
mkdir -p $out/bin $out/share/java $out/share/{${pname},icons/hicolor/128x128/apps}
|
||||||
gradleInit = writeText "init.gradle" ''
|
cp app/target/lib/scenebuilder-${version}-SNAPSHOT-all.jar $out/share/java/${pname}.jar
|
||||||
settingsEvaluated { settings ->
|
|
||||||
settings.pluginManagement {
|
cp app/src/main/resources/com/oracle/javafx/scenebuilder/app/SB_Logo.png $out/share/icons/hicolor/128x128/apps/scenebuilder.png
|
||||||
repositories {
|
|
||||||
clear()
|
runHook postInstall
|
||||||
maven { url '${deps}' }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
logger.lifecycle 'Replacing Maven repositories with ${deps}...'
|
|
||||||
gradle.projectsLoaded {
|
|
||||||
rootProject.allprojects {
|
|
||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
clear()
|
|
||||||
maven { url '${deps}' }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
repositories {
|
|
||||||
clear()
|
|
||||||
maven { url '${deps}' }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
desktopItem = makeDesktopItem {
|
postFixup = ''
|
||||||
|
makeWrapper ${jre}/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[@]}"
|
||||||
|
'';
|
||||||
|
|
||||||
|
desktopItems = [ (makeDesktopItem {
|
||||||
name = "scenebuilder";
|
name = "scenebuilder";
|
||||||
exec = "scenebuilder";
|
exec = "scenebuilder";
|
||||||
icon = "scenebuilder";
|
icon = "scenebuilder";
|
||||||
@ -71,39 +48,7 @@ let
|
|||||||
desktopName = "Scene Builder";
|
desktopName = "Scene Builder";
|
||||||
mimeTypes = [ "application/java" "application/java-vm" "application/java-archive" ];
|
mimeTypes = [ "application/java" "application/java-vm" "application/java-archive" ];
|
||||||
categories = [ "Development" ];
|
categories = [ "Development" ];
|
||||||
};
|
}) ];
|
||||||
|
|
||||||
in stdenv.mkDerivation rec {
|
|
||||||
inherit pname src version;
|
|
||||||
|
|
||||||
nativeBuildInputs = [ jdk11 gradle makeWrapper glib wrapGAppsHook ];
|
|
||||||
|
|
||||||
dontWrapGApps = true; # prevent double wrapping
|
|
||||||
|
|
||||||
buildPhase = ''
|
|
||||||
runHook preBuild
|
|
||||||
|
|
||||||
export GRADLE_USER_HOME=$(mktemp -d)
|
|
||||||
gradle -PVERSION=${version} --offline --no-daemon --info --init-script ${gradleInit} build -x test
|
|
||||||
|
|
||||||
runHook postBuild
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
|
|
||||||
mkdir -p $out/bin $out/share/{${pname},icons/hicolor/128x128/apps}
|
|
||||||
cp app/build/libs/SceneBuilder-${version}-all.jar $out/share/${pname}/${pname}.jar
|
|
||||||
cp app/build/resources/main/com/oracle/javafx/scenebuilder/app/SB_Logo.png $out/share/icons/hicolor/128x128/apps/scenebuilder.png
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
|
|
||||||
postFixup = ''
|
|
||||||
makeWrapper ${jdk11}/bin/java $out/bin/${pname} --add-flags "-jar $out/share/${pname}/${pname}.jar" "''${gappsWrapperArgs[@]}"
|
|
||||||
'';
|
|
||||||
|
|
||||||
desktopItems = [ desktopItem ];
|
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
broken = stdenv.isDarwin;
|
broken = stdenv.isDarwin;
|
||||||
@ -118,3 +63,4 @@ in stdenv.mkDerivation rec {
|
|||||||
platforms = platforms.all;
|
platforms = platforms.all;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19859,7 +19859,9 @@ with pkgs;
|
|||||||
|
|
||||||
schemaspy = callPackage ../development/tools/database/schemaspy { };
|
schemaspy = callPackage ../development/tools/database/schemaspy { };
|
||||||
|
|
||||||
scenebuilder = callPackage ../development/tools/scenebuilder { };
|
scenebuilder = callPackage ../development/tools/scenebuilder {
|
||||||
|
jre = jre.override { enableJavaFX = true; };
|
||||||
|
};
|
||||||
|
|
||||||
scenic-view = callPackage ../development/tools/scenic-view { jdk = jdk11; };
|
scenic-view = callPackage ../development/tools/scenic-view { jdk = jdk11; };
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user