66 pkgs ,
77
88 gradle_8 ,
9- gradle_7 ,
109 perl ,
1110 pkg-config ,
1211 cmake ,
2322 ffmpeg_7 ,
2423 ffmpeg_7-headless ,
2524
25+ fetchpatch2 ,
2626 writeText ,
2727
2828 _experimental-update-script-combinators ,
5454
5555 atLeast21 = lib . versionAtLeast featureVersion "21" ;
5656 atLeast23 = lib . versionAtLeast featureVersion "23" ;
57-
58- gradle_openjfx = if atLeast21 then gradle_8 else gradle_7 ;
5957in
6058
6159assert lib . assertMsg ( lib . pathExists sourceFile )
@@ -76,11 +74,28 @@ stdenv.mkDerivation {
7674 [
7775 ./17/patches/backport-ffmpeg-6-support-jfx11.patch
7876 ./17/patches/backport-ffmpeg-7-support-jfx11.patch
77+
78+ # Build with Gradle 8
79+ ( fetchpatch2 {
80+ # Yes, this patch taken from the jfx21u repo is intended to be
81+ # applied to jfx17.
82+ url = "https://github.com/openjdk/jfx21u/commit/7f704c24c2238f9d7bb744a20667a8c1337decc6.patch?full_index=1" ;
83+ excludes = [
84+ # The patch fails to apply to these files, but with the exception
85+ # of build.properties (which is patched in postPatch), none of them
86+ # matter.
87+ "build.properties"
88+ "gradle/legal/gradle.md"
89+ "gradle/wrapper/gradle-wrapper.properties"
90+ "gradlew"
91+ ] ;
92+ hash = "sha256-WuJtzPy0IV4xvn+i5xeDqekWO0VR2GIfsYKkEmh8KKU=" ;
93+ } )
7994 ]
8095 ) ;
8196
8297 nativeBuildInputs = [
83- gradle_openjfx
98+ gradle_8
8499 perl
85100 pkg-config
86101 cmake
@@ -99,7 +114,7 @@ stdenv.mkDerivation {
99114 ( if atLeast21 then ffmpeg_7 else ffmpeg_7-headless )
100115 ] ;
101116
102- mitmCache = gradle_openjfx . fetchDeps {
117+ mitmCache = gradle_8 . fetchDeps {
103118 attrPath = "openjfx${ featureVersion } " ;
104119 pkg = pkgs . "openjfx${ featureVersion } " . override { withWebKit = true ; } ;
105120 data = ./. + "/${ featureVersion } /deps.json" ;
@@ -132,6 +147,10 @@ stdenv.mkDerivation {
132147 modules/javafx.web/src/main/native/Source/bmalloc/bmalloc/IsoSharedPageInlines.h
133148
134149 ''
150+ + lib . optionalString ( ! atLeast21 ) ''
151+ substituteInPlace build.properties \
152+ --replace-fail jfx.gradle.version=7.3 jfx.gradle.version=8.4
153+ ''
135154 + ''
136155 ln -s $config gradle.properties
137156 '' ;
@@ -156,7 +175,7 @@ stdenv.mkDerivation {
156175
157176 disallowedReferences = [
158177 jdk-bootstrap
159- gradle_openjfx . jdk
178+ gradle_8 . jdk
160179 ] ;
161180
162181 passthru . updateScript = _experimental-update-script-combinators . sequence [
0 commit comments