1 { lib, stdenv, fetchFromGitHub, openjdk, openjfx, gradle_7, makeDesktopItem, perl, writeText, makeWrapper }:
3 jdk = openjdk.override (lib.optionalAttrs stdenv.isLinux {
5 openjfx = openjfx.override { withWebKit = true; };
11 src = fetchFromGitHub {
12 owner = "JonathanGiles";
15 sha256 = "1idfh9hxqs4fchr6gvhblhvjqk4mpl4rnpi84vn1l3yb700z7dwy";
20 deps = stdenv.mkDerivation {
21 name = "${pname}-deps";
24 nativeBuildInputs = [ jdk perl gradle ];
27 export GRADLE_USER_HOME=$(mktemp -d);
28 gradle --no-daemon build
31 # Mavenize dependency paths
32 # 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
34 find $GRADLE_USER_HOME/caches/modules-2 -type f -regex '.*\.\(jar\|pom\)' \
35 | perl -pe 's#(.*/([^/]+)/([^/]+)/([^/]+)/[0-9a-f]{30,40}/([^/\s]+))$# ($x = $2) =~ tr|\.|/|; "install -Dm444 $1 \$out/$x/$3/$4/$5" #e' \
39 outputHashAlgo = "sha256";
40 outputHashMode = "recursive";
41 outputHash = "0d6qs0wg2nfxyq85q46a8dcdqknz9pypb2qmvc8k2w8vcdac1y7n";
44 # Point to our local deps repo
45 gradleInit = writeText "init.gradle" ''
46 settingsEvaluated { settings ->
47 settings.pluginManagement {
50 maven { url '${deps}' }
54 logger.lifecycle 'Replacing Maven repositories with ${deps}...'
55 gradle.projectsLoaded {
56 rootProject.allprojects {
60 maven { url '${deps}' }
65 maven { url '${deps}' }
71 desktopItem = makeDesktopItem {
75 comment = "JavaFx application to visualize and modify the scenegraph of running JavaFx applications.";
76 mimeTypes = [ "application/java" "application/java-vm" "application/java-archive" ];
77 categories = [ "Development" ];
80 in stdenv.mkDerivation rec {
81 inherit pname version src;
82 nativeBuildInputs = [ jdk gradle makeWrapper ];
87 export GRADLE_USER_HOME=$(mktemp -d)
88 gradle --offline --no-daemon --info --init-script ${gradleInit} build
96 mkdir -p $out/bin $out/share/${pname}
97 cp build/libs/scenicview.jar $out/share/${pname}/${pname}.jar
98 makeWrapper ${jdk}/bin/java $out/bin/${pname} --add-flags "-jar $out/share/${pname}/${pname}.jar"
103 desktopItems = [ desktopItem ];
106 broken = stdenv.isDarwin;
107 description = "JavaFx application to visualize and modify the scenegraph of running JavaFx applications.";
108 mainProgram = "scenic-view";
110 A JavaFX application designed to make it simple to understand the current state of your application scenegraph
111 and to also easily manipulate properties of the scenegraph without having to keep editing your code.
112 This lets you find bugs and get things pixel perfect without having to do the compile-check-compile dance.
114 homepage = "https://github.com/JonathanGiles/scenic-view/";
115 sourceProvenance = with sourceTypes; [
117 binaryBytecode # deps
119 license = licenses.gpl3Plus;
120 maintainers = with maintainers; [ wirew0rm ];
121 platforms = platforms.all;