View | Details | Raw Unified | Return to bug 248248 | Differences between
and this patch

Collapse All | Expand All

(-)java/openjfx14/Makefile (-58 / +49 lines)
Lines 1-49 Link Here
1
# Created by: Tobias Kortkamp <t@tobik.me>
2
# $FreeBSD$
1
# $FreeBSD$
3
2
4
PORTNAME=	openjfx8
3
PORTNAME=	openjfx
5
DISTVERSION=	8u202-b07
4
DISTVERSION=	14.0.2.1+1
6
PORTREVISION=	7
5
CATEGORIES=	x11-toolkits java devel
7
PORTEPOCH=	1
6
PKGNAMESUFFIX=	14
8
CATEGORIES=	java x11-toolkits devel
9
MASTER_SITES=	https://github.com/t6/openjfx/releases/download/release/ \
10
		http://hg.openjdk.java.net/openjfx/8u/rt/archive/${DISTVERSION}${EXTRACT_SUFX}?dummy=/
11
PKGNAMESUFFIX=	-devel
12
7
13
MAINTAINER=	tobik@FreeBSD.org
8
MAINTAINER=	mikael@FreeBSD.org
14
COMMENT=	JavaFX SDK overlay for OpenJDK 8
9
COMMENT=	JavaFX SDK overlay for OpenJDK 11
15
10
16
LICENSE=	GPLv2
11
LICENSE=	GPLv2
17
LICENSE_FILE=	${WRKSRC}/LICENSE
12
LICENSE_FILE=	${WRKSRC}/LICENSE
18
13
19
DEPRECATED=	No longer maintained upstream
14
ONLY_FOR_ARCHS=	aarch64 amd64 powerpc64
20
EXPIRATION_DATE=	2020-11-30
21
ONLY_FOR_ARCHS=	amd64 i386
22
15
23
BUILD_DEPENDS=	apache-ant>0:devel/apache-ant \
16
BUILD_DEPENDS=	zip:archivers/zip \
24
		antlr3>0:devel/antlr3 \
17
		apache-ant>0:devel/apache-ant \
25
		gradle4>=4.8:devel/gradle4 \
18
		antlr4>0:devel/antlr4 \
19
		gradle62>=6.2:devel/gradle62 \
26
		${JAVALIBDIR}/junit.jar:java/junit
20
		${JAVALIBDIR}/junit.jar:java/junit
27
LIB_DEPENDS=	libfontconfig.so:x11-fonts/fontconfig \
21
LIB_DEPENDS=	libasound.so:audio/alsa-lib \
22
		libfontconfig.so:x11-fonts/fontconfig \
28
		libfreetype.so:print/freetype2
23
		libfreetype.so:print/freetype2
29
24
30
USES=		gettext-runtime gl gnome jpeg localbase:ldflags pkgconfig \
25
USES=		gettext-runtime gl gnome jpeg localbase:ldflags ninja pkgconfig \
31
		sqlite xorg
26
		sqlite xorg
27
28
USE_GITHUB=	yes
29
GH_ACCOUNT=	openjdk
30
GH_PROJECT=	jfx
32
USE_GL=		gl
31
USE_GL=		gl
33
USE_GNOME=	atk cairo gdkpixbuf2 glib20 gtk20 gtk30 pango
32
USE_GNOME=	atk cairo gdkpixbuf2 glib20 gtk20 gtk30 pango
34
USE_JAVA=	yes
33
USE_JAVA=	yes
35
JAVA_VERSION=	1.8
34
JAVA_VERSION=	11
36
USE_LDCONFIG=	yes
35
USE_LDCONFIG=	yes
37
USE_XORG=	x11 xtst xxf86vm
36
USE_XORG=	x11 xtst xxf86vm
38
37
39
CFLAGS+=	-Wno-unused-command-line-argument
38
CFLAGS+=	-Wno-unused-command-line-argument
40
39
41
WRKSRC=		${WRKDIR}/rt-${DISTVERSION}
40
PLIST_SUB=	JAVA_HOME=${JAVA_HOME}
42
41
43
PLIST_SUB=	ARCH=${ARCH} \
44
		JAVA_HOME=${JAVA_HOME}
45
46
OPTIONS_DEFINE=	MEDIA SWT TEST WEBKIT
42
OPTIONS_DEFINE=	MEDIA SWT TEST WEBKIT
43
OPTIONS_EXCLUDE_aarch64=	WEBKIT
44
OPTIONS_EXCLUDE_powerpc64=	WEBKIT
47
OPTIONS_DEFAULT=	MEDIA WEBKIT
45
OPTIONS_DEFAULT=	MEDIA WEBKIT
48
OPTIONS_SUB=	yes
46
OPTIONS_SUB=	yes
49
47
Lines 66-72 Link Here
66
WEBKIT_IMPLIES=	MEDIA
64
WEBKIT_IMPLIES=	MEDIA
67
WEBKIT_BUILD_DEPENDS=	cmake:devel/cmake
65
WEBKIT_BUILD_DEPENDS=	cmake:devel/cmake
68
WEBKIT_LIB_DEPENDS=	libicui18n.so:devel/icu
66
WEBKIT_LIB_DEPENDS=	libicui18n.so:devel/icu
69
WEBKIT_USES=	bison compiler:c++14-lang gmake gperf perl5 python:2.7,build
67
WEBKIT_USES=	bison gmake gperf perl5 python:2.7,build
70
WEBKIT_USE=	GNOME=libxslt,libxml2 \
68
WEBKIT_USE=	GNOME=libxslt,libxml2 \
71
		PERL5=build \
69
		PERL5=build \
72
		RUBY=yes \
70
		RUBY=yes \
Lines 76-131 Link Here
76
# Move Gradle's home below ${WRKDIR} instead of using ${HOME}/.gradle
74
# Move Gradle's home below ${WRKDIR} instead of using ${HOME}/.gradle
77
_GRADLE_ENV=	CC=${WRKDIR}/bin/ccwrapper \
75
_GRADLE_ENV=	CC=${WRKDIR}/bin/ccwrapper \
78
		CXX=${WRKDIR}/bin/cxxwrapper \
76
		CXX=${WRKDIR}/bin/cxxwrapper \
79
		GRADLE_USER_HOME=${WRKDIR}/gradle-home
77
		GRADLE_USER_HOME=${WRKDIR}/gradle-home \
80
_GRADLE_RUN=	${SETENV} ${_GRADLE_ENV} gradle4 --no-daemon
78
		JAVA_VERSION=${JAVA_VERSION}
79
_GRADLE_RUN=	${SETENV} ${_GRADLE_ENV} gradle62 --no-daemon
81
80
82
# NOTE: This port won't build if ${JAVA_HOME}/jre/lib/ext/jfxrt.jar
83
# already exists on your system.  This is not a problem in Poudriere
84
# or Synth but something to be aware of if you're trying to build this
85
# port in a non-pristine environment.
86
87
# The BSD Makefiles for GStreamer-lite and Jfxmedia are based on the
81
# The BSD Makefiles for GStreamer-lite and Jfxmedia are based on the
88
# Linux versions.  Prepare the tree, so that we only see the changes
82
# Linux versions.  Prepare the tree, so that we only see the changes
89
# from Linux's Makefile in our own patches.
83
# from Linux's Makefile in our own patches.
90
pre-patch:
84
pre-patch:
91
	@${CP} -r ${WRKSRC}/modules/media/src/main/native/jfxmedia/projects/linux \
85
	@${CP} -r ${WRKSRC}/modules/javafx.media/src/main/native/jfxmedia/projects/linux \
92
		${WRKSRC}/modules/media/src/main/native/jfxmedia/projects/bsd
86
		${WRKSRC}/modules/javafx.media/src/main/native/jfxmedia/projects/bsd
93
	@${CP} -r ${WRKSRC}/modules/media/src/main/native/gstreamer/projects/linux \
87
	@${CP} -r ${WRKSRC}/modules/javafx.media/src/main/native/gstreamer/projects/linux \
94
		${WRKSRC}/modules/media/src/main/native/gstreamer/projects/bsd
88
		${WRKSRC}/modules/javafx.media/src/main/native/gstreamer/projects/bsd
95
89
96
post-patch:
90
post-patch:
97
	@${MKDIR} ${WRKDIR}/bin
91
	@${MKDIR} ${WRKDIR}/bin
98
	@${PRINTF} '#!/bin/sh\nexec ${CC} ${CFLAGS} ${LDFLAGS} "$$@"\n' > ${WRKDIR}/bin/ccwrapper
92
	@${PRINTF} '#!/bin/sh\nexec ${CCACHE_BIN} ${CC} ${CFLAGS} ${LDFLAGS} "$$@"\n' > ${WRKDIR}/bin/ccwrapper
99
	@${PRINTF} '#!/bin/sh\nexec ${CXX} ${CXXFLAGS} ${LDFLAGS} "$$@"\n' > ${WRKDIR}/bin/cxxwrapper
93
	@${PRINTF} '#!/bin/sh\nexec ${CCACHE_BIN} ${CXX} ${CXXFLAGS} ${LDFLAGS} "$$@"\n' > ${WRKDIR}/bin/cxxwrapper
100
	@${CHMOD} +x ${WRKDIR}/bin/ccwrapper ${WRKDIR}/bin/cxxwrapper
94
	@${CHMOD} +x ${WRKDIR}/bin/ccwrapper ${WRKDIR}/bin/cxxwrapper
101
	@${SED} -e 's@/linux@/freebsd@g' -e 's@-DLINUX@-DFREEBSD@g' -e 's@LINUX@BSD@g' \
95
	@${REINPLACE_CMD} -e 's|gcc|${WRKDIR}/bin/ccwrapper|g' \
102
		-e 's@linux_@bsd_@g' -e 's@"-static-libgcc", "-static-libstdc++",@@g' \
96
			  -e 's|g\+\+|${WRKDIR}/bin/cxxwrapper|g' \
103
		-e 's@"gcc"@"${WRKDIR}/bin/ccwrapper"@g' -e 's@"g\+\+"@"${WRKDIR}/bin/cxxwrapper"@g' \
97
		${WRKSRC}/buildSrc/bsd.gradle
104
		${WRKSRC}/buildSrc/linux.gradle > ${WRKSRC}/buildSrc/bsd.gradle
105
# Add a *BSD native audio sink to GStreamer-lite instead of using the
98
# Add a *BSD native audio sink to GStreamer-lite instead of using the
106
# bundled ALSA sink.  Currently we add an sndio sink, but this is an extension
99
# bundled ALSA sink.  Currently we add an sndio sink, but this is an extension
107
# point for eventually adding an OSS backend (or others) as an option as well.
100
# point for eventually adding an OSS backend (or others) as an option as well.
108
# If you add a new one make sure it registers itself as "bsdaudiosink" as defined
101
# If you add a new one make sure it registers itself as "bsdaudiosink" as defined
109
# in modules/media/src/main/native/jfxmedia/platform/gstreamer/GstPipelineFactory.cpp
102
# in modules/media/src/main/native/jfxmedia/platform/gstreamer/GstPipelineFactory.cpp
110
	@${MKDIR} ${WRKSRC}/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/ext/bsdaudio
103
	@${MKDIR} ${WRKSRC}/modules/javafx.media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/ext/bsdaudio
111
	@${CP} ${FILESDIR}/gstsndio.* ${FILESDIR}/sndiosink.* \
104
	@${CP} ${FILESDIR}/gstsndio.* ${FILESDIR}/sndiosink.* \
112
		${WRKSRC}/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/ext/bsdaudio
105
		${WRKSRC}/modules/javafx.media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/ext/bsdaudio
113
	@cd ${WRKSRC}/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/ext/bsdaudio && \
106
	@cd ${WRKSRC}/modules/javafx.media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/ext/bsdaudio && \
114
		${LN} -s gstsndio.c gstbsdaudio.c && \
107
		${LN} -s gstsndio.c gstbsdaudio.c && \
115
		${LN} -s sndiosink.c bsdaudiosink.c
108
		${LN} -s sndiosink.c bsdaudiosink.c
116
# Pull Java dependencies from LOCALBASE
109
# Pull Java dependencies from LOCALBASE
117
	@${REINPLACE_CMD} 's@/usr/local@${LOCALBASE}@g' \
110
	@${REINPLACE_CMD} 's|/usr/local|${LOCALBASE}|g' \
118
		${WRKSRC}/build.gradle ${WRKSRC}/buildSrc/build.gradle
111
		${WRKSRC}/build.gradle ${WRKSRC}/buildSrc/build.gradle
119
# Remove bundled libraries.  We use the system's versions instead.
112
# Remove bundled libraries. We use the system's versions instead.
120
	@cd ${WRKSRC}/modules/web/src/main/native/Source/ThirdParty && \
113
	@cd ${WRKSRC}/modules/javafx.web/src/main/native/Source/ThirdParty && \
121
		${RM} -r icu libxml libxslt sqlite
114
		${RM} -r icu libxml libxslt sqlite
122
	@${RM} -r ${WRKSRC}/modules/web/src/main/native/Source/WTF/icu
115
	@${RM} -r ${WRKSRC}/modules/javafx.web/src/main/native/Source/WTF/icu
123
	@cd ${WRKSRC}/modules/media/src/main/native/gstreamer/3rd_party && \
116
	@cd ${WRKSRC}/modules/javafx.media/src/main/native/gstreamer/3rd_party && \
124
		${RM} -r glib libffi
117
		${RM} -r glib libffi
125
118
126
post-patch-SWT-off:
127
	@${RM} -r ${WRKSRC}/modules/graphics/src/main/java/com/sun/glass/ui/swt
128
129
do-configure:
119
do-configure:
130
	@${MKDIR} ${WRKDIR}/gradle-home
120
	@${MKDIR} ${WRKDIR}/gradle-home
131
	@${ECHO_CMD} "NUM_COMPILE_THREADS = ${MAKE_JOBS_NUMBER}" > ${WRKSRC}/gradle.properties
121
	@${ECHO_CMD} "NUM_COMPILE_THREADS = ${MAKE_JOBS_NUMBER}" > ${WRKSRC}/gradle.properties
Lines 135-147 Link Here
135
	@${ECHO_CMD} "BSD.compileSWT = ${COMPILE_SWT:Ufalse};" >> ${WRKSRC}/buildSrc/bsd.gradle
125
	@${ECHO_CMD} "BSD.compileSWT = ${COMPILE_SWT:Ufalse};" >> ${WRKSRC}/buildSrc/bsd.gradle
136
126
137
do-build:
127
do-build:
138
	@cd ${WRKSRC} && ${_GRADLE_RUN} zips
128
	@cd ${WRKSRC} && ${SETENV} ${_GRADLE_RUN} zips
139
129
140
do-install:
130
do-install:
141
	@${MKDIR} ${STAGEDIR}${JAVA_HOME}
131
	@${MKDIR} ${STAGEDIR}${JAVA_HOME}/lib ${STAGEDIR}${JAVA_HOME}/jmods
142
	@${TAR} -C ${STAGEDIR}${JAVA_HOME} \
132
	(cd ${WRKSRC}/build/artifacts/javafx-sdk-14.0.2.1/lib && ${COPYTREE_SHARE} . ${STAGEDIR}${JAVA_HOME}/lib)
143
		-xf ${WRKSRC}/build/bundles/javafx-sdk-overlay.zip
133
	@${MV} ${STAGEDIR}${JAVA_HOME}/lib/src.zip ${STAGEDIR}${JAVA_HOME}/lib/javafx-src.zip
144
	@${FIND} ${STAGEDIR}${JAVA_HOME}/jre -name '*.so' -exec ${STRIP_CMD} \{\} \;
134
	(cd ${WRKSRC}/build/artifacts/javafx-jmods-14.0.2.1 && ${COPYTREE_SHARE} . ${STAGEDIR}${JAVA_HOME}/jmods)
135
	@${FIND} ${STAGEDIR}${JAVA_HOME}/lib -name '*.so' -exec ${STRIP_CMD} \{\} \;
145
136
146
do-test-TEST-on:
137
do-test-TEST-on:
147
	@cd ${WRKSRC} && ${_GRADLE_RUN} check test
138
	@cd ${WRKSRC} && ${_GRADLE_RUN} check test
