1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
{ stdenv, lib, pkgs, fetchFromGitHub, writeText, gradle_7, pkg-config, perl, cmake
, gperf, gtk2, gtk3, libXtst, libXxf86vm, glib, alsa-lib, ffmpeg_4-headless, python3, ruby
, openjdk11-bootstrap
, withMedia ? true
, withWebKit ? false
}:
let
pname = "openjfx-modular-sdk";
major = "11";
update = ".0.20";
build = "1";
repover = "${major}${update}+${build}";
jdk = openjdk11-bootstrap;
gradle = gradle_7;
in stdenv.mkDerivation {
inherit pname;
version = "${major}${update}-${build}";
src = fetchFromGitHub {
owner = "openjdk";
repo = "jfx${major}u";
rev = repover;
sha256 = "sha256-BbBP2DiPZTSn1SBYMCgyiNdF9GD+NqR6YjeVNOQHHn4=";
};
buildInputs = [ gtk2 gtk3 libXtst libXxf86vm glib alsa-lib ffmpeg_4-headless ];
nativeBuildInputs = [ gradle perl pkg-config cmake gperf python3 ruby ];
dontUseCmakeConfigure = true;
config = writeText "gradle.properties" ''
CONF = Release
JDK_HOME = ${jdk.home}
COMPILE_MEDIA = ${lib.boolToString withMedia}
COMPILE_WEBKIT = ${lib.boolToString withWebKit}
'';
postPatch = ''
substituteInPlace buildSrc/linux.gradle \
--replace ', "-Werror=implicit-function-declaration"' ""
# Add missing includes for gcc-13 for webkit build:
sed -e '1i #include <cstdio>' \
-i modules/javafx.web/src/main/native/Source/bmalloc/bmalloc/Heap.cpp \
modules/javafx.web/src/main/native/Source/bmalloc/bmalloc/IsoSharedPageInlines.h
ln -s $config gradle.properties
'';
mitmCache = gradle.fetchDeps {
attrPath = "openjfx${major}";
pkg = pkgs."openjfx${major}".override { withWebKit = true; };
data = ./deps.json;
};
__darwinAllowLocalNetworking = true;
preBuild = ''
export NUMBER_OF_PROCESSORS=$NIX_BUILD_CORES
export NIX_CFLAGS_COMPILE="$(pkg-config --cflags glib-2.0) $NIX_CFLAGS_COMPILE"
'';
enableParallelBuilding = false;
gradleBuildTask = "sdk";
installPhase = ''
cp -r build/modular-sdk $out
'';
stripDebugList = [ "." ];
postFixup = ''
# Remove references to bootstrap.
export openjdkOutPath='${jdk.outPath}'
find "$out" -name \*.so | while read lib; do
new_refs="$(patchelf --print-rpath "$lib" | perl -pe 's,:?\Q$ENV{openjdkOutPath}\E[^:]*,,')"
patchelf --set-rpath "$new_refs" "$lib"
done
# Remove licenses, otherwise they may conflict with the ones included in the openjdk
rm -rf $out/modules_legal/*
'';
disallowedReferences = [ jdk gradle.jdk ];
# Uses a lot of RAM, OOMs otherwise
requiredSystemFeatures = [ "big-parallel" ];
meta = with lib; {
homepage = "http://openjdk.java.net/projects/openjfx/";
license = licenses.gpl2;
description = "Next-generation Java client toolkit";
maintainers = with maintainers; [ abbradar ];
platforms = [ "x86_64-linux" ];
};
}
|