summaryrefslogtreecommitdiff
path: root/java/openjfx8-devel/files/patch-build.gradle
blob: 60783880255fc8c780b37cdf1aa0f97fb01ff7db (plain) (blame)
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
--- build.gradle.orig	2018-12-10 16:30:22 UTC
+++ build.gradle
@@ -253,6 +253,7 @@ ext.IS_64 = OS_ARCH.toLowerCase().contains("64")
 ext.IS_MAC = OS_NAME.contains("mac") || OS_NAME.contains("darwin")
 ext.IS_WINDOWS = OS_NAME.contains("windows")
 ext.IS_LINUX = OS_NAME.contains("linux")
+ext.IS_BSD = OS_NAME.contains("freebsd") || OS_NAME.contains("dragonfly")
 
 // Get the JDK_HOME automatically based on the version of Java used to execute gradle. Or, if specified,
 // use a user supplied JDK_HOME, STUB_RUNTIME, JAVAC, and/or JAVAH, all of which may be specified
@@ -313,7 +314,7 @@ defineProperty("COMPILE_MEDIA", "false")
 ext.IS_COMPILE_MEDIA = Boolean.parseBoolean(COMPILE_MEDIA)
 
 // COMPILE_PANGO specifies whether to build javafx_font_pango.
-defineProperty("COMPILE_PANGO", "${IS_LINUX}")
+defineProperty("COMPILE_PANGO", "${IS_LINUX || IS_BSD}")
 ext.IS_COMPILE_PANGO = Boolean.parseBoolean(COMPILE_PANGO)
 
 // COMPILE_HARFBUZZ specifies whether to use Harfbuzz.
@@ -344,7 +345,8 @@ ext.SWT_FILE_NAME = IS_MAC ? "org.eclipse.swt.cocoa.ma
     IS_WINDOWS && IS_64 ? "org.eclipse.swt.win32.win32.x86_64_3.105.3.v20170228-0512" :
     IS_WINDOWS && !IS_64 ? "org.eclipse.swt.win32.win32.x86_3.105.3.v20170228-0512" :
     IS_LINUX && IS_64 ? "org.eclipse.swt.gtk.linux.x86_64_3.105.3.v20170228-0512" :
-    IS_LINUX && !IS_64 ? "org.eclipse.swt.gtk.linux.x86_3.105.3.v20170228-0512" : ""
+    IS_LINUX && !IS_64 ? "org.eclipse.swt.gtk.linux.x86_3.105.3.v20170228-0512" :
+    IS_BSD ? "/usr/local/share/java/classes/swt-devel.jar" : ""
 
 // Build javadocs only if BUILD_JAVADOC=true
 defineProperty("BUILD_JAVADOC", "false")
@@ -404,6 +406,12 @@ if (IS_MAC) {
     defineProperty("NUM_COMPILE_THREADS", "${Runtime.runtime.availableProcessors()}")
 }
 
+if (IS_BSD) {
+    ext.MAKE_CMD = "gmake"
+} else {
+    ext.MAKE_CMD = "make"
+}
+
 //
 // The next three sections of properties are used to generate the
 // VersionInfo class, and the Windows DLL manifest.
