2019-08-31 17:09:56 +01:00
|
|
|
{ stdenv, lib, fetchurl, writeText, openjdk11_headless, gradleGen
|
2019-08-11 01:34:57 +01:00
|
|
|
, pkgconfig, perl, cmake, gperf, gtk2, gtk3, libXtst, libXxf86vm, glib, alsaLib
|
|
|
|
, ffmpeg, python, ruby }:
|
2019-03-31 21:06:26 +01:00
|
|
|
|
|
|
|
let
|
2019-10-09 13:02:18 +01:00
|
|
|
major = "13";
|
2020-03-09 16:48:32 +00:00
|
|
|
update = ".0.2";
|
|
|
|
build = "1";
|
2019-03-31 21:06:26 +01:00
|
|
|
repover = "${major}${update}+${build}";
|
|
|
|
gradle_ = (gradleGen.override {
|
2019-08-11 01:34:57 +01:00
|
|
|
java = openjdk11_headless;
|
2019-03-31 21:06:26 +01:00
|
|
|
}).gradle_4_10;
|
|
|
|
|
|
|
|
makePackage = args: stdenv.mkDerivation ({
|
2019-08-11 01:34:57 +01:00
|
|
|
version = "${major}${update}-${build}";
|
2019-03-31 21:06:26 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-10-09 13:02:18 +01:00
|
|
|
url = "https://hg.openjdk.java.net/openjfx/${major}-dev/rt/archive/${repover}.tar.gz";
|
2020-03-09 16:48:32 +00:00
|
|
|
sha256 = "1si9wpb9malnf8zzz57l6b80088z2370zfxp1b0kk6rs0cnvpr74";
|
2019-03-31 21:06:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ gtk2 gtk3 libXtst libXxf86vm glib alsaLib ffmpeg ];
|
|
|
|
nativeBuildInputs = [ gradle_ perl pkgconfig cmake gperf python ruby ];
|
|
|
|
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
|
|
|
config = writeText "gradle.properties" (''
|
|
|
|
CONF = Release
|
2019-08-11 01:34:57 +01:00
|
|
|
JDK_HOME = ${openjdk11_headless.home}
|
2019-03-31 21:06:26 +01:00
|
|
|
'' + args.gradleProperties or "");
|
|
|
|
|
2019-10-09 13:02:18 +01:00
|
|
|
#avoids errors about deprecation of GTypeDebugFlags, GTimeVal, etc.
|
|
|
|
NIX_CFLAGS_COMPILE = [ "-DGLIB_DISABLE_DEPRECATION_WARNINGS" ];
|
|
|
|
|
2019-03-31 21:06:26 +01:00
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
export GRADLE_USER_HOME=$(mktemp -d)
|
|
|
|
ln -s $config gradle.properties
|
|
|
|
export NIX_CFLAGS_COMPILE="$(pkg-config --cflags glib-2.0) $NIX_CFLAGS_COMPILE"
|
|
|
|
gradle --no-daemon $gradleFlags sdk
|
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
} // args);
|
|
|
|
|
|
|
|
# Fake build to pre-download deps into fixed-output derivation.
|
|
|
|
# We run nearly full build because I see no other way to download everything that's needed.
|
|
|
|
# Anyone who knows a better way?
|
|
|
|
deps = makePackage {
|
|
|
|
pname = "openjfx-deps";
|
|
|
|
|
|
|
|
# perl code mavenizes pathes (com.squareup.okio/okio/1.13.0/a9283170b7305c8d92d25aff02a6ab7e45d06cbe/okio-1.13.0.jar -> com/squareup/okio/okio/1.13.0/okio-1.13.0.jar)
|
|
|
|
installPhase = ''
|
|
|
|
find $GRADLE_USER_HOME -type f -regex '.*/modules.*\.\(jar\|pom\)' \
|
|
|
|
| perl -pe 's#(.*/([^/]+)/([^/]+)/([^/]+)/[0-9a-f]{30,40}/([^/\s]+))$# ($x = $2) =~ tr|\.|/|; "install -Dm444 $1 \$out/$x/$3/$4/$5" #e' \
|
|
|
|
| sh
|
|
|
|
rm -rf $out/tmp
|
|
|
|
'';
|
|
|
|
|
|
|
|
outputHashAlgo = "sha256";
|
|
|
|
outputHashMode = "recursive";
|
2019-08-11 01:34:57 +01:00
|
|
|
# Downloaded AWT jars differ by platform.
|
|
|
|
outputHash = {
|
2019-10-09 13:02:18 +01:00
|
|
|
x86_64-linux = "077zss95iq6iskx7ghz1c57ymydpzj0wm7r1pkznw99l9xwvdmqi";
|
|
|
|
i686-linux = "03gglr2sh77cyg16qw9g45ji33dg7i93s5s30hz3mh420g112qa0";
|
2019-08-11 01:34:57 +01:00
|
|
|
}.${stdenv.system} or (throw "Unsupported platform");
|
2019-03-31 21:06:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
in makePackage {
|
|
|
|
pname = "openjfx-modular-sdk";
|
|
|
|
|
|
|
|
gradleProperties = ''
|
|
|
|
COMPILE_MEDIA = true
|
|
|
|
COMPILE_WEBKIT = true
|
|
|
|
'';
|
|
|
|
|
2019-10-09 13:02:18 +01:00
|
|
|
#openjdk build fails if licenses are identical, so we must patch this trivial difference
|
|
|
|
patches = [ ./openjfx-mesa-license.patch ];
|
|
|
|
|
2019-03-31 21:06:26 +01:00
|
|
|
preBuild = ''
|
|
|
|
swtJar="$(find ${deps} -name org.eclipse.swt\*.jar)"
|
|
|
|
substituteInPlace build.gradle \
|
|
|
|
--replace 'mavenCentral()' 'mavenLocal(); maven { url uri("${deps}") }' \
|
|
|
|
--replace 'name: SWT_FILE_NAME' "files('$swtJar')"
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
cp -r build/modular-sdk $out
|
|
|
|
'';
|
|
|
|
|
2019-09-14 22:21:34 +01:00
|
|
|
# glib-2.62 deprecations
|
2019-10-30 02:23:29 +00:00
|
|
|
NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS";
|
2019-09-14 22:21:34 +01:00
|
|
|
|
2019-03-31 21:06:26 +01:00
|
|
|
stripDebugList = [ "." ];
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
# Remove references to bootstrap.
|
|
|
|
find "$out" -name \*.so | while read lib; do
|
2019-08-11 01:34:57 +01:00
|
|
|
new_refs="$(patchelf --print-rpath "$lib" | sed -E 's,:?${openjdk11_headless}[^:]*,,')"
|
2019-03-31 21:06:26 +01:00
|
|
|
patchelf --set-rpath "$new_refs" "$lib"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2019-08-11 01:34:57 +01:00
|
|
|
disallowedReferences = [ openjdk11_headless ];
|
|
|
|
|
2019-03-31 21:06:26 +01:00
|
|
|
passthru.deps = deps;
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://openjdk.java.net/projects/openjfx/";
|
2019-08-31 17:09:56 +01:00
|
|
|
license = licenses.gpl2;
|
2019-03-31 21:06:26 +01:00
|
|
|
description = "The next-generation Java client toolkit.";
|
|
|
|
maintainers = with maintainers; [ abbradar ];
|
2019-08-11 01:34:57 +01:00
|
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
2019-03-31 21:06:26 +01:00
|
|
|
};
|
|
|
|
}
|