(-)java/openjfx14/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1563779003
1
TIMESTAMP = 1595085795
2
SHA256 (openjfx8-8u202-b07.tar.gz) = ca98b6d0721a0e4b91d62672e81594c80a47cfb5ded241de50f10ade9884c400
2
SHA256 (openjdk-jfx-14.0.2.1+1_GH0.tar.gz) = 08830d79dbdaadf66a1feae356caed6d70636dfdbf47598dd48a59f407d05ef1
3
SIZE (openjfx8-8u202-b07.tar.gz) = 70669594
3
SIZE (openjdk-jfx-14.0.2.1+1_GH0.tar.gz) = 67975108
(-)java/openjfx14/files/patch-build.gradle (-189 / +166 lines)
Lines 1-16 Link Here
1
--- build.gradle.orig	2018-12-10 16:30:22 UTC
1
--- build.gradle.orig	2020-07-17 10:21:33 UTC
2
+++ build.gradle
2
+++ build.gradle
3
@@ -253,6 +253,7 @@ ext.IS_64 = OS_ARCH.toLowerCase().contains("64")
3
@@ -295,6 +295,7 @@ ext.IS_64 = OS_ARCH.toLowerCase().contains("64")
4
 ext.IS_MAC = OS_NAME.contains("mac") || OS_NAME.contains("darwin")
4
 ext.IS_MAC = OS_NAME.contains("mac") || OS_NAME.contains("darwin")
5
 ext.IS_WINDOWS = OS_NAME.contains("windows")
5
 ext.IS_WINDOWS = OS_NAME.contains("windows")
6
 ext.IS_LINUX = OS_NAME.contains("linux")
6
 ext.IS_LINUX = OS_NAME.contains("linux")
7
+ext.IS_BSD = OS_NAME.contains("freebsd") || OS_NAME.contains("dragonfly")
7
+ext.IS_BSD = OS_NAME.contains("freebsd") || OS_NAME.contains("dragonfly")
8
 
8
 
9
 // Get the JDK_HOME automatically based on the version of Java used to execute gradle. Or, if specified,
9
 ext.MAVEN_GROUP_ID = "org.openjfx"
10
 // use a user supplied JDK_HOME, STUB_RUNTIME, JAVAC, and/or JAVAH, all of which may be specified
11
@@ -313,7 +314,7 @@ defineProperty("COMPILE_MEDIA", "false")
12
 ext.IS_COMPILE_MEDIA = Boolean.parseBoolean(COMPILE_MEDIA)
13
 
10
 
11
@@ -302,7 +303,7 @@ ext.MAVEN_GROUP_ID = "org.openjfx"
12
 // at present building on PI is not supported, but we would only need to make
13
 // some changes on assumptions on what should be built (like SWT / Swing) and
14
 // such and we could probably make it work.