@@ -444,7 +452,7 @@ defineProperty("RELEASE_MILESTONE", jfxReleaseMileston
 // Check whether the COMPILE_TARGETS property has been specified (if so, it was done by
 // the user and not by this script). If it has not been defined then default
 // to building the normal desktop build for this machine
-project.ext.set("defaultHostTarget", IS_MAC ? "mac" : IS_WINDOWS ? "win" : IS_LINUX ? "linux" : "");
+project.ext.set("defaultHostTarget", IS_MAC ? "mac" : IS_WINDOWS ? "win" : IS_LINUX ? "linux" : IS_BSD ? "bsd" : "");
 defineProperty("COMPILE_TARGETS", "$defaultHostTarget")
 
 // Flag indicating whether to import cross compile tools
@@ -551,7 +559,7 @@ void fetchExternalTools(String configName, List packag
                 def File pkgdir = file("$destdir/$basename")
 
                 if (pkgname.endsWith(".tgz")) {
-                    if (IS_LINUX || IS_MAC) {
+                    if (IS_BSD || IS_LINUX || IS_MAC) {
                         // use native tar to support symlinks
                         pkgdir.mkdirs()
                         exec {
@@ -676,7 +684,7 @@ compileTargets { t ->
     if (!targetProperties.containsKey('includeMonocle')) targetProperties.includeMonocle = false
     if (!targetProperties.containsKey('includeEGL')) targetProperties.includeEGL = false
 
-    if (!targetProperties.containsKey('includeGTK')) targetProperties.includeGTK = IS_LINUX
+    if (!targetProperties.containsKey('includeGTK')) targetProperties.includeGTK = IS_LINUX || IS_BSD
 
     // This value is used to under ./build/${sdkDirName} to allow for
     // a common name for the hosted build (for use when building apps)
@@ -708,7 +716,7 @@ compileTargets { t ->
 // at present building on PI is not supported, but we would only need to make
 // some changes on assumptions on what should be built (like SWT / Swing) and
 // such and we could probably make it work.
-if (!IS_MAC && !IS_WINDOWS && !IS_LINUX) logger.error("Unsupported build OS ${OS_NAME}")
+if (!IS_MAC && !IS_WINDOWS && !IS_LINUX && !IS_BSD) logger.error("Unsupported build OS ${OS_NAME}")
 if (IS_WINDOWS && OS_ARCH != "x86" && OS_ARCH != "amd64") {
     throw new Exception("Unknown and unsupported build architecture: $OS_ARCH")
 } else if (IS_MAC && OS_ARCH != "x86_64") {
@@ -1165,7 +1173,8 @@ allprojects {
     // By default all of our projects require junit for testing so we can just
     // setup this dependency here.
     dependencies {
-        testCompile group: "junit", name: "junit", version: "4.8.2"
+        testCompile files("/usr/local/share/java/classes/junit4.jar",
+                          "/usr/local/share/java/classes/hamcrest.jar")
         if (BUILD_CLOSED && DO_JCOV)  {
             testCompile name: "jcov"
         }
@@ -1303,12 +1312,15 @@ project(":graphics") {
 
     dependencies {
         compile project(":base"), BUILD_SRC
-        compile name: SWT_FILE_NAME
-        stubCompile group: "junit", name: "junit", version: "4.8.2",
+        if (IS_BSD) {
+             compile files(SWT_FILE_NAME)
+	} else {
+             compile name: SWT_FILE_NAME
+	}
+        stubCompile files("/usr/local/share/java/classes/junit4.jar",
+                          "/usr/local/share/java/classes/hamcrest.jar"),
         project(":base").sourceSets.test.output, sourceSets.main.output
-        antlr3 group: "org.antlr", name: "antlr", version: "3.1.3"
-        antlr3 group: "org.antlr", name: "antlr-runtime",  version: "3.1.3"
-        antlr3 group: "org.antlr", name: "stringtemplate", version: "3.2"
+        antlr3 files("/usr/local/share/java/classes/antlr-3.5.2-complete.jar")
     }
 
     // Create a single "native" task which will depend on all the individual native tasks for graphics
@@ -1599,9 +1611,7 @@ project(":graphics") {
                 copy {
                     into libsDir
                     from f.getParentFile()
-                    include "**/antlr-3.1.3.jar"
-                    include "**/stringtemplate-3.2.jar"
-                    include "**/antlr-runtime-3.1.3.jar"
+                    include "**/antlr-3.5.2-complete.jar"
                     includeEmptyDirs = false
                 }
                 // Have to rename the swt jar because it is some platform specific name but
@@ -1688,7 +1698,11 @@ project(":swt") {
     }
     dependencies {
         compile BUILD_SRC, project(":base"), project(":graphics")
-        compile name: SWT_FILE_NAME
+        if (IS_BSD) {
+            compile files(SWT_FILE_NAME)
+        } else {
+            compile name: SWT_FILE_NAME
+        }
     }
 }
 
@@ -1794,7 +1808,7 @@ project(":fxpackager") {
     }
 
     dependencies {
-        compile group: "org.apache.ant", name: "ant", version: "1.8.2"
+        compile files("/usr/local/share/java/apache-ant/lib/ant.jar")
     }
 
     // When producing the jar, we need to relocate a few class files
@@ -2055,23 +2069,6 @@ project(":fxpackager") {
     jar.dependsOn buildJavaPackager
     jar.dependsOn packagerJar
 
-    classes {
-        doLast {
-            // Copy all of the download libraries to libs directory for the sake of the IDEs
-            File libsDir = rootProject.file("build/libs");
-            File antLib = new File(libsDir, "ant-1.8.2.jar")
-            libsDir.mkdirs();
-            for (File f : configurations.compile.files) {
-                copy {
-                    into libsDir
-                    from f.getParentFile()
-                    include "**/ant-1.8.2.jar"
-                    includeEmptyDirs = false
-                }
-            }
-        }
-    }
-
     task packagerFakeJar(type: Jar) {
         dependsOn compileTestJava
         from compileTestJava.destinationDir
@@ -2250,7 +2247,7 @@ project(":media") {
 
             doLast {
                 exec {
-                    commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/jfxmedia/projects/${projectDir}")
+                    commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/jfxmedia/projects/${projectDir}")
                     args("JAVA_HOME=${JDK_HOME}", "GENERATED_HEADERS_DIR=${generatedHeadersDir}",
                          "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=jfxmedia",
                          "COMPILE_PARFAIT=${compileParfait}")
@@ -2260,7 +2257,7 @@ project(":media") {
                         args(IS_64 ? "ARCH=x64" : "ARCH=x32", "RESOURCE=${nativeOutputDir}/${buildType}/${WIN.media.jfxmediaRcFile}")
                     } else {
                         args ("CC=${mediaProperties.compiler}", "LINK=${mediaProperties.linker}", "LIB=${mediaProperties.lib}")
-                        if (t.name == "linux") {
+                        if (t.name == "linux" || t.name == "bsd") {
                             args(IS_64 ? "ARCH=x64" : "ARCH=x32")
                         }
 
@@ -2282,7 +2279,7 @@ project(":media") {
                 enabled = IS_COMPILE_MEDIA
                 doLast {
                     exec {
-                        commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/gstreamer-lite")
+                        commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/gstreamer-lite")
                         args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=gstreamer-lite")
 
                         if (t.name == "win") {
@@ -2290,7 +2287,7 @@ project(":media") {
                             args(IS_64 ? "ARCH=x64" : "ARCH=x32", "RESOURCE=${nativeOutputDir}/${buildType}/${WIN.media.gstreamerRcFile}")
                         } else {
                             args ("CC=${mediaProperties.compiler}", "LINK=${mediaProperties.linker}", "LIB=${mediaProperties.lib}")
-                            if (t.name == "linux") {
+                            if (t.name == "linux" || t.name == "bsd") {
                                 args(IS_64 ? "ARCH=x64" : "ARCH=x32")
                             }
                         }
@@ -2311,7 +2308,7 @@ project(":media") {
 
                 doLast {
                     exec {
-                        commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/fxplugins")
+                        commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/fxplugins")
                         args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=fxplugins",
                              "ON2_SRCDIR=${project.ext.ON2_SRCDIR}", "ON2_LIB=${project.ext.ON2_LIB}")
 
@@ -2328,7 +2325,7 @@ project(":media") {
                             args(IS_64 ? "ARCH=x64" : "ARCH=x32", "RESOURCE=${nativeOutputDir}/${buildType}/${WIN.media.fxpluginsRcFile}")
                         } else {
                             args ("CC=${mediaProperties.compiler}", "LINK=${mediaProperties.linker}", "LIB=${mediaProperties.lib}")
-                            if (t.name == "linux") {
+                            if (t.name == "linux" || t.name == "bsd") {
                                 args(IS_64 ? "ARCH=x64" : "ARCH=x32")
                             }
                         }
@@ -2338,7 +2335,7 @@ project(":media") {
 
             buildNative.dependsOn buildPlugins
 
-            if (t.name == "linux") {
+            if (t.name == "linux" || t.name == "bsd") {
                 def buildAVPlugin = task( "buildAVPlugin", dependsOn: [buildPlugins]) {
                     enabled = IS_COMPILE_MEDIA
 
@@ -2349,7 +2346,7 @@ project(":media") {
                                 File dir = file(libavDir)
                                 if (dir.exists()) {
                                     exec {
-                                        commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/linux/avplugin")
+                                        commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${t.name}/avplugin")
                                         args("CC=${mediaProperties.compiler}", "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}",
                                              "BASE_NAME=avplugin", "VERSION=${version}", "LIBAV_DIR=${libavDir}",
                                              "SUFFIX=", IS_64 ? "ARCH=x64" : "ARCH=x32")
@@ -2362,7 +2359,7 @@ project(":media") {
                                 File dir = file(libavDir)
                                 if (dir.exists()) {
                                     exec {
-                                        commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/linux/avplugin")
+                                        commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${t.name}/avplugin")
                                         args("CC=${mediaProperties.compiler}", "LINKER=${mediaProperties.linker}",
                                              "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}",
                                              "BASE_NAME=avplugin", "VERSION=${version}", "LIBAV_DIR=${libavDir}",
@@ -2373,7 +2370,7 @@ project(":media") {
                         } else {
                             // Building fxavcodec plugin (libav plugin)
                             exec {
-                                commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/linux/avplugin")
+                                commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${t.name}/avplugin")
                                 args("CC=${mediaProperties.compiler}", "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}",
                                      "BASE_NAME=avplugin", IS_64 ? "ARCH=x64" : "ARCH=x32")
                             }
@@ -2423,7 +2420,7 @@ project(":media") {
                     doLast {
                         exec {
                             environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
-                            commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/glib-lite")
+                            commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/glib-lite")
                             args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=glib-lite",
                                  IS_64 ? "ARCH=x64" : "ARCH=x32", "RESOURCE=${nativeOutputDir}/${buildType}/${WIN.media.glibRcFile}")
                         }
@@ -2442,7 +2439,7 @@ project(":media") {
                         }
 
                         exec {
-                            commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/glib-lite")
+                            commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/glib-lite")
                             args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=glib-lite")
                             args ("CC=${mediaProperties.compiler}", "LINK=${mediaProperties.linker}", "LIB=${mediaProperties.lib}")
                         }
@@ -2562,7 +2559,7 @@ project(":web") {
     compileTargets { t ->
         def targetProperties = project.rootProject.ext[t.upper]
         def webkitProperties = targetProperties.webkit
-        def classifier = (t.name != "linux" && t.name != "win") ? t.name :
+        def classifier = (t.name != "linux" && t.name != "bsd" && t.name != "win") ? t.name :
                           IS_64 ? "${t.name}-amd64" : "${t.name}-i586"
 
         def webkitOutputDir = cygpath("$buildDir/${t.name}")
@@ -2638,6 +2635,9 @@ project(":web") {
                     }
 
                     cmakeArgs += " -DJAVAFX_RELEASE_VERSION=8.0"
+                    cmakeArgs += " -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
+                    cmakeArgs += " -DCMAKE_C_COMPILER:STRING=${System.getenv("CC")}"
+                    cmakeArgs += " -DCMAKE_CXX_COMPILER:STRING=${System.getenv("CXX")}"
                     commandLine("perl", "$projectDir/src/main/native/Tools/Scripts/build-webkit",
                         "--java", "--icu-unicode", targetCpuBitDepthSwitch,
                         "--cmakeargs=${cmakeArgs}")
@@ -3132,7 +3132,7 @@ compileTargets { t ->
                         // OSX media natives
                         [ "jfxmedia_qtkit", "jfxmedia_avf" ].each { name ->
                             from ("modules/media/build/native/${t.name}/${mediaBuildType}/${library(name)}") }
-                    } else if (t.name == "linux") {
+                    } else if (t.name == "linux" || t.name == "bsd") {
                         from("modules/media/build/native/${t.name}/${mediaBuildType}") { include "libavplugin*.so" }
                     }
                 } else {
@@ -3145,7 +3145,7 @@ compileTargets { t ->
                         // copy libjfxmedia_{avf,qtkit}.dylib if they exist
                         [ "jfxmedia_qtkit", "jfxmedia_avf" ].each { name ->
                             from ("$LIBRARY_STUB/${library(name)}") }
-                    } else if (t.name == "linux") {
+                    } else if (t.name == "linux" || t.name == "bsd") {
                         from(LIBRARY_STUB) { include "libavplugin*.so" }
                     }
                 }
@@ -3207,7 +3207,7 @@ compileTargets { t ->
             }
 
             // Copy over the javapackager executable
-            if (t.name == "win" || t.name == "linux" || t.name == "mac") {
+            if (t.name == "win" || t.name == "linux" || t.name == "bsd" || t.name == "mac") {
                 copy {
                     from "modules/fxpackager/build/javapackager"
                     into "build/${sdkDirName}/bin"
@@ -3264,6 +3264,7 @@ ext.JFXRT_CP =
             "modules/web/build/classes/java/main",
     )
 
+/*
 project(":apps") {
     // The apps build is Ant based, and gradle lets us "import" ant build.xml
     // into our configuration.
@@ -3341,7 +3342,7 @@ project(":apps") {
         }
         rootProject.clean.dependsOn(appsClean)
     }
-}
+} */
 
 /******************************************************************************
  *                                                                            *