15
-if (!IS_MAC && !IS_WINDOWS && !IS_LINUX) fail("Unsupported build OS ${OS_NAME}")
16
+if (!IS_MAC && !IS_WINDOWS && !IS_LINUX && !IS_BSD) fail("Unsupported build OS ${OS_NAME}")
17
 if (IS_WINDOWS && OS_ARCH != "x86" && OS_ARCH != "amd64") {
18
     fail("Unknown and unsupported build architecture: $OS_ARCH")
19
 } else if (IS_MAC && OS_ARCH != "x86_64") {
20
@@ -385,7 +386,7 @@ defineProperty("BUILD_WORKING_LIBAV", "false")
21
 ext.IS_BUILD_WORKING_LIBAV = IS_LINUX ? Boolean.parseBoolean(BUILD_WORKING_LIBAV) : false
22
 
14
 // COMPILE_PANGO specifies whether to build javafx_font_pango.
23
 // COMPILE_PANGO specifies whether to build javafx_font_pango.
15
-defineProperty("COMPILE_PANGO", "${IS_LINUX}")
24
-defineProperty("COMPILE_PANGO", "${IS_LINUX}")
16
+defineProperty("COMPILE_PANGO", "${IS_LINUX || IS_BSD}")
25
+defineProperty("COMPILE_PANGO", "${IS_LINUX || IS_BSD}")
Lines 17-23 Link Here
17
 ext.IS_COMPILE_PANGO = Boolean.parseBoolean(COMPILE_PANGO)
26
 ext.IS_COMPILE_PANGO = Boolean.parseBoolean(COMPILE_PANGO)
18
 
27
 
19
 // COMPILE_HARFBUZZ specifies whether to use Harfbuzz.
28
 // COMPILE_HARFBUZZ specifies whether to use Harfbuzz.
20
@@ -344,7 +345,8 @@ ext.SWT_FILE_NAME = IS_MAC ? "org.eclipse.swt.cocoa.ma
29
@@ -413,7 +414,8 @@ ext.SWT_FILE_NAME = IS_MAC ? "org.eclipse.swt.cocoa.ma
21
     IS_WINDOWS && IS_64 ? "org.eclipse.swt.win32.win32.x86_64_3.105.3.v20170228-0512" :
30
     IS_WINDOWS && IS_64 ? "org.eclipse.swt.win32.win32.x86_64_3.105.3.v20170228-0512" :
22
     IS_WINDOWS && !IS_64 ? "org.eclipse.swt.win32.win32.x86_3.105.3.v20170228-0512" :
31
     IS_WINDOWS && !IS_64 ? "org.eclipse.swt.win32.win32.x86_3.105.3.v20170228-0512" :
23
     IS_LINUX && IS_64 ? "org.eclipse.swt.gtk.linux.x86_64_3.105.3.v20170228-0512" :
32
     IS_LINUX && IS_64 ? "org.eclipse.swt.gtk.linux.x86_64_3.105.3.v20170228-0512" :
Lines 25-33 Link Here
25
+    IS_LINUX && !IS_64 ? "org.eclipse.swt.gtk.linux.x86_3.105.3.v20170228-0512" :
34
+    IS_LINUX && !IS_64 ? "org.eclipse.swt.gtk.linux.x86_3.105.3.v20170228-0512" :
26
+    IS_BSD ? "/usr/local/share/java/classes/swt.jar" : ""
35
+    IS_BSD ? "/usr/local/share/java/classes/swt.jar" : ""
27
 
36
 
28
 // Build javadocs only if BUILD_JAVADOC=true
37
 // Specifies whether to run full tests (true) or smoke tests (false)
29
 defineProperty("BUILD_JAVADOC", "false")
38
 defineProperty("FULL_TEST", "false")
30
@@ -404,6 +406,12 @@ if (IS_MAC) {
39
@@ -495,6 +497,12 @@ if (IS_MAC) {
31
     defineProperty("NUM_COMPILE_THREADS", "${Runtime.runtime.availableProcessors()}")
40
     defineProperty("NUM_COMPILE_THREADS", "${Runtime.runtime.availableProcessors()}")
32
 }
41
 }
33
 
42
 
Lines 40-46 Link Here
40
 //
49
 //
41
 // The next three sections of properties are used to generate the
50
 // The next three sections of properties are used to generate the
42
 // VersionInfo class, and the Windows DLL manifest.
51
 // VersionInfo class, and the Windows DLL manifest.
43
@@ -444,7 +452,7 @@ defineProperty("RELEASE_MILESTONE", jfxReleaseMileston
52
@@ -558,7 +566,7 @@ defineProperty("MAVEN_VERSION", IS_MILESTONE_FCS ? "${
44
 // Check whether the COMPILE_TARGETS property has been specified (if so, it was done by
53
 // Check whether the COMPILE_TARGETS property has been specified (if so, it was done by
45
 // the user and not by this script). If it has not been defined then default
54
 // the user and not by this script). If it has not been defined then default
46
 // to building the normal desktop build for this machine
55
 // to building the normal desktop build for this machine
Lines 49-64 Link Here
49
 defineProperty("COMPILE_TARGETS", "$defaultHostTarget")
58
 defineProperty("COMPILE_TARGETS", "$defaultHostTarget")
50
 
59
 
51
 // Flag indicating whether to import cross compile tools
60
 // Flag indicating whether to import cross compile tools
52
@@ -551,7 +559,7 @@ void fetchExternalTools(String configName, List packag
61
@@ -704,7 +712,7 @@ void fetchExternalTools(String configName, List packag
53
                 def File pkgdir = file("$destdir/$basename")
62
                 def File pkgdir = file("$destdir/$basename")
54
 
63
 
55
                 if (pkgname.endsWith(".tgz")) {
64
                 if (pkgname.endsWith(".tgz") || pkgname.endsWith("tar.gz")) {
56
-                    if (IS_LINUX || IS_MAC) {
65
-                    if (IS_LINUX || IS_MAC) {
57
+                    if (IS_BSD || IS_LINUX || IS_MAC) {
66
+                    if (IS_LINUX || IS_MAC || IS_BSD) {
58
                         // use native tar to support symlinks
67
                         // use native tar to support symlinks
59
                         pkgdir.mkdirs()
68
                         pkgdir.mkdirs()
60
                         exec {
69
                         exec {
61
@@ -676,7 +684,7 @@ compileTargets { t ->
70
@@ -1180,7 +1188,7 @@ compileTargets { t ->
62
     if (!targetProperties.containsKey('includeMonocle')) targetProperties.includeMonocle = false
71
     if (!targetProperties.containsKey('includeMonocle')) targetProperties.includeMonocle = false
63
     if (!targetProperties.containsKey('includeEGL')) targetProperties.includeEGL = false
72
     if (!targetProperties.containsKey('includeEGL')) targetProperties.includeEGL = false
64
 
73
 
Lines 65-171 Link Here
65
-    if (!targetProperties.containsKey('includeGTK')) targetProperties.includeGTK = IS_LINUX
74
-    if (!targetProperties.containsKey('includeGTK')) targetProperties.includeGTK = IS_LINUX
66
+    if (!targetProperties.containsKey('includeGTK')) targetProperties.includeGTK = IS_LINUX || IS_BSD
75
+    if (!targetProperties.containsKey('includeGTK')) targetProperties.includeGTK = IS_LINUX || IS_BSD
67
 
76
 
68
     // This value is used to under ./build/${sdkDirName} to allow for
77
     if (!targetProperties.containsKey('modLibDest')) targetProperties.modLibDest = targetProperties.libDest
69
     // a common name for the hosted build (for use when building apps)
70
@@ -708,7 +716,7 @@ compileTargets { t ->
71
 // at present building on PI is not supported, but we would only need to make
72
 // some changes on assumptions on what should be built (like SWT / Swing) and
73
 // such and we could probably make it work.
74
-if (!IS_MAC && !IS_WINDOWS && !IS_LINUX) logger.error("Unsupported build OS ${OS_NAME}")
75
+if (!IS_MAC && !IS_WINDOWS && !IS_LINUX && !IS_BSD) logger.error("Unsupported build OS ${OS_NAME}")
76
 if (IS_WINDOWS && OS_ARCH != "x86" && OS_ARCH != "amd64") {
77
     throw new Exception("Unknown and unsupported build architecture: $OS_ARCH")
78
 } else if (IS_MAC && OS_ARCH != "x86_64") {
79
@@ -1165,7 +1173,8 @@ allprojects {
80
     // By default all of our projects require junit for testing so we can just
81
     // setup this dependency here.
82
     dependencies {
83
-        testCompile group: "junit", name: "junit", version: "4.8.2"
84
+        testCompile files("/usr/local/share/java/classes/junit4.jar",
85
+                          "/usr/local/share/java/classes/hamcrest.jar")
86
         if (BUILD_CLOSED && DO_JCOV)  {
87
             testCompile name: "jcov"
88
         }
89
@@ -1303,12 +1312,15 @@ project(":graphics") {
90
 
78
 
79
@@ -2067,6 +2075,11 @@ project(":graphics") {
80
     }
81
 
91
     dependencies {
82
     dependencies {
92
         compile project(":base"), BUILD_SRC
93
-        compile name: SWT_FILE_NAME
94
-        stubCompile group: "junit", name: "junit", version: "4.8.2",
95
+        if (IS_BSD) {
83
+        if (IS_BSD) {
96
+             compile files(SWT_FILE_NAME)
84
+             compile files(SWT_FILE_NAME)
97
+	} else {
85
+	} else {
98
+             compile name: SWT_FILE_NAME
86
+             compile name: SWT_FILE_NAME
99
+	}
87
+	}
100
+        stubCompile files("/usr/local/share/java/classes/junit4.jar",
88
         stubCompile group: "junit", name: "junit", version: "4.8.2"
101
+                          "/usr/local/share/java/classes/hamcrest.jar"),
102
         project(":base").sourceSets.test.output, sourceSets.main.output
103
-        antlr3 group: "org.antlr", name: "antlr", version: "3.1.3"
104
-        antlr3 group: "org.antlr", name: "antlr-runtime",  version: "3.1.3"
105
-        antlr3 group: "org.antlr", name: "stringtemplate", version: "3.2"
106
+        antlr3 files("/usr/local/share/java/classes/antlr-3.5.2-complete.jar")
107
     }
108
 
89
 
109
     // Create a single "native" task which will depend on all the individual native tasks for graphics
90
         antlr group: "org.antlr", name: "antlr4", version: "4.7.2", classifier: "complete"
110
@@ -1599,9 +1611,7 @@ project(":graphics") {
91
@@ -2456,7 +2469,7 @@ project(":graphics") {
92
             libsDir.mkdirs();
93
 
94
             def allLibsPresent = true
95
-            def libNames = [ "antlr4-4.7.2-complete.jar" ]
96
+            def libNames = [ "antlr-4.8-complete.jar" ]
97
             libNames.each { name ->
98
                 File f = new File(libsDir, name)
99
                 if (!f.exists()) allLibsPresent = false
100
@@ -2467,7 +2480,7 @@ project(":graphics") {
111
                 copy {
101
                 copy {
112
                     into libsDir
102
                     into libsDir
113
                     from f.getParentFile()
103
                     from f.getParentFile()
114
-                    include "**/antlr-3.1.3.jar"
104
-                    include "**/antlr4-4.7.2-complete.jar"
115
-                    include "**/stringtemplate-3.2.jar"
105
+                    include "**/antlr-4.8-complete.jar"
116
-                    include "**/antlr-runtime-3.1.3.jar"
117
+                    include "**/antlr-3.5.2-complete.jar"
118
                     includeEmptyDirs = false
106
                     includeEmptyDirs = false
119
                 }
107
                 }
120
                 // Have to rename the swt jar because it is some platform specific name but
108
             }
121
@@ -1688,7 +1698,11 @@ project(":swt") {
109
@@ -2602,31 +2615,10 @@ project(":swt") {
122
     }
110
     commonModuleSetup(project, [ 'base', 'graphics' ])
111
 
123
     dependencies {
112
     dependencies {
124
         compile BUILD_SRC, project(":base"), project(":graphics")
125
-        compile name: SWT_FILE_NAME
113
-        compile name: SWT_FILE_NAME
126
+        if (IS_BSD) {
114
-    }
127
+            compile files(SWT_FILE_NAME)
115
-
128
+        } else {
129
+            compile name: SWT_FILE_NAME
130
+        }
131
     }
132
 }
133
 
134
@@ -1794,7 +1808,7 @@ project(":fxpackager") {
135
     }
136
 
137
     dependencies {
138
-        compile group: "org.apache.ant", name: "ant", version: "1.8.2"
139
+        compile files("/usr/local/share/java/apache-ant/lib/ant.jar")
140
     }
141
 
142
     // When producing the jar, we need to relocate a few class files
143
@@ -2055,23 +2069,6 @@ project(":fxpackager") {
144
     jar.dependsOn buildJavaPackager
145
     jar.dependsOn packagerJar
146
 
147
-    classes {
116
-    classes {
148
-        doLast {
117
-        doLast {
149
-            // Copy all of the download libraries to libs directory for the sake of the IDEs
118
-            // Copy all of the download libraries to libs directory for the sake of the IDEs
150
-            File libsDir = rootProject.file("build/libs");
119
-            File libsDir = rootProject.file("build/libs");
151
-            File antLib = new File(libsDir, "ant-1.8.2.jar")
120
-            File swtLib = new File(libsDir, "swt-debug.jar")
152
-            libsDir.mkdirs();
121
-            libsDir.mkdirs();
122
-
123
-            // Skip copy if file is present.
124
-            if (swtLib.exists()) return;
125
-
153
-            for (File f : configurations.compile.files) {
126
-            for (File f : configurations.compile.files) {
127
-                // Have to rename the swt jar because it is some platform specific name but
128
-                // for the sake of the IDEs we need to have a single stable name that works
129
-                // on every platform
154
-                copy {
130
-                copy {
155
-                    into libsDir
131
-                    into libsDir
156
-                    from f.getParentFile()
132
-                    from f.getParentFile()
157
-                    include "**/ant-1.8.2.jar"
133
-                    include "**/*swt*.jar"
158
-                    includeEmptyDirs = false
134
-                    includeEmptyDirs = false
135
-                    rename ".*swt.*jar", "swt-debug\\.jar"
159
-                }
136
-                }
160
-            }
137
-            }
161
-        }
138
+        if (IS_BSD) {
162
-    }
139
+            compile files(SWT_FILE_NAME)
163
-
140
+        } else {
164
     task packagerFakeJar(type: Jar) {
141
+            compile name: SWT_FILE_NAME
165
         dependsOn compileTestJava
142
         }
166
         from compileTestJava.destinationDir
143
     }
167
@@ -2250,7 +2247,7 @@ project(":media") {
168
 
144
 
145
@@ -2809,7 +2801,7 @@ project(":media") {
146
 
169
             doLast {
147
             doLast {
170
                 exec {
148
                 exec {
171
-                    commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/jfxmedia/projects/${projectDir}")
149
-                    commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/jfxmedia/projects/${projectDir}")
Lines 172-242 Link Here
172
+                    commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/jfxmedia/projects/${projectDir}")
150
+                    commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/jfxmedia/projects/${projectDir}")
173
                     args("JAVA_HOME=${JDK_HOME}", "GENERATED_HEADERS_DIR=${generatedHeadersDir}",
151
                     args("JAVA_HOME=${JDK_HOME}", "GENERATED_HEADERS_DIR=${generatedHeadersDir}",
174
                          "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=jfxmedia",
152
                          "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=jfxmedia",
175
                          "COMPILE_PARFAIT=${compileParfait}")
153
                          "COMPILE_PARFAIT=${compileParfait}",
176
@@ -2260,7 +2257,7 @@ project(":media") {
154
@@ -2838,7 +2830,7 @@ project(":media") {
177
                         args(IS_64 ? "ARCH=x64" : "ARCH=x32", "RESOURCE=${nativeOutputDir}/${buildType}/${WIN.media.jfxmediaRcFile}")
178
                     } else {
179
                         args ("CC=${mediaProperties.compiler}", "LINK=${mediaProperties.linker}", "LIB=${mediaProperties.lib}")
180
-                        if (t.name == "linux") {
181
+                        if (t.name == "linux" || t.name == "bsd") {
182
                             args(IS_64 ? "ARCH=x64" : "ARCH=x32")
183
                         }
184
 
185
@@ -2282,7 +2279,7 @@ project(":media") {
186
                 enabled = IS_COMPILE_MEDIA
155
                 enabled = IS_COMPILE_MEDIA
187
                 doLast {
156
                 doLast {
188
                     exec {
157
                     exec {
189
-                        commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/gstreamer-lite")
158
-                        commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/gstreamer-lite")
190
+                        commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/gstreamer-lite")
159
+                        commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/gstreamer-lite")
191
                         args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=gstreamer-lite")
160
                         args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=gstreamer-lite",
161
                              IS_64 ? "ARCH=x64" : "ARCH=x32", "CC=${mediaProperties.compiler}",
162
                              "AR=${mediaProperties.ar}", "LINKER=${mediaProperties.linker}")
163
@@ -2856,7 +2848,7 @@ project(":media") {
192
 
164
 
193
                         if (t.name == "win") {
194
@@ -2290,7 +2287,7 @@ project(":media") {
195
                             args(IS_64 ? "ARCH=x64" : "ARCH=x32", "RESOURCE=${nativeOutputDir}/${buildType}/${WIN.media.gstreamerRcFile}")
196
                         } else {
197
                             args ("CC=${mediaProperties.compiler}", "LINK=${mediaProperties.linker}", "LIB=${mediaProperties.lib}")
198
-                            if (t.name == "linux") {
199
+                            if (t.name == "linux" || t.name == "bsd") {
200
                                 args(IS_64 ? "ARCH=x64" : "ARCH=x32")
201
                             }
202
                         }
203
@@ -2311,7 +2308,7 @@ project(":media") {
204
 
205
                 doLast {
165
                 doLast {
206
                     exec {
166
                     exec {
207
-                        commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/fxplugins")
167
-                        commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/fxplugins")
208
+                        commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/fxplugins")
168
+                        commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/fxplugins")
209
                         args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=fxplugins",
169
                         args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=fxplugins",
210
                              "ON2_SRCDIR=${project.ext.ON2_SRCDIR}", "ON2_LIB=${project.ext.ON2_LIB}")
170
                              IS_64 ? "ARCH=x64" : "ARCH=x32",
171
                              "CC=${mediaProperties.compiler}", "AR=${mediaProperties.ar}", "LINKER=${mediaProperties.linker}")
172
@@ -2879,7 +2871,7 @@ project(":media") {
211
 
173
 
212
@@ -2328,7 +2325,7 @@ project(":media") {
213
                             args(IS_64 ? "ARCH=x64" : "ARCH=x32", "RESOURCE=${nativeOutputDir}/${buildType}/${WIN.media.fxpluginsRcFile}")
214
                         } else {
215
                             args ("CC=${mediaProperties.compiler}", "LINK=${mediaProperties.linker}", "LIB=${mediaProperties.lib}")
216
-                            if (t.name == "linux") {
217
+                            if (t.name == "linux" || t.name == "bsd") {
218
                                 args(IS_64 ? "ARCH=x64" : "ARCH=x32")
219
                             }
220
                         }
221
@@ -2338,7 +2335,7 @@ project(":media") {
222
 
223
             buildNative.dependsOn buildPlugins
174
             buildNative.dependsOn buildPlugins
224
 
175
 
225
-            if (t.name == "linux") {
176
-            if (t.name == "linux") {
226
+            if (t.name == "linux" || t.name == "bsd") {
177
+            if (t.name == "linux" || t.name == "bsd") {
227
                 def buildAVPlugin = task( "buildAVPlugin", dependsOn: [buildPlugins]) {
178
                 // Pre-defined command line arguments
228
                     enabled = IS_COMPILE_MEDIA
179
                 def cfgCMDArgs = ["sh", "configure"]
229
 
180
                 def commonCfgArgs = ["--enable-shared", "--disable-debug", "--disable-static", "--disable-yasm", "--disable-doc", "--disable-programs", "--disable-everything"]
230
@@ -2349,7 +2346,7 @@ project(":media") {
181
@@ -2984,7 +2976,7 @@ project(":media") {
182
                                 }
183
                                 exec {
184
                                     workingDir("$libavDir")
185
-                                    commandLine("make")
186
+                                    commandLine(MAKE_CMD)
187
                                 }
188
                             }
189
                         }
190
@@ -3052,7 +3044,7 @@ project(":media") {
191
                                 }
192
                                 exec {
193
                                     workingDir("$libavDir")
194
-                                    commandLine("make")
195
+                                    commandLine(MAKE_CMD)
196
                                 }
197
                             }
198
                         }
199
@@ -3138,7 +3130,7 @@ project(":media") {
200
                                 }
201
                                 exec {
202
                                     workingDir("$libavDir")
203
-                                    commandLine("make")
204
+                                    commandLine(MAKE_CMD)
205
                                 }
206
                             }
207
                         }
208
@@ -3172,7 +3164,7 @@ project(":media") {
231
                                 File dir = file(libavDir)
209
                                 File dir = file(libavDir)
232
                                 if (dir.exists()) {
210
                                 if (dir.exists()) {
233
                                     exec {
211
                                     exec {
234
-                                        commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/linux/avplugin")
212
-                                        commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/linux/avplugin")
235
+                                        commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${t.name}/avplugin")
213
+                                        commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/linux/avplugin")
236
                                         args("CC=${mediaProperties.compiler}", "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}",
214
                                         args("CC=${mediaProperties.compiler}", "LINKER=${mediaProperties.linker}",
215
                                              "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}",
237
                                              "BASE_NAME=avplugin", "VERSION=${version}", "LIBAV_DIR=${libavDir}",
216
                                              "BASE_NAME=avplugin", "VERSION=${version}", "LIBAV_DIR=${libavDir}",
238
                                              "SUFFIX=", IS_64 ? "ARCH=x64" : "ARCH=x32")
217
@@ -3186,7 +3178,7 @@ project(":media") {
239
@@ -2362,7 +2359,7 @@ project(":media") {
240
                                 File dir = file(libavDir)
218
                                 File dir = file(libavDir)
241
                                 if (dir.exists()) {
219
                                 if (dir.exists()) {
242
                                     exec {
220
                                     exec {
Lines 245-260 Link Here
245
                                         args("CC=${mediaProperties.compiler}", "LINKER=${mediaProperties.linker}",
223
                                         args("CC=${mediaProperties.compiler}", "LINKER=${mediaProperties.linker}",
246
                                              "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}",
224
                                              "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}",
247
                                              "BASE_NAME=avplugin", "VERSION=${version}", "LIBAV_DIR=${libavDir}",
225
                                              "BASE_NAME=avplugin", "VERSION=${version}", "LIBAV_DIR=${libavDir}",
248
@@ -2373,7 +2370,7 @@ project(":media") {
226
@@ -3200,7 +3192,7 @@ project(":media") {
227
                                 File dir = file(libavDir)
228
                                 if (dir.exists()) {
229
                                     exec {
230
-                                        commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/linux/avplugin")
231
+                                        commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/linux/avplugin")
232
                                         args("CC=${mediaProperties.compiler}", "LINKER=${mediaProperties.linker}",
233
                                              "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}",
234
                                              "BASE_NAME=avplugin", "VERSION=${version}", "LIBAV_DIR=${libavDir}",
235
@@ -3211,7 +3203,7 @@ project(":media") {
249
                         } else {
236
                         } else {
250
                             // Building fxavcodec plugin (libav plugin)
237
                             // Building fxavcodec plugin (libav plugin)
251
                             exec {
238
                             exec {
252
-                                commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/linux/avplugin")
239
-                                commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/linux/avplugin")
253
+                                commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${t.name}/avplugin")
240
+                                commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/linux/avplugin")
254
                                 args("CC=${mediaProperties.compiler}", "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}",
241
                                 args("CC=${mediaProperties.compiler}", "LINKER=${mediaProperties.linker}",
242
                                      "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}",
255
                                      "BASE_NAME=avplugin", IS_64 ? "ARCH=x64" : "ARCH=x32")
243
                                      "BASE_NAME=avplugin", IS_64 ? "ARCH=x64" : "ARCH=x32")
256
                             }
244
@@ -3262,7 +3254,7 @@ project(":media") {
257
@@ -2423,7 +2420,7 @@ project(":media") {
258
                     doLast {
245
                     doLast {
259
                         exec {
246
                         exec {
260
                             environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
247
                             environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
Lines 261-278 Link Here
261
-                            commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/glib-lite")
248
-                            commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/glib-lite")
262
+                            commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/glib-lite")
249
+                            commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/glib-lite")
263
                             args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=glib-lite",
250
                             args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=glib-lite",
264
                                  IS_64 ? "ARCH=x64" : "ARCH=x32", "RESOURCE=${nativeOutputDir}/${buildType}/${WIN.media.glibRcFile}")
251
                                  IS_64 ? "ARCH=x64" : "ARCH=x32", "RESOURCE=${nativeOutputDir}/${buildType}/${WIN.media.glibRcFile}",
252
                                  "CC=${mediaProperties.compiler}", "AR=${mediaProperties.ar}", "LINKER=${mediaProperties.linker}")
253
@@ -3282,7 +3274,7 @@ project(":media") {
265
                         }
254
                         }
266
@@ -2442,7 +2439,7 @@ project(":media") {
267
                         }
268
 
255
 
269
                         exec {
256
                         exec {
270
-                            commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/glib-lite")
257
-                            commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/glib-lite")
271
+                            commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/glib-lite")
258
+                            commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/glib-lite")
272
                             args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=glib-lite")
259
                             args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=glib-lite")
273
                             args ("CC=${mediaProperties.compiler}", "LINK=${mediaProperties.linker}", "LIB=${mediaProperties.lib}")
260
                             args ("CC=${mediaProperties.compiler}", "LINKER=${mediaProperties.linker}")
274
                         }
261
                         }
275
@@ -2562,7 +2559,7 @@ project(":web") {
262
@@ -3407,7 +3399,7 @@ project(":web") {
276
     compileTargets { t ->
263
     compileTargets { t ->
277
         def targetProperties = project.rootProject.ext[t.upper]
264
         def targetProperties = project.rootProject.ext[t.upper]
278
         def webkitProperties = targetProperties.webkit
265
         def webkitProperties = targetProperties.webkit
Lines 281-337 Link Here
281
                           IS_64 ? "${t.name}-amd64" : "${t.name}-i586"
268
                           IS_64 ? "${t.name}-amd64" : "${t.name}-i586"
282
 
269
 
283
         def webkitOutputDir = cygpath("$buildDir/${t.name}")
270
         def webkitOutputDir = cygpath("$buildDir/${t.name}")
284
@@ -2638,6 +2635,9 @@ project(":web") {
271
@@ -3436,8 +3428,12 @@ project(":web") {
272
                         environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
273
                     } else if (t.name == "mac") {
274
                         cmakeArgs = " $cmakeArgs -DCMAKE_OSX_DEPLOYMENT_TARGET=$MACOSX_MIN_VERSION -DCMAKE_OSX_SYSROOT=$MACOSX_SDK_PATH"
275
-                    } else if (t.name == "linux") {
276
-                        cmakeArgs = " $cmakeArgs -DCMAKE_SYSTEM_NAME=Linux"
277
+                    } else if (t.name == "linux" || t.name == "bsd") {
278
+                        if (t.name == "linux") {
279
+                            cmakeArgs = " $cmakeArgs -DCMAKE_SYSTEM_NAME=Linux"
280
+                        } else {
281
+                            cmakeArgs = " $cmakeArgs -DCMAKE_SYSTEM_NAME=FreeBSD"
282
+                        }
283
                         if (IS_64) {
284
                             cmakeArgs = "$cmakeArgs -DCMAKE_SYSTEM_PROCESSOR=x86_64"
285
                         } else {
286
@@ -3479,6 +3475,10 @@ project(":web") {
287
                         targetCpuBitDepthSwitch = "--32-bit"
285
                     }
288
                     }
286
 
289
                     cmakeArgs += " -DJAVAFX_RELEASE_VERSION=${jfxReleaseMajorVersion}"
287
                     cmakeArgs += " -DJAVAFX_RELEASE_VERSION=8.0"
288
+                    cmakeArgs += " -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
290
+                    cmakeArgs += " -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
289
+                    cmakeArgs += " -DCMAKE_C_COMPILER:STRING=${System.getenv("CC")}"
291
+                    cmakeArgs += " -DCMAKE_C_COMPILER:STRING=${System.getenv("CC")}"
290
+                    cmakeArgs += " -DCMAKE_CXX_COMPILER:STRING=${System.getenv("CXX")}"
292
+                    cmakeArgs += " -DCMAKE_CXX_COMPILER:STRING=${System.getenv("CXX")}"
293
+
291
                     commandLine("perl", "$projectDir/src/main/native/Tools/Scripts/build-webkit",
294
                     commandLine("perl", "$projectDir/src/main/native/Tools/Scripts/build-webkit",
292
                         "--java", "--icu-unicode", targetCpuBitDepthSwitch,
295
                         "--java", "--icu-unicode", targetCpuBitDepthSwitch,
293
                         "--cmakeargs=${cmakeArgs}")
296
                         "--no-experimental-features", "--cmakeargs=${cmakeArgs}")
294
@@ -3132,7 +3132,7 @@ compileTargets { t ->
297
@@ -4928,7 +4928,7 @@ compileTargets { t ->
295
                         // OSX media natives
298
                     // OSX media natives
296
                         [ "jfxmedia_qtkit", "jfxmedia_avf" ].each { name ->
299
                     [ "jfxmedia_qtkit", "jfxmedia_avf", "glib-lite" ].each { name ->
297
                             from ("modules/media/build/native/${t.name}/${mediaBuildType}/${library(name)}") }
300
                         from ("${mediaProject.buildDir}/native/${t.name}/${mediaBuildType}/${library(name)}") }
298
-                    } else if (t.name == "linux") {
301
-                } else if (t.name == "linux") {
299
+                    } else if (t.name == "linux" || t.name == "bsd") {
302
+                } else if (t.name == "linux" || t.name == "bsd") {
300
                         from("modules/media/build/native/${t.name}/${mediaBuildType}") { include "libavplugin*.so" }
303
                     from("${mediaProject.buildDir}/native/${t.name}/${mediaBuildType}") { include "libavplugin*.so" }
301
                     }
304
                 } else from ("${mediaProject.buildDir}/native/${t.name}/${mediaBuildType}/${library("glib-lite")}")
302
                 } else {
305
             } else {
303
@@ -3145,7 +3145,7 @@ compileTargets { t ->
306
@@ -4941,7 +4941,7 @@ compileTargets { t ->
304
                         // copy libjfxmedia_{avf,qtkit}.dylib if they exist
307
                     // copy libjfxmedia_{avf,qtkit}.dylib if they exist
305
                         [ "jfxmedia_qtkit", "jfxmedia_avf" ].each { name ->
308
                     [ "jfxmedia_qtkit", "jfxmedia_avf", "glib-lite" ].each { name ->
306
                             from ("$LIBRARY_STUB/${library(name)}") }
309
                         from ("$MEDIA_STUB/${library(name)}") }
307
-                    } else if (t.name == "linux") {
310
-                } else if (t.name == "linux") {
308
+                    } else if (t.name == "linux" || t.name == "bsd") {
311
+                } else if (t.name == "linux" || t.name == "bsd") {
309
                         from(LIBRARY_STUB) { include "libavplugin*.so" }
312
                     from(MEDIA_STUB) { include "libavplugin*.so" }
310
                     }
311
                 }
313
                 }
312
@@ -3207,7 +3207,7 @@ compileTargets { t ->
314
                 else if (t.name != "android"  && t.name != "dalvik" ) {
313
             }
314
 
315
             // Copy over the javapackager executable
316
-            if (t.name == "win" || t.name == "linux" || t.name == "mac") {
317
+            if (t.name == "win" || t.name == "linux" || t.name == "bsd" || t.name == "mac") {
318
                 copy {
319
                     from "modules/fxpackager/build/javapackager"
320
                     into "build/${sdkDirName}/bin"
321
@@ -3264,6 +3264,7 @@ ext.JFXRT_CP =
322
             "modules/web/build/classes/java/main",
323
     )
324
 
325
+/*
326
 project(":apps") {
327
     // The apps build is Ant based, and gradle lets us "import" ant build.xml
328
     // into our configuration.
329
@@ -3341,7 +3342,7 @@ project(":apps") {
330
         }
331
         rootProject.clean.dependsOn(appsClean)
332
     }
333
-}
334
+} */
335
 
336
 /******************************************************************************
337
  *                                                                            *
(-)java/openjfx14/files/patch-buildSrc_bsd.gradle (+332 lines)
Line 0 Link Here
1
--- buildSrc/bsd.gradle.orig	2020-07-21 10:33:26 UTC
2
+++ buildSrc/bsd.gradle
3
@@ -0,0 +1,329 @@
4
+/*
5
+ * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
6
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7
+ *
8
+ * This code is free software; you can redistribute it and/or modify it
9
+ * under the terms of the GNU General Public License version 2 only, as
10
+ * published by the Free Software Foundation.  Oracle designates this
11
+ * particular file as subject to the "Classpath" exception as provided
12
+ * by Oracle in the LICENSE file that accompanied this code.
13
+ *
14
+ * This code is distributed in the hope that it will be useful, but WITHOUT
15
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
17
+ * version 2 for more details (a copy is included in the LICENSE file that
18
+ * accompanied this code).
19
+ *
20
+ * You should have received a copy of the GNU General Public License version
21
+ * 2 along with this work; if not, write to the Free Software Foundation,
22
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
23
+ *
24
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
25
+ * or visit www.oracle.com if you need additional information or have any
26
+ * questions.
27
+ */
28
+
29
+ext.BSD = [:]
30
+
31
+// Declare whether this particular target file applies to the current system
32
+BSD.canBuild = IS_BSD;
33
+if (!BSD.canBuild) return;
34
+
35
+// All desktop related packages should be built
36
+BSD.compileSwing = true;
37
+BSD.compileSWT = true;
38
+
39
+// Libraries end up in the lib/$OS_ARCH directory for Linux
40
+BSD.libDest = "lib"
41
+
42
+// Lambda for naming the generated libs
43
+BSD.library = { name -> return (IS_STATIC_BUILD ? "lib${name}.a" : "lib${name}.so") as String }
44
+
45
+// A set of common parameters to use for both compiling and linking
46
+def commonFlags = [
47
+        "-fno-strict-aliasing", "-fPIC", "-fno-omit-frame-pointer", // optimization flags
48
+        "-fstack-protector",
49
+        "-Wextra", "-Wall", "-Wformat-security", "-Wno-unused", "-Wno-parentheses"] // warning flags
50
+
51
+if (!IS_64) {
52
+    commonFlags += "-m32"
53
+}
54
+
55
+if (IS_STATIC_BUILD) {
56
+    commonFlags += "-DSTATIC_BUILD"
57
+}
58
+
59
+// Specify the compilation parameters and link parameters
60
+def ccFlags = [
61
+        commonFlags, "-I$JDK_HOME/include", "-I$JDK_HOME/include/freebsd", "-c",
62
+        "-ffunction-sections", "-fdata-sections",
63
+        IS_DEBUG_NATIVE ? ["-ggdb", "-DVERBOSE"] : ["-O2", "-DNDEBUG"]].flatten()
64
+def ccFlagsGTK3 = ccFlags
65
+//ccFlags.addAll(["-Wnon-virtual-dtor", "-Woverloaded-virtual", "-std=c++0x"])
66
+def dynamicLinkFlags = [ "-shared", commonFlags,
67
+                 "-z", "relro",
68
+                 "-Wl,--gc-sections"].flatten()
69
+
70
+def staticLinkFlags = [].flatten()
71
+
72
+def linkFlags = IS_STATIC_BUILD ? staticLinkFlags : dynamicLinkFlags;
73
+
74
+if (IS_DEBUG_NATIVE) {
75
+    linkFlags += "-g"
76
+}
77
+
78
+def toolchainDir
79
+if (hasProperty('toolchainDir')) {
80
+    toolchainDir = ext.toolchainDir + "/"
81
+} else {
82
+    toolchainDir = ""
83
+}
84
+
85
+def gtk2CCFlags = [  ];
86
+def gtk3CCFlags = [ "-Wno-deprecated-declarations" ];
87
+def gtk2LinkFlags = [ ];
88
+def gtk3LinkFlags = [ ];
89
+
90
+// Create $buildDir/freebsd_tools.properties file and load props from it
91
+setupTools("bsd_gtk2",
92
+    { propFile ->
93
+        ByteArrayOutputStream results1 = new ByteArrayOutputStream();
94
+        exec {
95
+            commandLine("${toolchainDir}pkg-config", "--cflags", "gtk+-2.0", "gthread-2.0", "xtst")
96
+            setStandardOutput(results1);
97
+        }
98
+        propFile << "cflagsGTK2=" << results1.toString().trim() << "\n";
99
+
100
+        ByteArrayOutputStream results3 = new ByteArrayOutputStream();
101
+        exec {
102
+            commandLine("${toolchainDir}pkg-config", "--libs", "gtk+-2.0", "gthread-2.0", "xtst")
103
+            setStandardOutput(results3);
104
+        }
105
+        propFile << "libsGTK2=" << results3.toString().trim()  << "\n";
106
+    },
107
+    { properties ->
108
+        def cflagsGTK2 = properties.getProperty("cflagsGTK2")
109
+        def libsGTK2 = properties.getProperty("libsGTK2")
110
+        if (cflagsGTK2 && libsGTK2) {
111
+            gtk2CCFlags.addAll(cflagsGTK2.split(" "))
112
+            gtk2LinkFlags.addAll(libsGTK2.split(" "))
113
+        } else {
114
+            throw new IllegalStateException("GTK2 development packages not found. If GTK2 packages are installed, please remove the build directory and try again.")
115
+        }
116
+    }
117
+)
118
+
119
+setupTools("bsd_gtk3",
120
+    { propFile ->
121
+        ByteArrayOutputStream results2 = new ByteArrayOutputStream();
122
+        exec {
123
+            commandLine("${toolchainDir}pkg-config", "--cflags", "gtk+-3.0", "gthread-2.0", "xtst")
124
+            setStandardOutput(results2);
125
+        }
126
+        propFile << "cflagsGTK3=" << results2.toString().trim() << "\n";
127
+
128
+        ByteArrayOutputStream results4 = new ByteArrayOutputStream();
129
+        exec {
130
+            commandLine("${toolchainDir}pkg-config", "--libs", "gtk+-3.0", "gthread-2.0", "xtst")
131
+            setStandardOutput(results4);
132
+        }
133
+        propFile << "libsGTK3=" << results4.toString().trim()  << "\n";
134
+
135
+    },
136
+    { properties ->
137
+        def cflagsGTK3 = properties.getProperty("cflagsGTK3")
138
+        def libsGTK3 = properties.getProperty("libsGTK3")
139
+        if (cflagsGTK3 && libsGTK3) {
140
+            gtk3CCFlags.addAll(cflagsGTK3.split(" "))
141
+            gtk3LinkFlags.addAll(libsGTK3.split(" "))
142
+        } else {
143
+            throw new IllegalStateException("GTK3 development packages not found. If GTK3 packages are installed, please remove the build directory and try again.")
144
+        }
145
+    }
146
+)
147
+
148
+def pangoCCFlags = ["-D_ENABLE_PANGO"];
149
+def pangoLinkFlags = [];
150
+setupTools("bsd_pango_tools",
151
+    { propFile ->
152
+        ByteArrayOutputStream results = new ByteArrayOutputStream();
153
+        exec {
154
+            commandLine "${toolchainDir}pkg-config", "--cflags", "pangoft2"
155
+            standardOutput = results
156
+        }
157
+        propFile << "cflags=" << results.toString().trim() << "\n";
158
+
159
+        results = new ByteArrayOutputStream();
160
+        exec {
161
+            commandLine "${toolchainDir}pkg-config", "--libs", "pangoft2"
162
+            standardOutput = results
163
+        }
164
+        propFile << "libs=" << results.toString().trim();
165
+    },
166
+    { properties ->
167
+        def cflags = properties.getProperty("cflags")
168
+        def libs = properties.getProperty("libs")
169
+        if (cflags && libs) {
170
+            pangoCCFlags.addAll(cflags.split(" "))
171
+            pangoLinkFlags.addAll(libs.split(" "))
172
+        } else {
173
+            throw new IllegalStateException("Linux pango packages not found.\nIf pango packages are installed, please remove the build directory and try again.")
174
+        }
175
+    }
176
+)
177
+
178
+def freetypeCCFlags = [ext.IS_COMPILE_PANGO ? "-D_ENABLE_PANGO" :
179
+                       ext.IS_COMPILE_HARFBUZZ ? "-D_ENABLE_HARFBUZZ" : ""]
180
+def freetypeLinkFlags = []
181
+setupTools("bsd_freetype_tools",
182
+    { propFile ->
183
+        ByteArrayOutputStream results = new ByteArrayOutputStream();
184
+        exec {
185
+            commandLine "${toolchainDir}pkg-config", "--cflags", "freetype2"
186
+            standardOutput = results
187
+        }
188
+        propFile << "cflags=" << results.toString().trim() << "\n";
189
+
190
+        results = new ByteArrayOutputStream();
191
+        exec {
192
+            commandLine "${toolchainDir}pkg-config", "--libs", "freetype2"
193
+            standardOutput = results
194
+        }
195
+        propFile << "libs=" << results.toString().trim();
196
+    },
197
+    { properties ->
198
+        def cflags = properties.getProperty("cflags")
199
+        def libs = properties.getProperty("libs")
200
+        if (cflags && libs) {
201
+            freetypeCCFlags.addAll(cflags.split(" "))
202
+            if (!IS_STATIC_BUILD) {
203
+                freetypeLinkFlags.addAll(libs.split(" "))
204
+            }
205
+        } else {
206
+            throw new IllegalStateException("Linux freetype packages not found.\nIf freetype pacakges are installed, please remove the build directory and try again.")
207
+        }
208
+    }
209
+)
210
+
211
+def compiler = IS_COMPILE_PARFAIT ? "parfait-gcc" : "${toolchainDir}gcc";
212
+def linker = IS_STATIC_BUILD ? "ar" : IS_COMPILE_PARFAIT ? "parfait-g++" : "${toolchainDir}g++";
213
+
214
+BSD.glass = [:]
215
+BSD.glass.variants = ["glass", "glassgtk2", "glassgtk3"]
216
+
217
+FileTree ft_gtk_launcher = fileTree("${project(":graphics").projectDir}/src/main/native-glass/gtk/") {
218
+    include("**/launcher.c")
219
+}
220
+
221
+FileTree ft_gtk = fileTree("${project(":graphics").projectDir}/src/main/native-glass/gtk/") {
222
+    exclude("**/launcher.c")
223
+}
224
+
225
+BSD.glass.glass = [:]
226
+BSD.glass.glass.nativeSource = ft_gtk_launcher.getFiles()
227
+BSD.glass.glass.compiler = compiler
228
+BSD.glass.glass.ccFlags = [ccFlags].flatten()
229
+BSD.glass.glass.linker = linker
230
+BSD.glass.glass.linkFlags = IS_STATIC_BUILD? linkFlags : [linkFlags, "-lX11", "-ldl"].flatten()
231
+BSD.glass.glass.lib = "glass"
232
+
233
+BSD.glass.glassgtk2 = [:]
234
+BSD.glass.glassgtk2.nativeSource =  ft_gtk.getFiles()
235
+BSD.glass.glassgtk2.compiler = compiler
236
+BSD.glass.glassgtk2.ccFlags = IS_STATIC_BUILD ?
237
+        ["-fno-threadsafe-statics", ccFlags, gtk2CCFlags].flatten() :
238
+        [ccFlags, gtk2CCFlags].flatten()
239
+BSD.glass.glassgtk2.linker = linker
240
+BSD.glass.glassgtk2.linkFlags = IS_STATIC_BUILD ? linkFlags : [linkFlags, gtk2LinkFlags].flatten()
241
+BSD.glass.glassgtk2.lib = "glassgtk2"
242
+
243
+BSD.glass.glassgtk3 = [:]
244
+BSD.glass.glassgtk3.nativeSource =  ft_gtk.getFiles()
245
+BSD.glass.glassgtk3.compiler = compiler
246
+BSD.glass.glassgtk3.ccFlags = IS_STATIC_BUILD ?
247
+        ["-fno-threadsafe-statics", ccFlags, gtk3CCFlags].flatten() :
248
+        [ccFlags, gtk3CCFlags].flatten()
249
+BSD.glass.glassgtk3.linker = linker
250
+BSD.glass.glassgtk3.linkFlags = IS_STATIC_BUILD ? linkFlags : [linkFlags, gtk3LinkFlags].flatten()
251
+BSD.glass.glassgtk3.lib = "glassgtk3"
252
+
253
+BSD.decora = [:]
254
+BSD.decora.compiler = compiler
255
+BSD.decora.ccFlags = [ccFlags, "-ffast-math"].flatten()
256
+BSD.decora.linker = linker
257
+BSD.decora.linkFlags = [linkFlags].flatten()
258
+BSD.decora.lib = "decora_sse"
259
+
260
+BSD.prism = [:]
261
+BSD.prism.nativeSource = file("${project(":graphics").projectDir}/src/main/native-prism")
262
+BSD.prism.compiler = compiler
263
+BSD.prism.ccFlags = [ccFlags, "-DINLINE=inline"].flatten()
264
+BSD.prism.linker = linker
265
+BSD.prism.linkFlags = [linkFlags].flatten()
266
+BSD.prism.lib = "prism_common"
267
+
268
+BSD.prismSW = [:]
269
+BSD.prismSW.nativeSource = file("${project(":graphics").projectDir}/src/main/native-prism-sw")
270
+BSD.prismSW.compiler = compiler
271
+BSD.prismSW.ccFlags = [ccFlags, "-DINLINE=inline"].flatten()
272
+BSD.prismSW.linker = linker
273
+BSD.prismSW.linkFlags = [linkFlags].flatten()
274
+BSD.prismSW.lib = "prism_sw"
275
+
276
+BSD.iio = [:]
277
+BSD.iio.nativeSource = [
278
+    file("${project("graphics").projectDir}/src/main/native-iio"),
279
+    file("${project("graphics").projectDir}/src/main/native-iio/libjpeg")]
280
+BSD.iio.compiler = compiler
281
+BSD.iio.ccFlags = [ccFlags].flatten()
282
+BSD.iio.linker = linker
283
+BSD.iio.linkFlags = [linkFlags].flatten()
284
+BSD.iio.lib = "javafx_iio"
285
+
286
+BSD.prismES2 = [:]
287
+BSD.prismES2.nativeSource = [
288
+    file("${project("graphics").projectDir}/src/main/native-prism-es2"),
289
+    file("${project("graphics").projectDir}/src/main/native-prism-es2/GL"),
290
+    file("${project("graphics").projectDir}/src/main/native-prism-es2/x11")
291
+]
292
+BSD.prismES2.compiler = compiler
293
+BSD.prismES2.ccFlags = ["-DFREEBSD", ccFlags].flatten()
294
+BSD.prismES2.linker = linker
295
+BSD.prismES2.linkFlags =IS_STATIC_BUILD ? linkFlags : [linkFlags, "-lX11", "-lXxf86vm", "-lGL"].flatten()
296
+BSD.prismES2.lib = "prism_es2"
297
+
298
+def closedDir = file("$projectDir/../rt-closed")
299
+BSD.font = [:]
300
+BSD.font.compiler = compiler
301
+BSD.font.nativeSource = [file("${project("graphics").projectDir}/src/main/native-font")]
302
+BSD.font.ccFlags = ["-DJFXFONT_PLUS", ccFlags].flatten()
303
+BSD.font.linker = linker
304
+BSD.font.linkFlags = [linkFlags].flatten()
305
+BSD.font.lib = "javafx_font"
306
+
307
+BSD.fontFreetype = [:]
308
+BSD.fontFreetype.nativeSource = ["src/main/native-font/freetype.c"]
309
+BSD.fontFreetype.compiler = compiler
310
+BSD.fontFreetype.ccFlags = ["-DJFXFONT_PLUS", ccFlags, freetypeCCFlags].flatten()
311
+BSD.fontFreetype.linker = linker
312
+BSD.fontFreetype.linkFlags = IS_STATIC_BUILD ? linkFlags : [linkFlags, freetypeLinkFlags].flatten()
313
+BSD.fontFreetype.lib = "javafx_font_freetype"
314
+
315
+BSD.fontPango = [:]
316
+BSD.fontPango.nativeSource = ["src/main/native-font/pango.c"]
317
+BSD.fontPango.compiler = compiler
318
+BSD.fontPango.ccFlags = ["-DJFXFONT_PLUS", ccFlags, pangoCCFlags].flatten()
319
+BSD.fontPango.linker = linker
320
+BSD.fontPango.linkFlags =IS_STATIC_BUILD ? linkFlags : [linkFlags, pangoLinkFlags].flatten()
321
+BSD.fontPango.lib = "javafx_font_pango"
322
+
323
+BSD.media = [:]
324
+BSD.media.compiler = compiler
325
+BSD.media.linker = linker
326
+BSD.media.ar = "${toolchainDir}ar"
327
+
328
+BSD.webkit = [:]
329
+BSD.webkit.compiler = compiler
330
+BSD.webkit.linker = linker
331
+BSD.webkit.ccFlags = commonFlags.flatten()
332
+BSD.webkit.linkFlags = linkFlags.flatten()
(-)java/openjfx14/files/patch-modules_javafx.base_src_main_java_com_sun_javafx_PlatformUtil.java (+37 lines)
Line 0 Link Here
1
--- modules/javafx.base/src/main/java/com/sun/javafx/PlatformUtil.java.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.base/src/main/java/com/sun/javafx/PlatformUtil.java
3
@@ -69,6 +69,7 @@ public class PlatformUtil {
4
     private static final boolean WINDOWS_7_OR_LATER = WINDOWS && versionNumberGreaterThanOrEqualTo(6.1f);
5
     private static final boolean MAC = os.startsWith("Mac");
6
     private static final boolean LINUX = os.startsWith("Linux") && !ANDROID;
7
+    private static final boolean FREEBSD = os.startsWith("FreeBSD");
8
     private static final boolean SOLARIS = os.startsWith("SunOS");
9
     private static final boolean IOS = os.startsWith("iOS");
10
 
11
@@ -124,6 +125,13 @@ public class PlatformUtil {
12
         return LINUX;
13
     }
14
 
15
+    /**
16
+     * Returns true if the operating system is a form of FreeBSD.
17
+     */
18
+    public static boolean isFreeBSD(){
19
+        return FREEBSD;
20
+    }
21
+
22
     public static boolean useEGL() {
23
         return useEGL;
24
     }
25
@@ -150,10 +158,10 @@ public class PlatformUtil {
26
     }
27
 
28
     /**
29
-     * Returns true if the operating system is a form of Linux or Solaris
30
+     * Returns true if the operating system is a form of Unix
31
      */
32
     public static boolean isUnix(){
33
-        return LINUX || SOLARIS;
34
+        return LINUX || SOLARIS || FREEBSD;
35
     }
36
 
37
     /**
(-)java/openjfx14/files/patch-modules_javafx.controls_src_main_java_com_sun_javafx_scene_TextInputControlBehavior.java (+36 lines)
Line 0 Link Here
1
--- modules/javafx.controls/src/main/java/com/sun/javafx/scene/control/behavior/TextInputControlBehavior.java.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.controls/src/main/java/com/sun/javafx/scene/control/behavior/TextInputControlBehavior.java
3
@@ -54,6 +54,7 @@ import javafx.scene.input.MouseEvent;
4
 import java.text.Bidi;
5
 import java.util.function.Predicate;
6
 
7
+import static com.sun.javafx.PlatformUtil.isFreeBSD;
8
 import static com.sun.javafx.PlatformUtil.isLinux;
9
 import static com.sun.javafx.PlatformUtil.isMac;
10
 import static com.sun.javafx.PlatformUtil.isWindows;
11
@@ -122,6 +123,7 @@ public abstract class TextInputControlBehavior<T exten
12
         final Predicate<KeyEvent> validWhenEditable = e -> !c.isEditable();
13
         final Predicate<KeyEvent> validOnWindows = e -> !PlatformUtil.isWindows();
14
         final Predicate<KeyEvent> validOnLinux = e -> !PlatformUtil.isLinux();
15
+        final Predicate<KeyEvent> validOnFreeBSD = e -> !PlatformUtil.isFreeBSD();
16
 
17
         KeyMapping cancelEditMapping;
18
         KeyMapping fireMapping;
19
@@ -550,7 +552,7 @@ public abstract class TextInputControlBehavior<T exten
20
 
21
     public void selectNextWord() {
22
         TextInputControl textInputControl = getNode();
23
-        if (isMac() || isLinux()) {
24
+        if (isMac() || isLinux() || isFreeBSD()) {
25
             textInputControl.selectEndOfNextWord();
26
         } else {
27
             textInputControl.selectNextWord();
28
@@ -599,7 +601,7 @@ public abstract class TextInputControlBehavior<T exten
29
 
30
     protected void nextWord() {
31
         TextInputControl textInputControl = getNode();
32
-        if (isMac() || isLinux()) {
33
+        if (isMac() || isLinux() || isFreeBSD()) {
34
             textInputControl.endOfNextWord();
35
         } else {
36
             textInputControl.nextWord();
(-)java/openjfx14/files/patch-modules_javafx.graphics_src_main_java_com_sun_glass_ui_Platform.java (+20 lines)
Line 0 Link Here
1
--- modules/javafx.graphics/src/main/java/com/sun/glass/ui/Platform.java.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.graphics/src/main/java/com/sun/glass/ui/Platform.java
3
@@ -52,6 +52,8 @@ final class Platform {
4
                    type = WINDOWS;
5
                 else if (userPlatform.equals("linux"))
6
                    type = GTK;
7
+                else if (userPlatform.equals("freebsd"))
8
+                    type = GTK;
9
                 else if (userPlatform.equals("gtk"))
10
                    type = GTK;
11
                 else if (userPlatform.equals("ios"))
12
@@ -68,6 +70,8 @@ final class Platform {
13
             } else if (osNameLowerCase.startsWith("wind")) {
14
                 type = WINDOWS;
15
             } else if (osNameLowerCase.startsWith("linux")) {
16
+                type = GTK;
17
+            } else if (osNameLowerCase.startsWith("freebsd")) {
18
                 type = GTK;
19
             } else if (osNameLowerCase.startsWith("ios")) {
20
                 type = IOS;
(-)java/openjfx14/files/patch-modules_javafx.graphics_src_main_java_com_sun_glass_utils_NativeLibLoader.java (+20 lines)
Line 0 Link Here
1
--- modules/javafx.graphics/src/main/java/com/sun/glass/utils/NativeLibLoader.java.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.graphics/src/main/java/com/sun/glass/utils/NativeLibLoader.java
3
@@ -358,7 +358,7 @@ public class NativeLibLoader {
4
                     relativeDir = "../bin";
5
                 } else if (osName.startsWith("Mac")) {
6
                     relativeDir = ".";
7
-                } else if (osName.startsWith("Linux")) {
8
+                } else if (osName.startsWith("Linux") || osName.startsWith("FreeBSD")) {
9
                     relativeDir = ".";
10
                 }
11
 
12
@@ -374,7 +374,7 @@ public class NativeLibLoader {
13
                 } else if (osName.startsWith("Mac")) {
14
                     libPrefix = "lib";
15
                     libSuffix = ".dylib";
16
-                } else if (osName.startsWith("Linux")) {
17
+                } else if (osName.startsWith("Linux") || osName.startsWith("FreeBSD")) {
18
                     libPrefix = "lib";
19
                     libSuffix = ".so";
20
                 }
(-)java/openjfx14/files/patch-modules_javafx.graphics_src_main_java_com_sun_javafx_font_LogicalFont.java (+11 lines)
Line 0 Link Here
1
--- modules/javafx.graphics/src/main/java/com/sun/javafx/font/LogicalFont.java.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.graphics/src/main/java/com/sun/javafx/font/LogicalFont.java
3
@@ -175,7 +175,7 @@ public class LogicalFont implements CompositeFontResou
4
             styleName = STYLE_BOLD_ITALIC;
5
         }
6
         fullName = familyName + " " + styleName;
7
-        if (PrismFontFactory.isLinux) {
8
+        if (PrismFontFactory.isLinux || PrismFontFactory.isFreeBSD) {
9
             FontConfigManager.FcCompFont fcCompFont =
10
                 FontConfigManager.getFontConfigFont(family, bold, italic);
11
             physicalFullName = fcCompFont.firstFont.fullName;
(-)java/openjfx14/files/patch-modules_javafx.graphics_src_main_java_com_sun_javafx_font_PrismFontFactory.java (+45 lines)
Line 0 Link Here
1
--- modules/javafx.graphics/src/main/java/com/sun/javafx/font/PrismFontFactory.java.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.graphics/src/main/java/com/sun/javafx/font/PrismFontFactory.java
3
@@ -51,6 +51,7 @@ public abstract class PrismFontFactory implements Font
4
     public static final boolean debugFonts;
5
     public static final boolean isWindows;
6
     public static final boolean isLinux;
7
+    public static final boolean isFreeBSD;
8
     public static final boolean isMacOSX;
9
     public static final boolean isIOS;
10
     public static final boolean isAndroid;
11
@@ -88,6 +89,7 @@ public abstract class PrismFontFactory implements Font
12
         isWindows = PlatformUtil.isWindows();
13
         isMacOSX  = PlatformUtil.isMac();
14
         isLinux   = PlatformUtil.isLinux();
15
+        isFreeBSD = PlatformUtil.isFreeBSD();
16
         isIOS     = PlatformUtil.isIOS();
17
         isAndroid = PlatformUtil.isAndroid();
18
         isEmbedded = PlatformUtil.isEmbedded();
19
@@ -164,7 +166,7 @@ public abstract class PrismFontFactory implements Font
20
     private static String getNativeFactoryName() {
21
         if (isWindows) return DW_FACTORY;
22
         if (isMacOSX || isIOS) return CT_FACTORY;
23
-        if (isLinux || isAndroid) return FT_FACTORY;
24
+        if (isLinux || isAndroid || isFreeBSD) return FT_FACTORY;
25
         return null;
26
     }
27
 
28
@@ -851,7 +853,7 @@ public abstract class PrismFontFactory implements Font
29
                         break;
30
                     }
31
                 }
32
-                if (fontResource == null && isLinux) {
33
+                if (fontResource == null && (isLinux || isFreeBSD)) {
34
                     String path = FontConfigManager.getDefaultFontPath();
35
                     if (path != null) {
36
                         fontResource = createFontResource(jreDefaultFontLC,
37
@@ -1770,7 +1772,7 @@ public abstract class PrismFontFactory implements Font
38
                                                       familyToFontListMap,
39
                                                       Locale.ENGLISH);
40
 
41
-            } else if (isLinux) {
42
+            } else if (isLinux || isFreeBSD) {
43
                 FontConfigManager.populateMaps(tmpFontToFileMap,
44
                                                fontToFamilyNameMap,
45
                                                familyToFontListMap,
(-)java/openjfx14/files/patch-modules_javafx.graphics_src_main_java_com_sun_javafx_tk_Toolkit.java (+11 lines)
Line 0 Link Here
1
--- modules/javafx.graphics/src/main/java/com/sun/javafx/tk/Toolkit.java.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.graphics/src/main/java/com/sun/javafx/tk/Toolkit.java
3
@@ -186,6 +186,8 @@ public abstract class Toolkit {
4
             return DEFAULT_TOOLKIT;
5
         } else if (PlatformUtil.isLinux()) {
6
             return DEFAULT_TOOLKIT;
7
+        } else if (PlatformUtil.isFreeBSD()) {
8
+            return DEFAULT_TOOLKIT;
9
         } else if (PlatformUtil.isIOS()) {
10
             return DEFAULT_TOOLKIT;
11
         } else if (PlatformUtil.isAndroid()) {
(-)java/openjfx14/files/patch-modules_javafx.graphics_src_main_java_com_sun_javafx_tk_quantum_GlassSystemMenu.java (+35 lines)
Line 0 Link Here
1
--- modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/GlassSystemMenu.java.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/GlassSystemMenu.java
3
@@ -313,13 +313,13 @@ class GlassSystemMenu implements TKSystemMenu {
4
         } else if (accelerator instanceof KeyCodeCombination) {
5
             KeyCodeCombination kcc  = (KeyCodeCombination)accelerator;
6
             KeyCode            code = kcc.getCode();
7
-            assert PlatformUtil.isMac() || PlatformUtil.isLinux();
8
+            assert PlatformUtil.isMac() || PlatformUtil.isLinux() || PlatformUtil.isFreeBSD();
9
             int modifier = glassModifiers(kcc);
10
             if (PlatformUtil.isMac()) {
11
                 int finalCode = code.isLetterKey() ? code.getChar().toUpperCase().charAt(0)
12
                         : code.getCode();
13
                 glassSubMenuItem.setShortcut(finalCode, modifier);
14
-            } else if (PlatformUtil.isLinux()) {
15
+            } else if (PlatformUtil.isLinux() || PlatformUtil.isFreeBSD()) {
16
                 String lower = code.getChar().toLowerCase();
17
                 if ((modifier & KeyEvent.MODIFIER_CONTROL) != 0) {
18
                     glassSubMenuItem.setShortcut(lower.charAt(0), modifier);
19
@@ -348,14 +348,14 @@ class GlassSystemMenu implements TKSystemMenu {
20
             ret += KeyEvent.MODIFIER_ALT;
21
         }
22
         if (kcc.getShortcut() == KeyCombination.ModifierValue.DOWN) {
23
-            if (PlatformUtil.isLinux()) {
24
+            if (PlatformUtil.isLinux() || PlatformUtil.isFreeBSD()) {
25
                 ret += KeyEvent.MODIFIER_CONTROL;
26
             } else if (PlatformUtil.isMac()) {
27
                 ret += KeyEvent.MODIFIER_COMMAND;
28
             }
29
         }
30
         if (kcc.getMeta() == KeyCombination.ModifierValue.DOWN) {
31
-            if (PlatformUtil.isLinux()) {
32
+            if (PlatformUtil.isLinux() || PlatformUtil.isFreeBSD()) {
33
                 ret += KeyEvent.MODIFIER_WINDOWS;   // RT-19326 - Linux shortcut support
34
             } else if (PlatformUtil.isMac()) {
35
                 ret += KeyEvent.MODIFIER_COMMAND;
(-)java/openjfx14/files/patch-modules_javafx.graphics_src_main_java_com_sun_javafx_tk_quantum_WindowStage.java (+11 lines)
Line 0 Link Here
1
--- modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java
3
@@ -460,7 +460,7 @@ class WindowStage extends GlassStage {
4
         } else if (PlatformUtil.isWindows()) { //Windows Sized Icons
5
             SMALL_ICON_HEIGHT = 32;
6
             SMALL_ICON_WIDTH = 32;
7
-        } else if (PlatformUtil.isLinux()) { //Linux icons
8
+        } else if (PlatformUtil.isLinux() || PlatformUtil.isFreeBSD()) { //Linux icons
9
             SMALL_ICON_HEIGHT = 128;
10
             SMALL_ICON_WIDTH = 128;
11
         }
(-)java/openjfx14/files/patch-modules_javafx.graphics_src_main_java_com_sun_prism_impl_PrismSettings.java (+29 lines)
Line 0 Link Here
1
--- modules/javafx.graphics/src/main/java/com/sun/prism/impl/PrismSettings.java.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.graphics/src/main/java/com/sun/prism/impl/PrismSettings.java
3
@@ -221,6 +221,8 @@ public final class PrismSettings {
4
                     tryOrderArr = new String[] { "es2" };
5
             } else if (PlatformUtil.isLinux()) {
6
                 tryOrderArr = new String[] { "es2", "sw" };
7
+            } else if (PlatformUtil.isFreeBSD()) {
8
+                tryOrderArr = new String[] { "es2", "sw" };
9
             } else {
10
                 tryOrderArr = new String[] { "sw" };
11
             }
12
@@ -234,7 +236,7 @@ public final class PrismSettings {
13
             for (String s : split(rOrder.toLowerCase(), ",")) {
14
                 switch (s) {
15
                     case "pisces":
16
-                        rSpec = PlatformUtil.isEmbedded() || !PlatformUtil.isLinux()
17
+                        rSpec = PlatformUtil.isEmbedded() || !PlatformUtil.isLinux() || !PlatformUtil.isFreeBSD()
18
                                 ? RasterizerType.NativePisces
19
                                 : RasterizerType.JavaPisces;
20
                         break;
21
@@ -269,7 +271,7 @@ public final class PrismSettings {
22
                 boolean doNativePisces;
23
                 String npprop = systemProperties.getProperty("prism.nativepisces");
24
                 if (npprop == null) {
25
-                    doNativePisces = PlatformUtil.isEmbedded() || !PlatformUtil.isLinux();
26
+                    doNativePisces = PlatformUtil.isEmbedded() || !PlatformUtil.isLinux() || !PlatformUtil.isFreeBSD();
27
                 } else {
28
                     doNativePisces = Boolean.parseBoolean(npprop);
29
                 }
(-)java/openjfx14/files/patch-modules_javafx.graphics_src_main_native-font_fontpath__linux.c (+11 lines)
Line 0 Link Here
1
--- modules/javafx.graphics/src/main/native-font/fontpath_linux.c.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.graphics/src/main/native-font/fontpath_linux.c
3
@@ -23,7 +23,7 @@
4
  * questions.
5
  */
6
 
7
-#if defined (__linux__) && ! defined (ANDROID_NDK)
8
+#if (defined (__linux__) && ! defined (ANDROID_NDK)) || defined(__FreeBSD__)
9
 
10
 #include <string.h>
11
 #include <stdio.h>
(-)java/openjfx14/files/patch-modules_javafx.graphics_src_main_native-font_freetype.c (+15 lines)
Line 0 Link Here
1
--- modules/javafx.graphics/src/main/native-font/freetype.c.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.graphics/src/main/native-font/freetype.c
3
@@ -23,7 +23,6 @@
4
  * questions.
5
  */
6
 
7
-#if defined __linux__ || ANDROID_NDK
8
 #if defined _ENABLE_PANGO || _ENABLE_HARFBUZZ
9
 
10
 #include <jni.h>
11
@@ -650,4 +649,3 @@ JNIEXPORT jboolean JNICALL JNICALL OS_NATIVE(isHarfbuz
12
 }
13
 
14
 #endif /* ENABLE_PANGO || ENABLE_HARFBUZZ */
15
-#endif /* __linux__ || ANDROID_NDK */
(-)java/openjfx14/files/patch-modules_javafx.graphics_src_main_native-font_pango.c (+15 lines)
Line 0 Link Here
1
--- modules/javafx.graphics/src/main/native-font/pango.c.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.graphics/src/main/native-font/pango.c
3
@@ -23,7 +23,6 @@
4
  * questions.
5
  */
6
 
7
-#if defined __linux__
8
 #if defined _ENABLE_PANGO
9
 
10
 #include <jni.h>
11
@@ -432,4 +431,3 @@ JNIEXPORT void JNICALL OS_NATIVE(pango_1font_1descript
12
 }
13
 
14
 #endif /* ENABLE_PANGO */
15
-#endif /* __linux__ */
(-)java/openjfx14/files/patch-modules_javafx.graphics_src_main_native-glass_gtk_GlassApplication.cpp (+10 lines)
Line 0 Link Here
1
--- modules/javafx.graphics/src/main/native-glass/gtk/GlassApplication.cpp.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.graphics/src/main/native-glass/gtk/GlassApplication.cpp
3
@@ -111,6 +111,7 @@ JNIEXPORT jint JNICALL Java_com_sun_glass_ui_gtk_GtkAp
4
 
5
     gdk_threads_enter();
6
     gtk_init(NULL, NULL);
7
+    gdk_threads_leave();
8
 
9
     return JNI_TRUE;
10
 }
(-)java/openjfx14/files/patch-modules_javafx.graphics_src_main_native-glass_gtk_glass__evloop.cpp (+11 lines)
Line 0 Link Here
1
--- modules/javafx.graphics/src/main/native-glass/gtk/glass_evloop.cpp.orig	2020-07-24 17:23:31 UTC
2
+++ modules/javafx.graphics/src/main/native-glass/gtk/glass_evloop.cpp
3
@@ -25,7 +25,7 @@
4
 #include "glass_evloop.h"
5
 
6
 #include <glib.h>
7
-#include <malloc.h>
8
+#include <stdlib.h>
9
 
10
 static GSList * evloopHookList;
11
 
(-)java/openjfx14/files/patch-modules_javafx.graphics_src_main_native-glass_gtk_glass__window.h (+16 lines)
Line 0 Link Here
1
--- modules/javafx.graphics/src/main/native-glass/gtk/glass_window.h.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.graphics/src/main/native-glass/gtk/glass_window.h
3
@@ -366,7 +366,7 @@ class WindowContextTop: public WindowContextBase {
4
     jlong screen;
5
     WindowFrameType frame_type;
6
     WindowType window_type;
7
-    struct WindowContext *owner;
8
+    WindowContext *owner;
9
     WindowGeometry geometry;
10
     struct _Resizable{// we can't use set/get gtk_window_resizable function
11
         _Resizable(): request(REQUEST_NONE), value(true), prev(false),
12
@@ -472,4 +472,3 @@ class EventsCounterHelper { (public)
13
 };
14
 
15
 #endif        /* GLASS_WINDOW_H */
16
-
(-)java/openjfx14/files/patch-modules_javafx.graphics_src_main_native-glass_gtk_launcher.c (+10 lines)
Line 0 Link Here
1
--- modules/javafx.graphics/src/main/native-glass/gtk/launcher.c.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.graphics/src/main/native-glass/gtk/launcher.c
3
@@ -25,7 +25,6 @@
4
 
5
 #include <stdio.h>
6
 #include <stdlib.h>
7
-#include <linux/fb.h>
8
 #include <fcntl.h>
9
 #ifndef __USE_GNU       // required for dladdr() & Dl_info
10
 #define __USE_GNU
(-)java/openjfx14/files/patch-modules_javafx.graphics_src_main_native-glass_gtk_wrapped.c (+10 lines)
Line 0 Link Here
1
--- modules/javafx.graphics/src/main/native-glass/gtk/wrapped.c.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.graphics/src/main/native-glass/gtk/wrapped.c
3
@@ -24,7 +24,6 @@
4
  */
5
 
6
 #include <stdio.h>
7
-#include <linux/fb.h>
8
 #include <fcntl.h>
9
 #ifndef __USE_GNU       // required for dladdr() & Dl_info
10
 #define __USE_GNU
(-)java/openjfx14/files/patch-modules_javafx.graphics_src_main_native-prism-es2_PrismES2Defs.h (+11 lines)
Line 0 Link Here
1
--- modules/javafx.graphics/src/main/native-prism-es2/PrismES2Defs.h.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.graphics/src/main/native-prism-es2/PrismES2Defs.h
3
@@ -26,7 +26,7 @@
4
 #ifndef _Prism_es2_defs_h_
5
 #define _Prism_es2_defs_h_
6
 
7
-#if defined(SOLARIS) || defined(LINUX) || defined(ANDROID_NDK) /* SOLARIS || LINUX */
8
+#if defined(SOLARIS) || defined(LINUX) || defined(ANDROID_NDK) || defined(FREEBSD) /* SOLARIS || LINUX */
9
 #define GLX_GLEXT_PROTOTYPES
10
 #define GLX_GLXEXT_PROTOTYPES
11
 #define UNIX
(-)java/openjfx14/files/patch-modules_javafx.media_src_main_java_com_sun_media_jfxmediaimpl_HostUtils.java (+13 lines)
Line 0 Link Here
1
--- modules/javafx.media/src/main/java/com/sun/media/jfxmediaimpl/HostUtils.java.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.media/src/main/java/com/sun/media/jfxmediaimpl/HostUtils.java
3
@@ -66,6 +66,10 @@ public class HostUtils {
4
         return osName.startsWith("linux");
5
     }
6
 
7
+    public static boolean isFreeBSD() {
8
+        return osName.startsWith("freebsd");
9
+    }
10
+
11
     public static boolean isIOS() {
12
         return osName.startsWith("ios");
13
     }
(-)java/openjfx14/files/patch-modules_javafx.media_src_main_java_com_sun_media_jfxmediaimpl_NativeMediaManager.java (+11 lines)
Line 0 Link Here
1
--- modules/javafx.media/src/main/java/com/sun/media/jfxmediaimpl/NativeMediaManager.java.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.media/src/main/java/com/sun/media/jfxmediaimpl/NativeMediaManager.java
3
@@ -110,7 +110,7 @@ public class NativeMediaManager {
4
                     NativeLibLoader.loadLibrary("glib-lite");
5
                 }
6
 
7
-                if (!HostUtils.isLinux() && !HostUtils.isIOS()) {
8
+                if (!HostUtils.isFreeBSD() && !HostUtils.isLinux() && !HostUtils.isIOS()) {
9
                     NativeLibLoader.loadLibrary("gstreamer-lite");
10
                 } else {
11
                     dependencies.add("gstreamer-lite");
(-)java/openjfx14/files/patch-modules_javafx.media_src_main_native_gstreamer_projects_build_linux_common_config.h (+11 lines)
Line 0 Link Here
1
--- modules/javafx.media/src/main/native/gstreamer/gstreamer-lite/projects/build/linux/common/config.h.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.media/src/main/native/gstreamer/gstreamer-lite/projects/build/linux/common/config.h
3
@@ -376,7 +376,7 @@
4
 #define HAVE_SYS_POLL_H 1
5
 
6
 /* Define to 1 if you have the <sys/prctl.h> header file. */
7
-#define HAVE_SYS_PRCTL_H 1
8
+#undef HAVE_SYS_PRCTL_H
9
 
10
 /* Define to 1 if you have the <sys/resource.h> header file. */
11
 #undef HAVE_SYS_RESOURCE_H
(-)java/openjfx14/files/patch-modules_javafx.media_src_main_native_jfxmedia_platform_gstreamer_GstPipelineFactory.cpp (+11 lines)
Line 0 Link Here
1
--- modules/javafx.media/src/main/native/jfxmedia/platform/gstreamer/GstPipelineFactory.cpp.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.media/src/main/native/jfxmedia/platform/gstreamer/GstPipelineFactory.cpp
3
@@ -338,6 +338,8 @@ GstElement* CGstPipelineFactory::CreateAudioSinkElemen
4
     return CreateElement("directsoundsink");
5
 #elif  TARGET_OS_MAC
6
     return CreateElement("osxaudiosink");
7
+#elif TARGET_OS_BSD
8
+    return CreateElement("bsdaudiosink");
9
 #elif  TARGET_OS_LINUX
10
     return CreateElement("alsasink");
11
 #else
(-)java/openjfx14/files/patch-modules_javafx.media_src_main_native_jfxmedia_projects_bsd_Makefile (+42 lines)
Line 0 Link Here
1
--- modules/javafx.media/src/main/native/jfxmedia/projects/bsd/Makefile.orig	2020-07-19 18:30:00 UTC
2
+++ modules/javafx.media/src/main/native/jfxmedia/projects/bsd/Makefile
3
@@ -1,5 +1,5 @@
4
 #
5
-# Linux/ARM jfxmedia makefile
6
+# BSD jfxmedia makefile
7
 #
8
 
9
 BUILD_DIR = $(OUTPUT_DIR)/$(BUILD_TYPE)
10
@@ -18,6 +18,7 @@ DIRLIST = jni                \
11
 TARGET = $(BUILD_DIR)/lib$(BASE_NAME).so
12
 
13
 CFLAGS = -DTARGET_OS_LINUX=1     \
14
+         -DTARGET_OS_BSD=1       \
15
          -D_GNU_SOURCE           \
16
          -DGST_REMOVE_DEPRECATED \
17
          -DGST_DISABLE_GST_DEBUG \
18
@@ -26,6 +27,7 @@ CFLAGS = -DTARGET_OS_LINUX=1     \
19
          -DHAVE_CONFIG_H         \
20
          -DJFXMEDIA_JNI_EXPORTS  \
21
          -DLINUX                 \
22
+         -DG_DISABLE_DEPRECATED  \
23
          -ffunction-sections -fdata-sections
24
 
25
 CPPFLAGS = -fno-rtti -ffunction-sections -fdata-sections
26
@@ -42,7 +44,6 @@ ifdef HOST_COMPILE
27
                   -Wformat-security \
28
                   -fstack-protector \
29
                   -Werror=implicit-function-declaration \
30
-                  -Werror=trampolines \
31
 		  -msse2 \
32
 	          -DGSTREAMER_LITE
33
 
34
@@ -51,7 +52,7 @@ ifdef HOST_COMPILE
35
 
36
 	INCLUDES = $(BASE_INCLUDES) \
37
 		   -I$(JAVA_HOME)/include \
38
-		   -I$(JAVA_HOME)/include/linux \
39
+		   -I$(JAVA_HOME)/include/freebsd \
40
 	           -I$(GSTREAMER_LITE_DIR)/gstreamer \
41
 		   -I$(GSTREAMER_LITE_DIR)/gst-plugins-base/gst-libs \
42
 	           -I$(GSTREAMER_LITE_DIR)/gstreamer/libs \
(-)java/openjfx14/files/patch-modules_javafx.swing_src_main_java_javafx_embed_swing_JFXPanel.java (+20 lines)
Line 0 Link Here
1
--- modules/javafx.swing/src/main/java/javafx/embed/swing/JFXPanel.java.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.swing/src/main/java/javafx/embed/swing/JFXPanel.java
3
@@ -1043,7 +1043,7 @@ public class JFXPanel extends JComponent {
4
         public boolean grabFocus() {
5
             // On X11 grab is limited to a single XDisplay connection,
6
             // so we can't delegate it to another GUI toolkit.
7
-            if (PlatformUtil.isLinux()) return true;
8
+            if (PlatformUtil.isLinux() || PlatformUtil.isFreeBSD()) return true;
9
 
10
             invokeOnClientEDT(() -> {
11
                 Window window = SwingUtilities.getWindowAncestor(JFXPanel.this);
12
@@ -1059,7 +1059,7 @@ public class JFXPanel extends JComponent {
13
         public void ungrabFocus() {
14
             // On X11 grab is limited to a single XDisplay connection,
15
             // so we can't delegate it to another GUI toolkit.
16
-            if (PlatformUtil.isLinux()) return;
17
+            if (PlatformUtil.isLinux() || PlatformUtil.isFreeBSD()) return;
18
 
19
             invokeOnClientEDT(() -> {
20
                 Window window = SwingUtilities.getWindowAncestor(JFXPanel.this);
(-)java/openjfx14/files/patch-modules_javafx.swing_src_main_java_javafx_embed_swing_SwingNode.java (+11 lines)
Line 0 Link Here
1
--- modules/javafx.swing/src/main/java/javafx/embed/swing/SwingNode.java.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.swing/src/main/java/javafx/embed/swing/SwingNode.java
3
@@ -807,7 +807,7 @@ public class SwingNode extends Node {
4
     private void ungrabFocus(boolean postUngrabEvent) {
5
         // On X11 grab is limited to a single XDisplay connection,
6
         // so we can't delegate it to another GUI toolkit.
7
-        if (PlatformUtil.isLinux()) return;
8
+        if (PlatformUtil.isLinux() || PlatformUtil.isFreeBSD()) return;
9
 
10
         if (grabbed &&
11
             getScene() != null &&
(-)java/openjfx14/files/patch-modules_javafx.web_src_main_native_Source_PlatformJava.cmake (+8 lines)
Line 0 Link Here
1
--- modules/javafx.web/src/main/native/Source/PlatformJava.cmake.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.web/src/main/native/Source/PlatformJava.cmake
3
@@ -1,4 +1 @@
4
-add_subdirectory(ThirdParty/sqlite)
5
-add_subdirectory(ThirdParty/icu)
6
-add_subdirectory(ThirdParty/libxml)
7
-add_subdirectory(ThirdParty/libxslt)
8
+
(-)java/openjfx14/files/patch-modules_javafx.web_src_main_native_Source_WTF_wtf_MemoryPressureHandler.cpp (+11 lines)
Line 0 Link Here
1
--- modules/javafx.web/src/main/native/Source/WTF/wtf/MemoryPressureHandler.cpp.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.web/src/main/native/Source/WTF/wtf/MemoryPressureHandler.cpp
3
@@ -49,7 +49,7 @@ MemoryPressureHandler& MemoryPressureHandler::singleto
4
 }
5
 
6
 MemoryPressureHandler::MemoryPressureHandler()
7
-#if OS(LINUX)
8
+#if OS(LINUX) || OS(FREEBSD)
9
     : m_holdOffTimer(RunLoop::main(), this, &MemoryPressureHandler::holdOffTimerFired)
10
 #elif OS(WINDOWS)
11
     : m_windowsMeasurementTimer(RunLoop::main(), this, &MemoryPressureHandler::windowsMeasurementTimerFired)
(-)java/openjfx14/files/patch-modules_javafx.web_src_main_native_Source_WTF_wtf_MemoryPressureHandler.h (+20 lines)
Line 0 Link Here
1
--- modules/javafx.web/src/main/native/Source/WTF/wtf/MemoryPressureHandler.h.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.web/src/main/native/Source/WTF/wtf/MemoryPressureHandler.h
3
@@ -66,7 +66,7 @@ class MemoryPressureHandler { (public)
4
 
5
     WTF_EXPORT_PRIVATE void setShouldUsePeriodicMemoryMonitor(bool);
6
 
7
-#if OS(LINUX)
8
+#if OS(LINUX) || OS(FREEBSD)
9
     WTF_EXPORT_PRIVATE void triggerMemoryPressureEvent(bool isCritical);
10
 #endif
11
 
12
@@ -200,7 +200,7 @@ class MemoryPressureHandler { (public)
13
     Win32Handle m_lowMemoryHandle;
14
 #endif
15
 
16
-#if OS(LINUX)
17
+#if OS(LINUX) || OS(FREEBSD)
18
     RunLoop::Timer<MemoryPressureHandler> m_holdOffTimer;
19
     void holdOffTimerFired();
20
 #endif
(-)java/openjfx14/files/patch-modules_javafx.web_src_main_native_Source_WTF_wtf_PlatformJava.cmake (+14 lines)
Line 0 Link Here
1
--- modules/javafx.web/src/main/native/Source/WTF/wtf/PlatformJava.cmake.orig	2020-07-24 19:01:56 UTC
2
+++ modules/javafx.web/src/main/native/Source/WTF/wtf/PlatformJava.cmake
3
@@ -83,9 +83,8 @@ elseif (UNIX)
4
     list(APPEND WTF_SOURCES
5
         generic/RunLoopGeneric.cpp
6
         generic/WorkQueueGeneric.cpp
7
-        linux/CurrentProcessMemoryStatus.cpp
8
-        linux/MemoryFootprintLinux.cpp
9
-        linux/MemoryPressureHandlerLinux.cpp
10
+        generic/MemoryFootprintGeneric.cpp
11
+        unix/MemoryPressureHandlerUnix.cpp
12
         unix/CPUTimeUnix.cpp
13
         unix/LanguageUnix.cpp
14
     )
(-)java/openjfx14/files/patch-modules_javafx.web_src_main_native_Source_WTF_wtf_generic_MemoryFootprintGeneric.cpp (+22 lines)
Line 0 Link Here
1
--- modules/javafx.web/src/main/native/Source/WTF/wtf/generic/MemoryFootprintGeneric.cpp.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.web/src/main/native/Source/WTF/wtf/generic/MemoryFootprintGeneric.cpp
3
@@ -25,8 +25,9 @@
4
 
5
 #include "config.h"
6
 #include <wtf/MemoryFootprint.h>
7
+#include <wtf/Platform.h>
8
 
9
-#if !(defined(USE_SYSTEM_MALLOC) && USE_SYSTEM_MALLOC) && OS(LINUX)
10
+#if !USE(SYSTEM_MALLOC) && (OS(LINUX) || OS(FREEBSD))
11
 #include <bmalloc/bmalloc.h>
12
 #endif
13
 
14
@@ -34,7 +35,7 @@ namespace WTF {
15
 
16
 size_t memoryFootprint()
17
 {
18
-#if !(defined(USE_SYSTEM_MALLOC) && USE_SYSTEM_MALLOC) && OS(LINUX)
19
+#if !USE(SYSTEM_MALLOC) && (OS(LINUX) || OS(FREEBSD))
20
     return bmalloc::api::memoryFootprint();
21
 #else
22
     return 0;
(-)java/openjfx14/files/patch-modules_javafx.web_src_main_native_Source_WTF_wtf_linux_MemoryPressureHandlerLinux.cpp (+54 lines)
Line 0 Link Here
1
--- modules/javafx.web/src/main/native/Source/WTF/wtf/linux/MemoryPressureHandlerLinux.cpp.orig	2020-07-17 12:21:33 UTC
2
+++ modules/javafx.web/src/main/native/Source/WTF/wtf/linux/MemoryPressureHandlerLinux.cpp
3
@@ -28,13 +28,20 @@
4
 #include "config.h"
5
 #include <wtf/MemoryPressureHandler.h>
6
 
7
-#include <malloc.h>
8
+#include <stdlib.h>
9
 #include <unistd.h>
10
 #include <wtf/MainThread.h>
11
 #include <wtf/MemoryFootprint.h>
12
-#include <wtf/linux/CurrentProcessMemoryStatus.h>
13
 #include <wtf/text/WTFString.h>
14
 
15
+#if OS(LINUX)
16
+#include <wtf/linux/CurrentProcessMemoryStatus.h>
17
+#elif OS(FREEBSD)
18
+#include <sys/sysctl.h>
19
+#include <sys/types.h>
20
+#include <sys/user.h>
21
+#endif
22
+
23
 #define LOG_CHANNEL_PREFIX Log
24
 
25
 namespace WTF {
26
@@ -105,9 +112,28 @@ void MemoryPressureHandler::holdOff(Seconds seconds)
27
 
28
 static size_t processMemoryUsage()
29
 {
30
+#if OS(LINUX)
31
     ProcessMemoryStatus memoryStatus;
32
     currentProcessMemoryStatus(memoryStatus);
33
     return (memoryStatus.resident - memoryStatus.shared);
34
+#elif OS(FREEBSD)
35
+    static size_t pageSize = sysconf(_SC_PAGE_SIZE);
36
+    struct kinfo_proc info;
37
+    size_t infolen = sizeof(info);
38
+
39
+    int mib[4];
40
+    mib[0] = CTL_KERN;
41
+    mib[1] = KERN_PROC;
42
+    mib[2] = KERN_PROC_PID;
43
+    mib[3] = getpid();
44
+
45
+    if (sysctl(mib, 4, &info, &infolen, nullptr, 0))
46
+        return 0;
47
+
48
+    return static_cast<size_t>(info.ki_rssize - info.ki_tsize) * pageSize;
49
+#else
50
+#error "Missing a platform specific way of determining the memory usage"
51
+#endif
52
 }
53
 
54
 void MemoryPressureHandler::respondToMemoryPressure(Critical critical, Synchronous synchronous)
(-)java/openjfx14/files/patch-modules_javafx.web_src_main_native_Source_WTF_wtf_unicode_java_UnicodeJava.h (+24 lines)
Line 0 Link Here
1
--- modules/javafx.web/src/main/native/Source/WTF/wtf/unicode/java/UnicodeJava.h.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.web/src/main/native/Source/WTF/wtf/unicode/java/UnicodeJava.h
3
@@ -37,21 +37,6 @@
4
 
5
 #define CharProp(p) com_sun_webkit_dom_CharacterDataImpl_##p
6
 
7
-#if PLATFORM(JAVA) && OS(WINDOWS)
8
-typedef wchar_t UChar;
9
-#else
10
-typedef uint16_t UChar;
11
-#endif
12
-
13
-// #ifdef UChar32
14
-// #undef UChar32
15
-// #endif
16
-
17
-#ifndef __UMACHINE_H__ //XXX: recheck
18
-typedef uint32_t UChar32;
19
-#endif
20
-
21
-#define U_MASK(x) ((uint32_t)1<<(x))
22
 #define USE_FAST_PATH(c, fast, slow) ((c) <= 0x7F ? fast((char)c) : slow(c))
23
 
24
 #define CHECK_PROPERTY(c, mask, isSet) \
(-)java/openjfx14/files/patch-modules_javafx.web_src_main_native_Source_WTF_wtf_unix_MemoryPressureHandlerUnix.cpp (+168 lines)
Line 0 Link Here
1
--- modules/javafx.web/src/main/native/Source/WTF/wtf/unix/MemoryPressureHandlerUnix.cpp.orig	2020-07-19 18:56:35 UTC
2
+++ modules/javafx.web/src/main/native/Source/WTF/wtf/unix/MemoryPressureHandlerUnix.cpp
3
@@ -0,0 +1,165 @@
4
+/*
5
+ * Copyright (C) 2011, 2012 Apple Inc. All Rights Reserved.
6
+ * Copyright (C) 2014 Raspberry Pi Foundation. All Rights Reserved.
7
+ * Copyright (C) 2018 Igalia S.L.
8
+ *
9
+ * Redistribution and use in source and binary forms, with or without
10
+ * modification, are permitted provided that the following conditions
11
+ * are met:
12
+ * 1. Redistributions of source code must retain the above copyright
13
+ *    notice, this list of conditions and the following disclaimer.
14
+ * 2. Redistributions in binary form must reproduce the above copyright
15
+ *    notice, this list of conditions and the following disclaimer in the
16
+ *    documentation and/or other materials provided with the distribution.
17
+ *
18
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
19
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
22
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
+ */
30
+
31
+#include "config.h"
32
+#include <wtf/MemoryPressureHandler.h>
33
+
34
+#include <stdlib.h>
35
+#include <unistd.h>
36
+#include <wtf/MainThread.h>
37
+#include <wtf/MemoryFootprint.h>
38
+#include <wtf/text/WTFString.h>
39
+
40
+#if OS(LINUX)
41
+#include <wtf/linux/CurrentProcessMemoryStatus.h>
42
+#elif OS(FREEBSD)
43
+#include <sys/sysctl.h>
44
+#include <sys/types.h>
45
+#include <sys/user.h>
46
+#endif
47
+
48
+#define LOG_CHANNEL_PREFIX Log
49
+
50
+namespace WTF {
51
+
52
+// Disable memory event reception for a minimum of s_minimumHoldOffTime
53
+// seconds after receiving an event. Don't let events fire any sooner than
54
+// s_holdOffMultiplier times the last cleanup processing time. Effectively
55
+// this is 1 / s_holdOffMultiplier percent of the time.
56
+// If after releasing the memory we don't free at least s_minimumBytesFreedToUseMinimumHoldOffTime,
57
+// we wait longer to try again (s_maximumHoldOffTime).
58
+// These value seems reasonable and testing verifies that it throttles frequent
59
+// low memory events, greatly reducing CPU usage.
60
+static const Seconds s_minimumHoldOffTime { 5_s };
61
+static const Seconds s_maximumHoldOffTime { 30_s };
62
+static const size_t s_minimumBytesFreedToUseMinimumHoldOffTime = 1 * MB;
63
+static const unsigned s_holdOffMultiplier = 20;
64
+
65
+void MemoryPressureHandler::triggerMemoryPressureEvent(bool isCritical)
66
+{
67
+    if (!m_installed)
68
+        return;
69
+
70
+    if (ReliefLogger::loggingEnabled())
71
+        LOG(MemoryPressure, "Got memory pressure notification (%s)", isCritical ? "critical" : "non-critical");
72
+
73
+    setUnderMemoryPressure(true);
74
+
75
+    if (isMainThread())
76
+        respondToMemoryPressure(isCritical ? Critical::Yes : Critical::No);
77
+    else
78
+        RunLoop::main().dispatch([this, isCritical] {
79
+            respondToMemoryPressure(isCritical ? Critical::Yes : Critical::No);
80
+        });
81
+
82
+    if (ReliefLogger::loggingEnabled() && isUnderMemoryPressure())
83
+        LOG(MemoryPressure, "System is no longer under memory pressure.");
84
+
85
+    setUnderMemoryPressure(false);
86
+}
87
+
88
+void MemoryPressureHandler::install()
89
+{
90
+    if (m_installed || m_holdOffTimer.isActive())
91
+        return;
92
+
93
+    m_installed = true;
94
+}
95
+
96
+void MemoryPressureHandler::uninstall()
97
+{
98
+    if (!m_installed)
99
+        return;
100
+
101
+    m_holdOffTimer.stop();
102
+
103
+    m_installed = false;
104
+}
105
+
106
+void MemoryPressureHandler::holdOffTimerFired()
107
+{
108
+    install();
109
+}
110
+
111
+void MemoryPressureHandler::holdOff(Seconds seconds)
112
+{
113
+    m_holdOffTimer.startOneShot(seconds);
114
+}
115
+
116
+static size_t processMemoryUsage()
117
+{
118
+#if OS(LINUX)
119
+    ProcessMemoryStatus memoryStatus;
120
+    currentProcessMemoryStatus(memoryStatus);
121
+    return (memoryStatus.resident - memoryStatus.shared);
122
+#elif OS(FREEBSD)
123
+    static size_t pageSize = sysconf(_SC_PAGE_SIZE);
124
+    struct kinfo_proc info;
125
+    size_t infolen = sizeof(info);
126
+
127
+    int mib[4];
128
+    mib[0] = CTL_KERN;
129
+    mib[1] = KERN_PROC;
130
+    mib[2] = KERN_PROC_PID;
131
+    mib[3] = getpid();
132
+
133
+    if (sysctl(mib, 4, &info, &infolen, nullptr, 0))
134
+        return 0;
135
+
136
+    return static_cast<size_t>(info.ki_rssize - info.ki_tsize) * pageSize;
137
+#else
138
+#error "Missing a platform specific way of determining the memory usage"
139
+#endif
140
+}
141
+
142
+void MemoryPressureHandler::respondToMemoryPressure(Critical critical, Synchronous synchronous)
143
+{
144
+    uninstall();
145
+
146
+    MonotonicTime startTime = MonotonicTime::now();
147
+    int64_t processMemory = processMemoryUsage();
148
+    releaseMemory(critical, synchronous);
149
+    int64_t bytesFreed = processMemory - processMemoryUsage();
150
+    Seconds holdOffTime = s_maximumHoldOffTime;
151
+    if (bytesFreed > 0 && static_cast<size_t>(bytesFreed) >= s_minimumBytesFreedToUseMinimumHoldOffTime)
152
+        holdOffTime = (MonotonicTime::now() - startTime) * s_holdOffMultiplier;
153
+    holdOff(std::max(holdOffTime, s_minimumHoldOffTime));
154
+}
155
+
156
+void MemoryPressureHandler::platformReleaseMemory(Critical)
157
+{
158
+#if HAVE(MALLOC_TRIM)
159
+    malloc_trim(0);
160
+#endif
161
+}
162
+
163
+Optional<MemoryPressureHandler::ReliefLogger::MemoryUsage> MemoryPressureHandler::ReliefLogger::platformMemoryUsage()
164
+{
165
+    return MemoryUsage {processMemoryUsage(), memoryFootprint()};
166
+}
167
+
168
+} // namespace WTF
(-)java/openjfx14/files/patch-modules_javafx.web_src_main_native_Source_bmalloc_bmalloc_AvailableMemory.cpp (+45 lines)
Line 0 Link Here
1
--- modules/javafx.web/src/main/native/Source/bmalloc/bmalloc/AvailableMemory.cpp.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.web/src/main/native/Source/bmalloc/bmalloc/AvailableMemory.cpp
3
@@ -47,6 +47,11 @@
4
 #if BOS(LINUX)
5
 #include <algorithm>
6
 #include <fcntl.h>
7
+#elif BOS(FREEBSD)
8
+#include "VMAllocate.h"
9
+#include <sys/sysctl.h>
10
+#include <sys/types.h>
11
+#include <sys/user.h>
12
 #endif
13
 #include <unistd.h>
14
 #endif
15
@@ -184,7 +189,7 @@ size_t availableMemory()
16
     return availableMemory;
17
 }
18
 
19
-#if BPLATFORM(IOS_FAMILY) || BOS(LINUX)
20
+#if BPLATFORM(IOS_FAMILY) || BOS(LINUX) || BOS(FREEBSD)
21
 MemoryStatus memoryStatus()
22
 {
23
 #if BPLATFORM(IOS_FAMILY)
24
@@ -200,6 +205,21 @@ MemoryStatus memoryStatus()
25
     auto& memory = LinuxMemory::singleton();
26
     size_t memoryFootprint = memory.footprint();
27
     double percentInUse = static_cast<double>(memoryFootprint) / static_cast<double>(memory.availableMemory);
28
+#elif BOS(FREEBSD)
29
+    struct kinfo_proc info;
30
+    size_t infolen = sizeof(info);
31
+
32
+    int mib[4];
33
+    mib[0] = CTL_KERN;
34
+    mib[1] = KERN_PROC;
35
+    mib[2] = KERN_PROC_PID;
36
+    mib[3] = getpid();
37
+
38
+    size_t memoryFootprint = 0;
39
+    if (!sysctl(mib, 4, &info, &infolen, nullptr, 0))
40
+        memoryFootprint = static_cast<size_t>(info.ki_rssize) * vmPageSize();
41
+
42
+    double percentInUse = static_cast<double>(memoryFootprint) / static_cast<double>(availableMemory());
43
 #endif
44
 
45
     double percentAvailableMemoryInUse = std::min(percentInUse, 1.0);
(-)java/openjfx14/files/patch-modules_javafx.web_src_main_native_Source_bmalloc_bmalloc_AvailableMemory.h (+20 lines)
Line 0 Link Here
1
--- modules/javafx.web/src/main/native/Source/bmalloc/bmalloc/AvailableMemory.h.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.web/src/main/native/Source/bmalloc/bmalloc/AvailableMemory.h
3
@@ -32,7 +32,7 @@ namespace bmalloc {
4
 
5
 size_t availableMemory();
6
 
7
-#if BPLATFORM(IOS_FAMILY) || BOS(LINUX)
8
+#if BPLATFORM(IOS_FAMILY) || BOS(LINUX) || BOS(FREEBSD)
9
 struct MemoryStatus {
10
     MemoryStatus(size_t memoryFootprint, double percentAvailableMemoryInUse)
11
         : memoryFootprint(memoryFootprint)
12
@@ -61,7 +61,7 @@ inline double percentAvailableMemoryInUse()
13
 
14
 inline bool isUnderMemoryPressure()
15
 {
16
-#if BPLATFORM(IOS_FAMILY) || BOS(LINUX)
17
+#if BPLATFORM(IOS_FAMILY) || BOS(LINUX) || BOS(FREEBSD)
18
     return percentAvailableMemoryInUse() > memoryPressureThreshold;
19
 #else
20
     return false;
(-)java/openjfx14/files/patch-modules_javafx.web_src_main_native_Source_bmalloc_bmalloc_bmalloc.h (+11 lines)
Line 0 Link Here
1
--- modules/javafx.web/src/main/native/Source/bmalloc/bmalloc/bmalloc.h.orig	2020-07-24 18:56:22 UTC
2
+++ modules/javafx.web/src/main/native/Source/bmalloc/bmalloc/bmalloc.h
3
@@ -111,7 +111,7 @@ inline size_t availableMemory()
4
     return bmalloc::availableMemory();
5
 }
6
 
7
-#if BPLATFORM(IOS_FAMILY) || BOS(LINUX)
8
+#if BPLATFORM(IOS_FAMILY) || BOS(LINUX) ||  BOS(FREEBSD)
9
 inline size_t memoryFootprint()
10
 {
11
     return bmalloc::memoryFootprint();
(-)java/openjfx14/files/patch-modules_javafx.web_src_main_native_Source_cmake_OptionsJava.cmake (+21 lines)
Line 0 Link Here
1
--- modules/javafx.web/src/main/native/Source/cmake/OptionsJava.cmake.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.web/src/main/native/Source/cmake/OptionsJava.cmake
3
@@ -31,14 +31,10 @@ endif ()
4
 set(LIB_INSTALL_DIR "${CMAKE_INSTALL_FULL_LIBDIR}" CACHE PATH "Absolute path to library installation directory")
5
 set(EXEC_INSTALL_DIR "${CMAKE_INSTALL_FULL_BINDIR}" CACHE PATH "Absolute path to executable installation directory")
6
 
7
-set(SQLITE_LIBRARIES SqliteJava)
8
-set(LIBXML2_LIBRARIES XMLJava)
9
-set(LIBXSLT_LIBRARIES XSLTJava)
10
-
11
-set(ICU_LIBRARIES icuuc icudata)
12
-set(ICU_I18N_LIBRARIES icui18n icuuc icudata)
13
-set(ICU_DATA_LIBRARIES icudata)
14
-
15
+find_package(LibXml2 2.8.0 REQUIRED)
16
+find_package(LibXslt REQUIRED)
17
+find_package(Sqlite REQUIRED)
18
+find_package(ICU REQUIRED)
19
 find_package(JNI REQUIRED)
20
 find_package(Threads REQUIRED)
21
 
(-)java/openjfx14/files/patch-modules_javafx.web_src_main_native_Source_cmake_WebKitCompilerFlags.cmake (+13 lines)
Line 0 Link Here
1
--- modules/javafx.web/src/main/native/Source/cmake/WebKitCompilerFlags.cmake.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.web/src/main/native/Source/cmake/WebKitCompilerFlags.cmake
3
@@ -231,10 +231,6 @@ if (NOT MSVC)
4
     string(REGEX MATCHALL "-fsanitize=[^ ]*" ENABLED_COMPILER_SANITIZERS ${CMAKE_CXX_FLAGS})
5
 endif ()
6
 
7
-if (UNIX AND NOT APPLE AND NOT ENABLED_COMPILER_SANITIZERS)
8
-    set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined ${CMAKE_SHARED_LINKER_FLAGS}")
9
-endif ()
10
-
11
 
12
 # CODE_GENERATOR_PREPROCESSOR_WITH_LINEMARKERS only matters with GCC >= 4.7.0.  Since this
13
 # version, -P does not output empty lines, which currently breaks make_names.pl in
(-)java/openjfx14/files/patch-modules_javafx.web_src_main_native_Tools_DumpRenderTree_TestRunner.cpp (+18 lines)
Line 0 Link Here
1
https://github.com/WebKit/webkit/commit/35a79bf4c2e0ecb4a37e672de347a25254ea0601
2
3
* DumpRenderTree/TestRunner.cpp:
4
(TestRunner::runUIScript):
5
Manually convert between UChar and UniChar/unichar where needed.
6
7
8
--- modules/javafx.web/src/main/native/Tools/DumpRenderTree/TestRunner.cpp.orig	2020-07-19 19:13:03 UTC
9
+++ modules/javafx.web/src/main/native/Tools/DumpRenderTree/TestRunner.cpp
10
@@ -2463,7 +2463,7 @@ void TestRunner::runUIScript(JSContextRef context, JSS
11
     if (!m_UIScriptContext)
12
         m_UIScriptContext = makeUniqueWithoutFastMallocCheck<WTR::UIScriptContext>(*this);
13
 
14
-    String scriptString(JSStringGetCharactersPtr(script), JSStringGetLength(script));
15
+    String scriptString(reinterpret_cast<const UChar*>(JSStringGetCharactersPtr(script)), JSStringGetLength(script));
16
     m_UIScriptContext->runUIScript(scriptString, callbackID);
17
 }
18
 
(-)java/openjfx14/files/patch-modules_javafx.web_src_main_native_Tools_DumpRenderTree_java_CMakeLists.txt (+12 lines)
Line 0 Link Here
1
--- modules/javafx.web/src/main/native/Tools/DumpRenderTree/java/CMakeLists.txt.orig	2020-07-17 10:21:33 UTC
2
+++ modules/javafx.web/src/main/native/Tools/DumpRenderTree/java/CMakeLists.txt
3
@@ -72,9 +72,5 @@ add_library(DumpRenderTreeJava SHARED ${DumpRenderTree
4
 add_definitions(-DWEBCORE_EXPORT=WTF_IMPORT -DWEBCORE_TESTSUPPORT_EXPORT=WTF_IMPORT)
5
 add_dependencies(DumpRenderTreeJava DumpRenderTreeBindings)
6
 
7
-if (UNIX AND NOT APPLE)
8
-  set_target_properties(DumpRenderTreeJava PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
9
-endif ()
10
-
11
 set_target_properties(DumpRenderTreeJava PROPERTIES OUTPUT_NAME "DumpRenderTreeJava")
12
 target_link_libraries(DumpRenderTreeJava ${DumpRenderTree_LIBRARIES})
(-)java/openjfx14/pkg-plist (-24 / +33 lines)
Lines 1-24 Link Here
1
%%JAVA_HOME%%/bin/javafxpackager
1
%%JAVA_HOME%%/jmods/javafx.base.jmod
2
%%JAVA_HOME%%/bin/javapackager
2
%%JAVA_HOME%%/jmods/javafx.controls.jmod
3
%%MEDIA%%%%JAVA_HOME%%/jre/lib/%%ARCH%%/libavplugin.so
3
%%JAVA_HOME%%/jmods/javafx.fxml.jmod
4
%%JAVA_HOME%%/jre/lib/%%ARCH%%/libdecora_sse.so
4
%%JAVA_HOME%%/jmods/javafx.graphics.jmod
5
%%MEDIA%%%%JAVA_HOME%%/jre/lib/%%ARCH%%/libfxplugins.so
5
%%JAVA_HOME%%/jmods/javafx.media.jmod
6
%%JAVA_HOME%%/jre/lib/%%ARCH%%/libglass.so
6
%%JAVA_HOME%%/jmods/javafx.swing.jmod
7
%%JAVA_HOME%%/jre/lib/%%ARCH%%/libglassgtk2.so
7
%%JAVA_HOME%%/jmods/javafx.web.jmod
8
%%JAVA_HOME%%/jre/lib/%%ARCH%%/libglassgtk3.so
8
%%JAVA_HOME%%/lib/javafx.base.jar
9
%%MEDIA%%%%JAVA_HOME%%/jre/lib/%%ARCH%%/libgstreamer-lite.so
9
%%JAVA_HOME%%/lib/javafx.controls.jar
10
%%JAVA_HOME%%/jre/lib/%%ARCH%%/libjavafx_font.so
10
%%JAVA_HOME%%/lib/javafx.fxml.jar
11
%%JAVA_HOME%%/jre/lib/%%ARCH%%/libjavafx_font_freetype.so
11
%%JAVA_HOME%%/lib/javafx.graphics.jar
12
%%JAVA_HOME%%/jre/lib/%%ARCH%%/libjavafx_font_pango.so
12
%%JAVA_HOME%%/lib/javafx.media.jar
13
%%JAVA_HOME%%/jre/lib/%%ARCH%%/libjavafx_iio.so
13
%%JAVA_HOME%%/lib/javafx.properties
14
%%MEDIA%%%%JAVA_HOME%%/jre/lib/%%ARCH%%/libjfxmedia.so
14
%%JAVA_HOME%%/lib/javafx.swing.jar
15
%%WEBKIT%%%%JAVA_HOME%%/jre/lib/%%ARCH%%/libjfxwebkit.so
15
%%JAVA_HOME%%/lib/javafx.web.jar
16
%%JAVA_HOME%%/jre/lib/%%ARCH%%/libprism_common.so
16
%%MEDIA%%%%JAVA_HOME%%/lib/libavplugin.so
17
%%JAVA_HOME%%/jre/lib/%%ARCH%%/libprism_es2.so
17
%%JAVA_HOME%%/lib/libdecora_sse.so
18
%%JAVA_HOME%%/jre/lib/%%ARCH%%/libprism_sw.so
18
%%MEDIA%%%%JAVA_HOME%%/lib/libfxplugins.so
19
%%JAVA_HOME%%/jre/lib/ext/jfxrt.jar
19
%%JAVA_HOME%%/lib/libglass.so
20
%%JAVA_HOME%%/jre/lib/javafx.properties
20
%%JAVA_HOME%%/lib/libglassgtk2.so
21
%%SWT%%%%JAVA_HOME%%/jre/lib/jfxswt.jar
21
%%JAVA_HOME%%/lib/libglassgtk3.so
22
%%JAVA_HOME%%/lib/ant-javafx.jar
22
%%MEDIA%%%%JAVA_HOME%%/lib/libgstreamer-lite.so
23
%%JAVA_HOME%%/lib/javafx-mx.jar
23
%%JAVA_HOME%%/lib/libjavafx_font.so
24
%%JAVA_HOME%%/lib/packager.jar
24
%%JAVA_HOME%%/lib/libjavafx_font_freetype.so
25
%%JAVA_HOME%%/lib/libjavafx_font_pango.so
26
%%JAVA_HOME%%/lib/libjavafx_iio.so
27
%%MEDIA%%%%JAVA_HOME%%/lib/libjfxmedia.so
28
%%WEBKIT%%%%JAVA_HOME%%/lib/libjfxwebkit.so
29
%%JAVA_HOME%%/lib/libprism_common.so
30
%%JAVA_HOME%%/lib/libprism_es2.so
31
%%JAVA_HOME%%/lib/libprism_sw.so
32
%%JAVA_HOME%%/lib/javafx-src.zip
33
%%SWT%%%%JAVA_HOME%%/lib/javafx-swt.jar

Return to bug 248248