aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authortobik <tobik@FreeBSD.org>2017-10-04 05:24:58 +0800
committerKoop Mast <kwm@rainbow-runner.nl>2018-02-04 05:39:39 +0800
commiteac6afe14fefaff0d7cbc47065a0dabe7e2263e7 (patch)
tree670cd71eda479bcbb81b31dc8cc6cb2aff1261fa /java
parent73fe9d57ffc66ba290b9e8ff006f601b719bc916 (diff)
downloadfreebsd-ports-gnome-eac6afe14fefaff0d7cbc47065a0dabe7e2263e7.tar.gz
freebsd-ports-gnome-eac6afe14fefaff0d7cbc47065a0dabe7e2263e7.tar.zst
freebsd-ports-gnome-eac6afe14fefaff0d7cbc47065a0dabe7e2263e7.zip
java/openjfx8-devel: Update to 8u172-b00
- Move to the regular OpenJFX 8 repository [1], add all *BSD specific patches to the port, and stop using the repository at [2]. This should make port contributions and updates a lot easier going forward. - Bump PORTEPOCH and start using version numbers based on the tags from [1] - Prepare the port for supporting multiple audio backend options - Fix PREFIX/LOCALBASE confusion and get all Java dependencies from LOCALBASE and not from PREFIX - Respect CC and CXX during the WebKit build. Clang in FreeBSD 10.3 segfaults while building it now, so make sure we use Clang from devel/llvm40 via compiler:c++14-lang instead. [1] http://hg.openjdk.java.net/openjfx/8u/rt/ [2] https://bitbucket.org/tobik/openjfx-rt
Diffstat (limited to 'java')
-rw-r--r--java/openjfx8-devel/Makefile49
-rw-r--r--java/openjfx8-devel/distinfo6
-rw-r--r--java/openjfx8-devel/files/bsd.gradle258
-rw-r--r--java/openjfx8-devel/files/gstsndio.c42
-rw-r--r--java/openjfx8-devel/files/patch-build.gradle421
-rw-r--r--java/openjfx8-devel/files/patch-build.properties17
-rw-r--r--java/openjfx8-devel/files/patch-buildSrc_build.gradle2
-rw-r--r--java/openjfx8-devel/files/patch-icu5977
-rw-r--r--java/openjfx8-devel/files/patch-modules_base_src_main_java_com_sun_javafx_PlatformUtil.java26
-rw-r--r--java/openjfx8-devel/files/patch-modules_fxpackager_src_main_native_library_common_PosixPlatform.cpp18
-rw-r--r--java/openjfx8-devel/files/patch-modules_graphics_src_main_java_com_sun_glass_ui_Platform.java20
-rw-r--r--java/openjfx8-devel/files/patch-modules_graphics_src_main_java_com_sun_glass_utils_NativeLibLoader.java20
-rw-r--r--java/openjfx8-devel/files/patch-modules_graphics_src_main_java_com_sun_javafx_font_PrismFontFactory.java54
-rw-r--r--java/openjfx8-devel/files/patch-modules_graphics_src_main_java_com_sun_javafx_tk_Toolkit.java11
-rw-r--r--java/openjfx8-devel/files/patch-modules_graphics_src_main_java_com_sun_prism_impl_PrismSettings.java2
-rw-r--r--java/openjfx8-devel/files/patch-modules_graphics_src_main_native-font_fontpath__linux.c11
-rw-r--r--java/openjfx8-devel/files/patch-modules_graphics_src_main_native-font_freetype.c15
-rw-r--r--java/openjfx8-devel/files/patch-modules_graphics_src_main_native-font_pango.c15
-rw-r--r--java/openjfx8-devel/files/patch-modules_graphics_src_main_native-glass_gtk_glass__evloop.cpp17
-rw-r--r--java/openjfx8-devel/files/patch-modules_graphics_src_main_native-glass_gtk_glass__general.cpp10
-rw-r--r--java/openjfx8-devel/files/patch-modules_graphics_src_main_native-glass_gtk_glass__window.h16
-rw-r--r--java/openjfx8-devel/files/patch-modules_graphics_src_main_native-prism-es2_PrismES2Defs.h11
-rw-r--r--java/openjfx8-devel/files/patch-modules_media_src_main_native_gstreamer_projects_bsd_gstreamer-lite_Makefile38
-rw-r--r--java/openjfx8-devel/files/patch-modules_media_src_main_native_jfxmedia_platform_gstreamer_GstPipelineFactory.cpp11
-rw-r--r--java/openjfx8-devel/files/patch-modules_media_src_main_native_jfxmedia_projects_bsd_Makefile26
-rw-r--r--java/openjfx8-devel/files/patch-modules_web_src_main_native_Source_JavaScriptCore_PlatformJava.cmake8
-rw-r--r--java/openjfx8-devel/files/patch-modules_web_src_main_native_Source_PlatformJava.cmake10
-rw-r--r--java/openjfx8-devel/files/patch-modules_web_src_main_native_Source_WTF_wtf_CMakeLists.txt10
-rw-r--r--java/openjfx8-devel/files/patch-modules_web_src_main_native_Source_WTF_wtf_unicode_java_UnicodeJava.h24
-rw-r--r--java/openjfx8-devel/files/patch-modules_web_src_main_native_Source_WebCore_PlatformJava.cmake11
-rw-r--r--java/openjfx8-devel/files/patch-modules_web_src_main_native_Source_cmake_OptionsJava.cmake20
-rw-r--r--java/openjfx8-devel/files/patch-modules_web_src_main_native_Tools_DumpRenderTree_TestRunner.cpp11
-rw-r--r--java/openjfx8-devel/files/patch-modules_web_src_main_native_Tools_DumpRenderTree_java_CMakeLists.txt13
-rw-r--r--java/openjfx8-devel/files/patch-modules_web_src_main_native_Tools_Scripts_webkitdirs.pm11
-rw-r--r--java/openjfx8-devel/files/sndiosink.c524
-rw-r--r--java/openjfx8-devel/files/sndiosink.h67
36 files changed, 1782 insertions, 120 deletions
diff --git a/java/openjfx8-devel/Makefile b/java/openjfx8-devel/Makefile
index e8c5e0d05c22..868ee262c304 100644
--- a/java/openjfx8-devel/Makefile
+++ b/java/openjfx8-devel/Makefile
@@ -2,14 +2,15 @@
# $FreeBSD$
PORTNAME= openjfx8
-PORTVERSION= 20170722
-PORTREVISION= 4
+DISTVERSION= 8u172-b00
+PORTEPOCH= 1
CATEGORIES= java x11-toolkits devel
-MASTER_SITES= https://bitbucket.org/tobik/openjfx-rt/get/freebsd${PORTVERSION}${EXTRACT_SUFX}?dummy=/
+MASTER_SITES= https://github.com/t6/openjfx/releases/download/release/ \
+ http://hg.openjdk.java.net/openjfx/8u/rt/archive/${DISTVERSION}${EXTRACT_SUFX}?dummy=/
PKGNAMESUFFIX= -devel
MAINTAINER= tobik@FreeBSD.org
-COMMENT= JavaFX (OpenJFX) SDK overlay for OpenJDK 8
+COMMENT= JavaFX SDK overlay for OpenJDK 8
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/LICENSE
@@ -29,9 +30,9 @@ USES= gettext-runtime jpeg sqlite
USE_GL= gl
USE_GNOME= atk cairo gdkpixbuf2 glib20 gtk20 pango
USE_JAVA= yes
+JAVA_VERSION= 1.8
USE_LDCONFIG= yes
USE_XORG= x11 xtst xxf86vm
-JAVA_VERSION= 1.8
OPTIONS_DEFINE= MEDIA TEST WEBKIT
OPTIONS_DEFAULT= MEDIA WEBKIT
@@ -51,7 +52,7 @@ TEST_VARS= AWT_TEST=true FULL_TEST=true
WEBKIT_BUILD_DEPENDS= cmake:devel/cmake
WEBKIT_IMPLIES= MEDIA
WEBKIT_LIB_DEPENDS= libicui18n.so:devel/icu
-WEBKIT_USES= bison compiler:c++11-lib gmake gperf perl5 pkgconfig \
+WEBKIT_USES= bison compiler:c++14-lang gmake gperf perl5 pkgconfig \
python:2.7,build
WEBKIT_USE= GNOME=libxslt,libxml2 \
PERL5=build \
@@ -59,21 +60,44 @@ WEBKIT_USE= GNOME=libxslt,libxml2 \
XORG=xcomposite,xdamage,xfixes,xrender,xt
WEBKIT_VARS= RUBY_NO_RUN_DEPENDS=yes COMPILE_WEBKIT=true
+# Move Gradle's home below ${WRKDIR} instead of using ${HOME}/.gradle
+GRADLE_ENV= GRADLE_USER_HOME=${WRKDIR}/gradle-home \
+ CC=${CC} CXX=${CXX}
+GRADLE_RUN= ${SETENV} ${GRADLE_ENV} gradle --no-daemon
+
PLIST_SUB= ARCH=${ARCH} \
JAVA_HOME=${JAVA_HOME}
-
-WRKSRC= ${WRKDIR}/tobik-openjfx-rt-9ccdaef460fa
-
-GRADLE_ENV= GRADLE_USER_HOME=${WRKDIR}/gradle-home
-GRADLE_RUN= ${SETENV} ${GRADLE_ENV} gradle --no-daemon
+WRKSRC= ${WRKDIR}/rt-${DISTVERSION}
# NOTE: This port won't build if ${JAVA_HOME}/jre/lib/ext/jfxrt.jar
# already exists on your system. This is not a problem in Poudriere
# or Synth but something to be aware of if you're trying to build this
# port in a non-pristine environment.
+# The BSD Makefiles for GStreamer-lite and Jfxmedia are based on the
+# Linux versions. Prepare the tree, so that we only see the changes
+# from Linux's Makefile in our own patches.
+pre-patch:
+ @${CP} -r ${WRKSRC}/modules/media/src/main/native/jfxmedia/projects/linux \
+ ${WRKSRC}/modules/media/src/main/native/jfxmedia/projects/bsd
+ @${CP} -r ${WRKSRC}/modules/media/src/main/native/gstreamer/projects/linux \
+ ${WRKSRC}/modules/media/src/main/native/gstreamer/projects/bsd
+
post-patch:
- @${REINPLACE_CMD} -E -e 's|%%PREFIX%%|${PREFIX}|g' \
+ @${CP} ${FILESDIR}/bsd.gradle ${WRKSRC}/buildSrc
+# Add a *BSD native audio sink to GStreamer-lite instead of using the
+# bundled ALSA sink. Currently we add an sndio sink, but this is an extension
+# point for eventually adding an OSS backend (or others) as an option as well.
+# If you add a new one make sure it registers itself as "bsdaudiosink" as defined
+# in modules/media/src/main/native/jfxmedia/platform/gstreamer/GstPipelineFactory.cpp
+ @${MKDIR} ${WRKSRC}/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/ext/bsdaudio
+ @${CP} ${FILESDIR}/gstsndio.c ${FILESDIR}/sndiosink.c ${FILESDIR}/sndiosink.h \
+ ${WRKSRC}/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/ext/bsdaudio
+ @cd ${WRKSRC}/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/ext/bsdaudio && \
+ ${LN} -s gstsndio.c gstbsdaudio.c && \
+ ${LN} -s sndiosink.c bsdaudiosink.c
+# Pull Java dependencies from LOCALBASE
+ @${REINPLACE_CMD} 's@/usr/local@${LOCALBASE}@g' \
${WRKSRC}/build.gradle ${WRKSRC}/buildSrc/build.gradle
# Remove the bundled libicu and libsqlite3. We use the system's
# versions instead.
@@ -81,7 +105,6 @@ post-patch:
${WRKSRC}/modules/web/src/main/native/Source/ThirdParty/sqlite
do-configure:
-# Gradle creates ${HOME}/.gradle, pretend home is somewhere else
@${MKDIR} ${WRKDIR}/gradle-home
@${ECHO_CMD} "NUM_COMPILE_THREADS = ${MAKE_JOBS_NUMBER}" > ${WRKSRC}/gradle.properties
.for prop in COMPILE_MEDIA COMPILE_WEBKIT AWT_TEST FULL_TEST
diff --git a/java/openjfx8-devel/distinfo b/java/openjfx8-devel/distinfo
index f6df02d2af5d..408d6025dde3 100644
--- a/java/openjfx8-devel/distinfo
+++ b/java/openjfx8-devel/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1500739313
-SHA256 (openjfx8-20170722.tar.gz) = b11fb19e7a05802754505c95dc247013941eb0beb5b1221ed8477997aad1344b
-SIZE (openjfx8-20170722.tar.gz) = 109167999
+TIMESTAMP = 1506878786
+SHA256 (openjfx8-8u172-b00.tar.gz) = b6689302cb215b22b0b673d47b3738ac48a423149f2e047dbdebbc87fbefc8ac
+SIZE (openjfx8-8u172-b00.tar.gz) = 109884684
diff --git a/java/openjfx8-devel/files/bsd.gradle b/java/openjfx8-devel/files/bsd.gradle
new file mode 100644
index 000000000000..2e1e63566336
--- /dev/null
+++ b/java/openjfx8-devel/files/bsd.gradle
@@ -0,0 +1,258 @@
+/*
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+ext.BSD = [:]
+
+// Declare whether this particular target file applies to the current system
+BSD.canBuild = IS_BSD;
+if (!BSD.canBuild) return;
+
+// All desktop related packages should be built
+BSD.compileSwing = true;
+BSD.compileSWT = true;
+BSD.compileFXPackager = true;
+
+// Libraries end up in the sdk/rt/lib/$OS_ARCH directory for freebsd
+BSD.libDest = "lib/$OS_ARCH"
+
+// Lambda for naming the generated libs
+BSD.library = { name -> return "lib${name}.so" as String }
+
+// A set of common parameters to use for both compiling and linking
+def commonFlags = [
+ "-fno-strict-aliasing", "-fPIC", "-fno-omit-frame-pointer", // optimization flags
+ "-W", "-Wall", "-Wno-unused", "-Wno-parentheses", "-Werror=implicit-function-declaration"] // warning flags
+
+if (!IS_64) {
+ commonFlags += "-m32"
+}
+
+// Specify the compilation parameters and link parameters
+def ccFlags = [
+ commonFlags, "-I$JDK_HOME/include", "-I$JDK_HOME/include/freebsd", "-c",
+ IS_DEBUG_NATIVE ? ["-ggdb", "-DVERBOSE"] : ["-O2", "-DNDEBUG"]].flatten()
+//ccFlags.addAll(["-Wnon-virtual-dtor", "-Woverloaded-virtual", "-std=c++0x"])
+def linkFlags = ["-shared", commonFlags].flatten()
+
+// Create $buildDir/bsd_tools.properties file and load props from it
+setupTools("bsd_tools",
+ { propFile ->
+ ByteArrayOutputStream results = new ByteArrayOutputStream();
+ exec {
+ commandLine("pkg-config", "--cflags", "gtk+-2.0", "gthread-2.0", "xtst");
+ setStandardOutput(results);
+ }
+ propFile << "cflags=" << results.toString().trim() << "\n";
+
+ results = new ByteArrayOutputStream();
+ exec {
+ commandLine "pkg-config", "--libs", "gtk+-2.0", "gthread-2.0", "xtst"
+ standardOutput = results
+ }
+ propFile << "libs=" << results.toString().trim();
+ },
+ { properties ->
+ ccFlags.addAll(properties.getProperty("cflags").split(" "))
+ linkFlags.addAll(properties.getProperty("libs").split(" "))
+ }
+)
+
+def pangoCCFlags = ["-D_ENABLE_PANGO"];
+def pangoLinkFlags = [];
+setupTools("bsd_pango_tools",
+ { propFile ->
+ ByteArrayOutputStream results = new ByteArrayOutputStream();
+ exec {
+ commandLine "pkg-config", "--cflags", "pangoft2"
+ standardOutput = results
+ }
+ propFile << "cflags=" << results.toString().trim() << "\n";
+
+ results = new ByteArrayOutputStream();
+ exec {
+ commandLine "pkg-config", "--libs", "pangoft2"
+ standardOutput = results
+ }
+ propFile << "libs=" << results.toString().trim();
+ },
+ { properties ->
+ pangoCCFlags.addAll(properties.getProperty("cflags").split(" "))
+ pangoLinkFlags.addAll(properties.getProperty("libs").split(" "))
+ }
+)
+
+def freetypeCCFlags = [ext.IS_COMPILE_PANGO ? "-D_ENABLE_PANGO" :
+ ext.IS_COMPILE_HARFBUZZ ? "-D_ENABLE_HARFBUZZ" : ""]
+def freetypeLinkFlags = []
+setupTools("bsd_freetype_tools",
+ { propFile ->
+ ByteArrayOutputStream results = new ByteArrayOutputStream();
+ exec {
+ commandLine "pkg-config", "--cflags", "freetype2"
+ standardOutput = results
+ }
+ propFile << "cflags=" << results.toString().trim() << "\n";
+
+ results = new ByteArrayOutputStream();
+ exec {
+ commandLine "pkg-config", "--libs", "freetype2"
+ standardOutput = results
+ }
+ propFile << "libs=" << results.toString().trim();
+ },
+ { properties ->
+ freetypeCCFlags.addAll(properties.getProperty("cflags").split(" "))
+ freetypeLinkFlags.addAll(properties.getProperty("libs").split(" "))
+ }
+)
+
+def compiler = IS_COMPILE_PARFAIT ? "parfait-gcc" : "cc";
+def linker = IS_COMPILE_PARFAIT ? "parfait-g++" : "c++";
+
+BSD.glass = [:]
+BSD.glass.javahInclude = [
+ "com/sun/glass/events/**",
+ "com/sun/glass/ui/*",
+ "com/sun/glass/ui/gtk/*"]
+BSD.glass.nativeSource = file("modules/graphics/src/main/native-glass/gtk")
+BSD.glass.compiler = compiler
+BSD.glass.ccFlags = [ccFlags, "-Werror"].flatten()
+BSD.glass.linker = linker
+BSD.glass.linkFlags = [linkFlags].flatten()
+BSD.glass.lib = "glass"
+
+BSD.decora = [:]
+BSD.decora.compiler = compiler
+BSD.decora.ccFlags = [ccFlags, "-ffast-math"].flatten()
+BSD.decora.linker = linker
+BSD.decora.linkFlags = [linkFlags].flatten()
+BSD.decora.lib = "decora_sse"
+
+BSD.prism = [:]
+BSD.prism.javahInclude = ["com/sun/prism/impl/**/*", "com/sun/prism/PresentableState*"]
+BSD.prism.nativeSource = file("modules/graphics/src/main/native-prism")
+BSD.prism.compiler = compiler
+BSD.prism.ccFlags = [ccFlags, "-DINLINE=inline"].flatten()
+BSD.prism.linker = linker
+BSD.prism.linkFlags = [linkFlags].flatten()
+BSD.prism.lib = "prism_common"
+
+BSD.prismSW = [:]
+BSD.prismSW.javahInclude = ["com/sun/pisces/**/*"]
+BSD.prismSW.nativeSource = file("modules/graphics/src/main/native-prism-sw")
+BSD.prismSW.compiler = compiler
+BSD.prismSW.ccFlags = [ccFlags, "-DINLINE=inline"].flatten()
+BSD.prismSW.linker = linker
+BSD.prismSW.linkFlags = [linkFlags].flatten()
+BSD.prismSW.lib = "prism_sw"
+
+BSD.launcher = [:]
+BSD.launcher.compiler = compiler
+BSD.launcher.ccFlags = ["-DJAVAARCH=\"$OS_ARCH\"", "-I$JDK_HOME/include", "-I$JDK_HOME/include/freebsd", "-c"]
+BSD.launcher.linker = linker
+BSD.launcher.linkFlags = ["-ldl"]
+if (!IS_64) {
+ BSD.launcher.ccFlags += "-m32"
+ BSD.launcher.linkFlags += "-m32"
+}
+
+BSD.launcherlibrary = [:]
+BSD.launcherlibrary.compiler = compiler
+BSD.launcherlibrary.ccFlags = ["-DJAVAARCH=\"$OS_ARCH\"", "-I$JDK_HOME/include", "-I$JDK_HOME/include/freebsd", "-c", "-fPIC"]
+BSD.launcherlibrary.linker = linker
+BSD.launcherlibrary.linkFlags = ["-ldl", "-lpthread", "-shared"]
+if (!IS_64) {
+ BSD.launcherlibrary.ccFlags += "-m32"
+ BSD.launcherlibrary.linkFlags += "-m32"
+}
+
+BSD.iio = [:]
+BSD.iio.javahInclude = ["com/sun/javafx/iio/**/*"]
+BSD.iio.nativeSource = [file("modules/graphics/src/main/native-iio")]
+BSD.iio.compiler = compiler
+BSD.iio.ccFlags = [ccFlags].flatten()
+BSD.iio.linker = linker
+BSD.iio.linkFlags = [linkFlags].flatten()
+BSD.iio.linkFlags += "-ljpeg"
+BSD.iio.lib = "javafx_iio"
+
+BSD.prismES2 = [:]
+BSD.prismES2.javahInclude = ["com/sun/prism/es2/**/*"]
+BSD.prismES2.nativeSource = [
+ file("modules/graphics/src/main/native-prism-es2"),
+ file("modules/graphics/src/main/native-prism-es2/GL"),
+ file("modules/graphics/src/main/native-prism-es2/x11")
+]
+BSD.prismES2.compiler = compiler
+BSD.prismES2.ccFlags = ["-DFREEBSD", ccFlags].flatten()
+BSD.prismES2.linker = linker
+BSD.prismES2.linkFlags = [linkFlags, "-lX11", "-lXxf86vm", "-lGL"].flatten()
+BSD.prismES2.lib = "prism_es2"
+
+def closedDir = file("$projectDir/../rt-closed")
+BSD.font = [:]
+BSD.font.javahInclude = [
+ "com/sun/javafx/font/**/*",
+ "com/sun/javafx/text/**/*"]
+BSD.font.compiler = compiler
+BSD.font.nativeSource = [file("modules/graphics/src/main/native-font")]
+BSD.font.ccFlags = ["-DJFXFONT_PLUS", ccFlags].flatten()
+BSD.font.linker = linker
+BSD.font.linkFlags = [linkFlags].flatten()
+BSD.font.lib = "javafx_font"
+
+BSD.fontT2K = [:]
+BSD.fontT2K.javahInclude = ["com/sun/javafx/font/t2k/**/*"]
+BSD.fontT2K.nativeSource = [
+ file("$closedDir/javafx-font-t2k-native/src"),
+ file("$closedDir/javafx-font-t2k-native/src/layout")]
+BSD.fontT2K.compiler = compiler
+BSD.fontT2K.ccFlags = ["-DJFXFONT_PLUS", "-DLE_STANDALONE", ccFlags].flatten()
+BSD.fontT2K.linker = linker
+BSD.fontT2K.linkFlags = [linkFlags].flatten()
+BSD.fontT2K.lib = "javafx_font_t2k"
+
+BSD.fontFreetype = [:]
+BSD.fontFreetype.javahInclude = ["com/sun/javafx/font/freetype/OSFreetype.class"]
+BSD.fontFreetype.nativeSource = ["src/main/native-font/freetype.c"]
+BSD.fontFreetype.compiler = compiler
+BSD.fontFreetype.ccFlags = ["-DJFXFONT_PLUS", ccFlags, freetypeCCFlags].flatten()
+BSD.fontFreetype.linker = linker
+BSD.fontFreetype.linkFlags = [linkFlags, freetypeLinkFlags].flatten()
+BSD.fontFreetype.lib = "javafx_font_freetype"
+
+BSD.fontPango = [:]
+BSD.fontPango.javahInclude = ["com/sun/javafx/font/freetype/OSPango.class"]
+BSD.fontPango.nativeSource = ["src/main/native-font/pango.c"]
+BSD.fontPango.compiler = compiler
+BSD.fontPango.ccFlags = ["-DJFXFONT_PLUS", ccFlags, pangoCCFlags].flatten()
+BSD.fontPango.linker = linker
+BSD.fontPango.linkFlags = [linkFlags, pangoLinkFlags].flatten()
+BSD.fontPango.lib = "javafx_font_pango"
+
+BSD.media = [:]
+BSD.media.compiler = compiler
+BSD.media.linker = linker
+BSD.media.lib = "ar"
diff --git a/java/openjfx8-devel/files/gstsndio.c b/java/openjfx8-devel/files/gstsndio.c
new file mode 100644
index 000000000000..927ccef2f5af
--- /dev/null
+++ b/java/openjfx8-devel/files/gstsndio.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) <2008> Jacob Meuser <jakemsr@sdf.lonestar.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "sndiosink.h"
+
+GST_DEBUG_CATEGORY (gst_sndio_debug);
+
+gboolean
+plugin_init_alsa (GstPlugin * plugin)
+{
+ if (!gst_element_register (plugin, "bsdaudiosink", GST_RANK_PRIMARY,
+ GST_TYPE_SNDIOSINK)) {
+ return FALSE;
+ }
+
+ GST_DEBUG_CATEGORY_INIT (gst_sndio_debug, "sndio", 0, "sndio elements");
+
+#ifdef ENABLE_NLS
+ GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE,
+ LOCALEDIR);
+ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+#endif /* ENABLE_NLS */
+
+ return TRUE;
+}
diff --git a/java/openjfx8-devel/files/patch-build.gradle b/java/openjfx8-devel/files/patch-build.gradle
index 2cca1c17a65d..3a37d8389c78 100644
--- a/java/openjfx8-devel/files/patch-build.gradle
+++ b/java/openjfx8-devel/files/patch-build.gradle
@@ -1,40 +1,134 @@
---- build.gradle.orig 2017-07-20 23:39:54 UTC
+--- build.gradle.orig 2017-09-08 16:56:55 UTC
+++ build.gradle
-@@ -344,7 +344,7 @@ ext.SWT_FILE_NAME = IS_MAC ? "org.eclipse.swt.cocoa.ma
+@@ -251,6 +251,7 @@ ext.IS_64 = OS_ARCH.toLowerCase().contains("64")
+ ext.IS_MAC = OS_NAME.contains("mac") || OS_NAME.contains("darwin")
+ ext.IS_WINDOWS = OS_NAME.contains("windows")
+ ext.IS_LINUX = OS_NAME.contains("linux")
++ext.IS_BSD = OS_NAME.contains("freebsd") || OS_NAME.contains("dragonfly")
+
+ // Get the JDK_HOME automatically based on the version of Java used to execute gradle. Or, if specified,
+ // use a user supplied JDK_HOME, STUB_RUNTIME, JAVAC, and/or JAVAH, all of which may be specified
+@@ -311,7 +312,7 @@ defineProperty("COMPILE_MEDIA", "false")
+ ext.IS_COMPILE_MEDIA = Boolean.parseBoolean(COMPILE_MEDIA)
+
+ // COMPILE_PANGO specifies whether to build javafx_font_pango.
+-defineProperty("COMPILE_PANGO", "${IS_LINUX}")
++defineProperty("COMPILE_PANGO", "${IS_LINUX || IS_BSD}")
+ ext.IS_COMPILE_PANGO = Boolean.parseBoolean(COMPILE_PANGO)
+
+ // COMPILE_HARFBUZZ specifies whether to use Harfbuzz.
+@@ -342,7 +343,8 @@ ext.SWT_FILE_NAME = IS_MAC ? "org.eclipse.swt.cocoa.ma
+ IS_WINDOWS && IS_64 ? "org.eclipse.swt.win32.win32.x86_64_3.7.2.v3740f" :
IS_WINDOWS && !IS_64 ? "org.eclipse.swt.win32.win32.x86_3.7.2.v3740f" :
IS_LINUX && IS_64 ? "org.eclipse.swt.gtk.linux.x86_64_3.7.2.v3740f" :
- IS_LINUX && !IS_64 ? "org.eclipse.swt.gtk.linux.x86_3.7.2.v3740f" :
-- IS_BSD ? "/usr/local/share/java/classes/swt-devel.jar" : ""
-+ IS_BSD ? "%%PREFIX%%/share/java/classes/swt-devel.jar" : ""
+- IS_LINUX && !IS_64 ? "org.eclipse.swt.gtk.linux.x86_3.7.2.v3740f" : ""
++ IS_LINUX && !IS_64 ? "org.eclipse.swt.gtk.linux.x86_3.7.2.v3740f" :
++ IS_BSD ? "/usr/local/share/java/classes/swt-devel.jar" : ""
// Build javadocs only if BUILD_JAVADOC=true
defineProperty("BUILD_JAVADOC", "false")
-@@ -1163,7 +1163,8 @@ allprojects {
+@@ -402,6 +404,12 @@ if (IS_MAC) {
+ defineProperty("NUM_COMPILE_THREADS", "${Runtime.runtime.availableProcessors()}")
+ }
+
++if (IS_BSD) {
++ ext.MAKE_CMD = "gmake"
++} else {
++ ext.MAKE_CMD = "make"
++}
++
+ //
+ // The next three sections of properties are used to generate the
+ // VersionInfo class, and the Windows DLL manifest.
+@@ -442,7 +450,7 @@ defineProperty("RELEASE_MILESTONE", jfxReleaseMileston
+ // Check whether the COMPILE_TARGETS property has been specified (if so, it was done by
+ // the user and not by this script). If it has not been defined then default
+ // to building the normal desktop build for this machine
+-project.ext.set("defaultHostTarget", IS_MAC ? "mac" : IS_WINDOWS ? "win" : IS_LINUX ? "linux" : "");
++project.ext.set("defaultHostTarget", IS_MAC ? "mac" : IS_WINDOWS ? "win" : IS_LINUX ? "linux" : IS_BSD ? "bsd" : "");
+ defineProperty("COMPILE_TARGETS", "$defaultHostTarget")
+
+ // Flag indicating whether to import cross compile tools
+@@ -549,7 +557,7 @@ void fetchExternalTools(String configName, List packag
+ def File pkgdir = file("$destdir/$basename")
+
+ if (pkgname.endsWith(".tgz")) {
+- if (IS_LINUX || IS_MAC) {
++ if (IS_BSD || IS_LINUX || IS_MAC) {
+ // use native tar to support symlinks
+ pkgdir.mkdirs()
+ exec {
+@@ -674,7 +682,7 @@ compileTargets { t ->
+ if (!targetProperties.containsKey('includeMonocle')) targetProperties.includeMonocle = false
+ if (!targetProperties.containsKey('includeEGL')) targetProperties.includeEGL = false
+
+- if (!targetProperties.containsKey('includeGTK')) targetProperties.includeGTK = IS_LINUX
++ if (!targetProperties.containsKey('includeGTK')) targetProperties.includeGTK = IS_LINUX || IS_BSD
+
+ // This value is used to under ./build/${sdkDirName} to allow for
+ // a common name for the hosted build (for use when building apps)
+@@ -706,7 +714,7 @@ compileTargets { t ->
+ // at present building on PI is not supported, but we would only need to make
+ // some changes on assumptions on what should be built (like SWT / Swing) and
+ // such and we could probably make it work.
+-if (!IS_MAC && !IS_WINDOWS && !IS_LINUX) logger.error("Unsupported build OS ${OS_NAME}")
++if (!IS_MAC && !IS_WINDOWS && !IS_LINUX && !IS_BSD) logger.error("Unsupported build OS ${OS_NAME}")
+ if (IS_WINDOWS && OS_ARCH != "x86" && OS_ARCH != "amd64") {
+ throw new Exception("Unknown and unsupported build architecture: $OS_ARCH")
+ } else if (IS_MAC && OS_ARCH != "x86_64") {
+@@ -1168,7 +1176,8 @@ allprojects {
// By default all of our projects require junit for testing so we can just
// setup this dependency here.
dependencies {
- testCompile group: "junit", name: "junit", version: "4.8.2"
-+ testCompile files("%%PREFIX%%/share/java/classes/junit4.jar",
-+ "%%PREFIX%%/share/java/classes/hamcrest.jar")
++ testCompile files("/usr/local/share/java/classes/junit4.jar",
++ "/usr/local/share/java/classes/hamcrest.jar")
if (BUILD_CLOSED && DO_JCOV) {
testCompile name: "jcov"
}
-@@ -1306,11 +1307,10 @@ project(":graphics") {
- } else {
- compile name: SWT_FILE_NAME
- }
+@@ -1306,12 +1315,15 @@ project(":graphics") {
+
+ dependencies {
+ compile project(":base"), BUILD_SRC
+- compile name: SWT_FILE_NAME
- stubCompile group: "junit", name: "junit", version: "4.8.2",
-+ stubCompile files("%%PREFIX%%/share/java/classes/junit4.jar",
-+ "%%PREFIX%%/share/java/classes/hamcrest.jar"),
++ if (IS_BSD) {
++ compile files(SWT_FILE_NAME)
++ } else {
++ compile name: SWT_FILE_NAME
++ }
++ stubCompile files("/usr/local/share/java/classes/junit4.jar",
++ "/usr/local/share/java/classes/hamcrest.jar"),
project(":base").sourceSets.test.output, sourceSets.main.output
- antlr3 group: "org.antlr", name: "antlr", version: "3.1.3"
- antlr3 group: "org.antlr", name: "antlr-runtime", version: "3.1.3"
- antlr3 group: "org.antlr", name: "stringtemplate", version: "3.2"
-+ antlr3 files("%%PREFIX%%/share/java/classes/antlr-3.5.2-complete.jar")
++ antlr3 files("/usr/local/share/java/classes/antlr-3.5.2-complete.jar")
}
// Create a single "native" task which will depend on all the individual native tasks for graphics
-@@ -1600,9 +1600,7 @@ project(":graphics") {
+@@ -1460,7 +1472,7 @@ project(":graphics") {
+ workingDir = "modules/graphics"
+ main = settings.generator
+ classpath = configurations.compile + configurations.antlr3
+- classpath += files("$buildDir/classes/main")
++ classpath += files("$buildDir/classes/java/main")
+ classpath += files("$buildDir/classes/jsl-compilers/decora")
+ args = ["-i", sourceDir, "-o", destinationDir, "-t", "-pkg", "com/sun/scenario/effect", "$settings.outputs", "$settings.fileName"]
+ jvmArgs "-Djava.ext.dirs="
+@@ -1471,9 +1483,9 @@ project(":graphics") {
+ task generateDecoraNativeHeaders(type: JavaHeaderTask, dependsOn: compileDecoraJavaShaders) {
+ description = "Generates JNI Headers for Decora SSE Natives"
+ source file("$buildDir/classes/jsl-decora")
+- source file("$buildDir/classes/main")
++ source file("$buildDir/classes/java/main")
+ include("com/sun/scenario/effect/impl/sw/sse/*");
+- classpath = files("$buildDir/classes/main", "$buildDir/classes/jsl-decora")
++ classpath = files("$buildDir/classes/java/main", "$buildDir/classes/jsl-decora")
+ output = file("$buildDir/generated-src/headers/jsl-decora")
+ }
+
+@@ -1601,9 +1613,7 @@ project(":graphics") {
copy {
into libsDir
from f.getParentFile()
@@ -45,20 +139,50 @@
includeEmptyDirs = false
}
// Have to rename the swt jar because it is some platform specific name but
-@@ -1789,7 +1787,7 @@ project(":fxpackager") {
+@@ -1650,7 +1660,7 @@ project(":controls") {
+ javaexec {
+ executable = JAVA
+ workingDir = "modules/controls"
+- classpath files("$buildDir/classes/main",
++ classpath files("$buildDir/classes/java/main",
+ project(":graphics").sourceSets.main.output,
+ project(":base").sourceSets.main.output)
+ main = "com.sun.javafx.css.parser.Css2Bin"
+@@ -1687,7 +1697,11 @@ project(":swt") {
+ }
+ dependencies {
+ compile BUILD_SRC, project(":base"), project(":graphics")
+- compile name: SWT_FILE_NAME
++ if (IS_BSD) {
++ compile files(SWT_FILE_NAME)
++ } else {
++ compile name: SWT_FILE_NAME
++ }
+ }
+ }
+
+@@ -1786,7 +1800,7 @@ project(":fxpackager") {
}
dependencies {
- compile group: "org.apache.ant", name: "ant", version: "1.8.2"
-+ compile files("%%PREFIX%%/share/java/apache-ant/lib/ant.jar")
++ compile files("/usr/local/share/java/apache-ant/lib/ant.jar")
}
// When producing the jar, we need to relocate a few class files
-@@ -2049,21 +2047,6 @@ project(":fxpackager") {
+@@ -2037,7 +2051,7 @@ project(":fxpackager") {
+ description = "Creates the packager.jar"
+ archiveName = "packager.jar";
+ includeEmptyDirs = false
+- from("$buildDir/classes/main");
++ from("$buildDir/classes/java/main");
+ from("$buildDir/resources/main");
+ include('jdk/packager/**')
+@@ -2047,21 +2061,6 @@ project(":fxpackager") {
jar.dependsOn buildJavaPackager
jar.dependsOn packagerJar
--
+
- classes << {
- // Copy all of the download libraries to libs directory for the sake of the IDEs
- File libsDir = rootProject.file("build/libs");
@@ -73,6 +197,261 @@
- }
- }
- }
-
+-
task packagerFakeJar(type: Jar) {
dependsOn compileTestJava
+ from compileTestJava.destinationDir
+@@ -2240,7 +2239,7 @@ project(":media") {
+
+ doLast {
+ exec {
+- commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/jfxmedia/projects/${projectDir}")
++ commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/jfxmedia/projects/${projectDir}")
+ args("JAVA_HOME=${JDK_HOME}", "GENERATED_HEADERS_DIR=${generatedHeadersDir}",
+ "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=jfxmedia",
+ "COMPILE_PARFAIT=${compileParfait}")
+@@ -2250,7 +2249,7 @@ project(":media") {
+ args(IS_64 ? "ARCH=x64" : "ARCH=x32", "RESOURCE=${nativeOutputDir}/${buildType}/${WIN.media.jfxmediaRcFile}")
+ } else {
+ args ("CC=${mediaProperties.compiler}", "LINK=${mediaProperties.linker}", "LIB=${mediaProperties.lib}")
+- if (t.name == "linux") {
++ if (t.name == "linux" || t.name == "bsd") {
+ args(IS_64 ? "ARCH=x64" : "ARCH=x32")
+ }
+
+@@ -2272,7 +2271,7 @@ project(":media") {
+ enabled = IS_COMPILE_MEDIA
+ doLast {
+ exec {
+- commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/gstreamer-lite")
++ commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/gstreamer-lite")
+ args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=gstreamer-lite")
+
+ if (t.name == "win") {
+@@ -2280,7 +2279,7 @@ project(":media") {
+ args(IS_64 ? "ARCH=x64" : "ARCH=x32", "RESOURCE=${nativeOutputDir}/${buildType}/${WIN.media.gstreamerRcFile}")
+ } else {
+ args ("CC=${mediaProperties.compiler}", "LINK=${mediaProperties.linker}", "LIB=${mediaProperties.lib}")
+- if (t.name == "linux") {
++ if (t.name == "linux" || t.name == "bsd") {
+ args(IS_64 ? "ARCH=x64" : "ARCH=x32")
+ }
+ }
+@@ -2301,7 +2300,7 @@ project(":media") {
+
+ doLast {
+ exec {
+- commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/fxplugins")
++ commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/fxplugins")
+ args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=fxplugins",
+ "ON2_SRCDIR=${project.ext.ON2_SRCDIR}", "ON2_LIB=${project.ext.ON2_LIB}")
+
+@@ -2318,7 +2317,7 @@ project(":media") {
+ args(IS_64 ? "ARCH=x64" : "ARCH=x32", "RESOURCE=${nativeOutputDir}/${buildType}/${WIN.media.fxpluginsRcFile}")
+ } else {
+ args ("CC=${mediaProperties.compiler}", "LINK=${mediaProperties.linker}", "LIB=${mediaProperties.lib}")
+- if (t.name == "linux") {
++ if (t.name == "linux" || t.name == "bsd") {
+ args(IS_64 ? "ARCH=x64" : "ARCH=x32")
+ }
+ }
+@@ -2328,7 +2327,7 @@ project(":media") {
+
+ buildNative.dependsOn buildPlugins
+
+- if (t.name == "linux") {
++ if (t.name == "linux" || t.name == "bsd") {
+ def buildAVPlugin = task( "buildAVPlugin", dependsOn: [buildPlugins]) {
+ enabled = IS_COMPILE_MEDIA
+
+@@ -2339,7 +2338,7 @@ project(":media") {
+ File dir = file(libavDir)
+ if (dir.exists()) {
+ exec {
+- commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/linux/avplugin")
++ commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${t.name}/avplugin")
+ args("CC=${mediaProperties.compiler}", "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}",
+ "BASE_NAME=avplugin", "VERSION=${version}", "LIBAV_DIR=${libavDir}",
+ "SUFFIX=", IS_64 ? "ARCH=x64" : "ARCH=x32")
+@@ -2352,7 +2351,7 @@ project(":media") {
+ File dir = file(libavDir)
+ if (dir.exists()) {
+ exec {
+- commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/linux/avplugin")
++ commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${t.name}/avplugin")
+ args("CC=${mediaProperties.compiler}", "LINKER=${mediaProperties.linker}",
+ "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}",
+ "BASE_NAME=avplugin", "VERSION=${version}", "LIBAV_DIR=${libavDir}",
+@@ -2363,7 +2362,7 @@ project(":media") {
+ } else {
+ // Building fxavcodec plugin (libav plugin)
+ exec {
+- commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/linux/avplugin")
++ commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/linux/avplugin")
+ args("CC=${mediaProperties.compiler}", "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}",
+ "BASE_NAME=avplugin", IS_64 ? "ARCH=x64" : "ARCH=x32")
+ }
+@@ -2411,7 +2410,7 @@ project(":media") {
+ doLast {
+ exec {
+ environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
+- commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/glib-lite")
++ commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/glib-lite")
+ args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=glib-lite",
+ IS_64 ? "ARCH=x64" : "ARCH=x32", "RESOURCE=${nativeOutputDir}/${buildType}/${WIN.media.glibRcFile}")
+ }
+@@ -2424,7 +2423,7 @@ project(":media") {
+ enabled = IS_COMPILE_MEDIA
+ doLast {
+ exec {
+- commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/glib-lite")
++ commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/glib-lite")
+ args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=glib-lite")
+ args ("CC=${mediaProperties.compiler}", "LINK=${mediaProperties.linker}", "LIB=${mediaProperties.lib}")
+ }
+@@ -2477,7 +2476,7 @@ project(":web") {
+
+ task generateHeaders(dependsOn: compileJava) {
+ doLast {
+- def classpath = files("$buildDir/classes/main",
++ def classpath = files("$buildDir/classes/java/main",
+ project(":graphics").sourceSets.main.output.classesDir)
+ def dest = file("$buildDir/generated-src/headers");
+ mkdir dest;
+@@ -2525,7 +2524,7 @@ project(":web") {
+
+ compileTargets { t ->
+ def targetProperties = project.rootProject.ext[t.upper]
+- def classifier = (t.name != "linux" && t.name != "win") ? t.name :
++ def classifier = (t.name != "linux" && t.name != "bsd" && t.name != "win") ? t.name :
+ IS_64 ? "${t.name}-amd64" : "${t.name}-i586"
+
+ def webkitOutputDir = cygpath("$buildDir/${t.name}")
+@@ -2586,6 +2585,9 @@ project(":web") {
+ targetCpuBitDepthSwitch = "--32-bit"
+ }
+
++ cmakeArgs += " -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
++ cmakeArgs += " -DCMAKE_C_COMPILER:STRING=${System.getenv("CC")}"
++ cmakeArgs += " -DCMAKE_CXX_COMPILER:STRING=${System.getenv("CXX")}"
+ commandLine("perl", "Tools/Scripts/build-webkit",
+ "--java", "--icu-unicode", targetCpuBitDepthSwitch,
+ "--cmakeargs=${cmakeArgs}")
+@@ -2628,7 +2630,7 @@ project(":web") {
+ task drtJar(type: Jar, dependsOn: compileJava) {
+ archiveName = "drt.jar"
+ destinationDir = file("$buildDir/test")
+- from "$buildDir/classes/main"
++ from "$buildDir/classes/java/main"
+ include drtClasses
+ }
+ if (IS_COMPILE_WEBKIT) {
+@@ -2880,22 +2882,22 @@ compileTargets { t ->
+ description = "Creates the jfxrt.jar for the $t.name target"
+ archiveName = "build/${sdkDirName}/rt/lib/ext/jfxrt.jar";
+ includeEmptyDirs = false
+- from("modules/base/build/classes/main",
++ from("modules/base/build/classes/java/main",
+ "modules/base/build/resources/main",
+- "modules/builders/build/classes/main",
+- "modules/graphics/build/classes/main",
++ "modules/builders/build/classes/java/main",
++ "modules/graphics/build/classes/java/main",
+ "modules/graphics/build/resources/main",
+- "modules/controls/build/classes/main",
++ "modules/controls/build/classes/java/main",
+ "modules/controls/build/resources/main",
+- "modules/fxml/build/classes/main",
++ "modules/fxml/build/classes/java/main",
+ "modules/fxml/build/resources/main",
+ "modules/graphics/build/classes/jsl-decora",
+ "modules/graphics/build/resources/jsl-decora",
+ "modules/graphics/build/classes/jsl-prism",
+ "modules/graphics/build/resources/jsl-prism",
+- "modules/media/build/classes/main",
++ "modules/media/build/classes/java/main",
+ "modules/media/build/resources/main")
+- if (COMPILE_SWING) from ("modules/swing/build/classes/main", "modules/swing/build/resources/main")
++ if (COMPILE_SWING) from ("modules/swing/build/classes/java/main", "modules/swing/build/resources/main")
+
+ if (!IS_MAC) {
+ exclude ("modules/media/build/classes/main/com/sun/media/jfxmediaimpl/platform/osx/**",
+@@ -2960,7 +2962,7 @@ compileTargets { t ->
+ "modules/web/build/resources/ios",
+ "modules/extensions/build/classes/ios")
+ } else {
+- from ("modules/web/build/classes/main", "modules/web/build/resources/main")
++ from ("modules/web/build/classes/java/main", "modules/web/build/resources/main")
+ }
+
+ exclude("**/javafx/embed/swt/**")
+@@ -3000,8 +3002,8 @@ compileTargets { t ->
+ description = "Creates the jfxswt.jar for the $t.name target"
+ archiveName = "build/${sdkDirName}/rt/lib/jfxswt.jar";
+ includeEmptyDirs = false
+- from("modules/swt/build/classes/main");
+- from("modules/builders/build/classes/main");
++ from("modules/swt/build/classes/java/main");
++ from("modules/builders/build/classes/java/main");
+ include("**/javafx/embed/swt/**")
+ exclude("**/*.java"); // Builder java files are in build/classes and should be excluded
+
+@@ -3022,7 +3024,7 @@ compileTargets { t ->
+ description = "Creates the javafx-mx.jar"
+ archiveName = "build/${sdkDirName}/lib/javafx-mx.jar";
+ includeEmptyDirs = false
+- from "modules/jmx/build/classes/main"
++ from "modules/jmx/build/classes/java/main"
+ from "modules/jmx/build/resources/main"
+ dependsOn project(":jmx").assemble
+ }
+@@ -3077,7 +3079,7 @@ compileTargets { t ->
+ // OSX media natives
+ [ "jfxmedia_qtkit", "jfxmedia_avf", "glib-lite" ].each { name ->
+ from ("modules/media/build/native/${t.name}/${mediaBuildType}/${library(name)}") }
+- } else if (t.name == "linux") {
++ } else if (t.name == "linux" || t.name == "bsd") {
+ from("modules/media/build/native/${t.name}/${mediaBuildType}") { include "libavplugin*.so" }
+ } else from ("modules/media/build/native/${t.name}/${mediaBuildType}/${library("glib-lite")}")
+ } else {
+@@ -3090,7 +3092,7 @@ compileTargets { t ->
+ // copy libjfxmedia_{avf,qtkit}.dylib if they exist
+ [ "jfxmedia_qtkit", "jfxmedia_avf", "glib-lite" ].each { name ->
+ from ("$LIBRARY_STUB/${library(name)}") }
+- } else if (t.name == "linux") {
++ } else if (t.name == "linux" || t.name == "bsd") {
+ from(LIBRARY_STUB) { include "libavplugin*.so" }
+ }
+ else if (t.name != "android" && t.name != "dalvik" ) {
+@@ -3155,7 +3157,7 @@ compileTargets { t ->
+ }
+
+ // Copy over the javapackager executable
+- if (t.name == "win" || t.name == "linux" || t.name == "mac") {
++ if (t.name == "win" || t.name == "linux" || t.name == "bsd" || t.name == "mac") {
+ copy {
+ from "modules/fxpackager/build/javapackager"
+ into "build/${sdkDirName}/bin"
+@@ -3208,10 +3210,11 @@ ext.JFXRT_CP =
+ project(":fxml").sourceSets.main.output.classesDir,
+ project(":swing").sourceSets.main.output.classesDir, //NOTE - used by 3Dviewer
+ project(":builders").sourceSets.main.output.classesDir,
+- "modules/media/build/classes/main",
+- "modules/web/build/classes/main",
++ "modules/media/build/classes/java/main",
++ "modules/web/build/classes/java/main",
+ )
+
++/*
+ project(":apps") {
+ // The apps build is Ant based, and gradle lets us "import" ant build.xml
+ // into our configuration.
+@@ -3256,7 +3259,7 @@ project(":apps") {
+ }
+ rootProject.clean.dependsOn(appsClean)
+ }
+-}
++} */
+
+ /******************************************************************************
+ * *
diff --git a/java/openjfx8-devel/files/patch-build.properties b/java/openjfx8-devel/files/patch-build.properties
new file mode 100644
index 000000000000..abf994ce7854
--- /dev/null
+++ b/java/openjfx8-devel/files/patch-build.properties
@@ -0,0 +1,17 @@
+http://hg.openjdk.java.net/openjfx/8u/rt/rev/aefb29b5a599
+
+--- build.properties.orig 2017-09-08 16:56:55 UTC
++++ build.properties
+@@ -40,10 +40,10 @@ jfx.release.milestone=ea
+ jfx.release.suffix=-ea
+
+ # UPDATE THE FOLLOWING VALUES FOR A NEW RELEASE
+-jfx.release.name=8u162
++jfx.release.name=8u172
+ jfx.release.major.version=8
+ jfx.release.minor.version=0
+-jfx.release.micro.version=162
++jfx.release.micro.version=172
+
+ ##############################################################################
+ #
diff --git a/java/openjfx8-devel/files/patch-buildSrc_build.gradle b/java/openjfx8-devel/files/patch-buildSrc_build.gradle
index 51546c2e06ae..bb4201fd6f0a 100644
--- a/java/openjfx8-devel/files/patch-buildSrc_build.gradle
+++ b/java/openjfx8-devel/files/patch-buildSrc_build.gradle
@@ -1,4 +1,4 @@
---- buildSrc/build.gradle.orig 2017-07-20 23:39:54 UTC
+--- buildSrc/build.gradle.orig 2017-09-08 16:56:55 UTC
+++ buildSrc/build.gradle
@@ -81,11 +81,10 @@ sourceSets {
getConfigurations().create("antlr3");
diff --git a/java/openjfx8-devel/files/patch-icu59 b/java/openjfx8-devel/files/patch-icu59
deleted file mode 100644
index 9e57e957bcb7..000000000000
--- a/java/openjfx8-devel/files/patch-icu59
+++ /dev/null
@@ -1,77 +0,0 @@
-------------------------------------------------------------------------
-r216187 | annulen@yandex.ru | 2017-05-05 00:33:41 +0900 (Fri, 05 May 2017) | 28 lines
-
-Fix compilation with ICU 59.1
-https://bugs.webkit.org/show_bug.cgi?id=171612
-
-Reviewed by Mark Lam.
-
-ICU 59.1 has broken source compatibility. Now it defines UChar as
-char16_t, which does not allow automatic type conversion from unsigned
-short in C++ code.
-
---- modules/web/src/main/native/Source/JavaScriptCore/API/JSStringRef.cpp.orig 2017-07-22 15:59:03 UTC
-+++ modules/web/src/main/native/Source/JavaScriptCore/API/JSStringRef.cpp
-@@ -37,7 +37,7 @@ using namespace WTF::Unicode;
- JSStringRef JSStringCreateWithCharacters(const JSChar* chars, size_t numChars)
- {
- initializeThreading();
-- return &OpaqueJSString::create(chars, numChars).leakRef();
-+ return &OpaqueJSString::create(reinterpret_cast<const UChar*>(chars), numChars).leakRef();
- }
-
- JSStringRef JSStringCreateWithUTF8CString(const char* string)
-@@ -62,7 +62,7 @@ JSStringRef JSStringCreateWithUTF8CString(const char*
- JSStringRef JSStringCreateWithCharactersNoCopy(const JSChar* chars, size_t numChars)
- {
- initializeThreading();
-- return OpaqueJSString::create(StringImpl::createWithoutCopying(chars, numChars)).leakRef();
-+ return OpaqueJSString::create(StringImpl::createWithoutCopying(reinterpret_cast<const UChar*>(chars), numChars)).leakRef();
- }
-
- JSStringRef JSStringRetain(JSStringRef string)
-@@ -87,7 +87,7 @@ const JSChar* JSStringGetCharactersPtr(JSStringRef str
- {
- if (!string)
- return nullptr;
-- return string->characters();
-+ return reinterpret_cast<const JSChar*>(string->characters());
- }
-
- size_t JSStringGetMaximumUTF8CStringSize(JSStringRef string)
---- modules/web/src/main/native/Source/JavaScriptCore/runtime/DateConversion.cpp.orig 2017-07-22 15:59:03 UTC
-+++ modules/web/src/main/native/Source/JavaScriptCore/runtime/DateConversion.cpp
-@@ -107,7 +107,8 @@ String formatDateTime(const GregorianDateTime& t, Date
- #if OS(WINDOWS)
- TIME_ZONE_INFORMATION timeZoneInformation;
- GetTimeZoneInformation(&timeZoneInformation);
-- const WCHAR* timeZoneName = t.isDST() ? timeZoneInformation.DaylightName : timeZoneInformation.StandardName;
-+ const WCHAR* winTimeZoneName = t.isDST() ? timeZoneInformation.DaylightName : timeZoneInformation.StandardName;
-+ String timeZoneName(reinterpret_cast<const UChar*>(winTimeZoneName));
- #else
- struct tm gtm = t;
- char timeZoneName[70];
---- modules/web/src/main/native/Source/WTF/wtf/unicode/java/UnicodeJava.h.orig 2017-07-22 15:59:03 UTC
-+++ modules/web/src/main/native/Source/WTF/wtf/unicode/java/UnicodeJava.h
-@@ -15,21 +15,6 @@
-
- #define CharProp(p) java_lang_Character_##p
-
--#if PLATFORM(JAVA) && OS(WINDOWS)
--typedef wchar_t UChar;
--#else
--typedef uint16_t UChar;
--#endif
--
--// #ifdef UChar32
--// #undef UChar32
--// #endif
--
--#ifndef __UMACHINE_H__ //XXX: recheck
--typedef uint32_t UChar32;
--#endif
--
--#define U_MASK(x) ((uint32_t)1<<(x))
- #define USE_FAST_PATH(c, fast, slow) ((c) <= 0x7F ? fast((char)c) : slow(c))
-
- #define CHECK_PROPERTY(c, mask, isSet) \
diff --git a/java/openjfx8-devel/files/patch-modules_base_src_main_java_com_sun_javafx_PlatformUtil.java b/java/openjfx8-devel/files/patch-modules_base_src_main_java_com_sun_javafx_PlatformUtil.java
index 3d4fd43c82f9..b397e4e53163 100644
--- a/java/openjfx8-devel/files/patch-modules_base_src_main_java_com_sun_javafx_PlatformUtil.java
+++ b/java/openjfx8-devel/files/patch-modules_base_src_main_java_com_sun_javafx_PlatformUtil.java
@@ -1,6 +1,28 @@
---- modules/base/src/main/java/com/sun/javafx/PlatformUtil.java.orig 2017-07-22 15:59:03 UTC
+--- modules/base/src/main/java/com/sun/javafx/PlatformUtil.java.orig 2017-09-08 16:56:55 UTC
+++ modules/base/src/main/java/com/sun/javafx/PlatformUtil.java
-@@ -158,10 +158,10 @@ public class PlatformUtil {
+@@ -69,6 +69,7 @@ public class PlatformUtil {
+ private static final boolean WINDOWS_7_OR_LATER = WINDOWS && versionNumberGreaterThanOrEqualTo(6.1f);
+ private static final boolean MAC = os.startsWith("Mac");
+ private static final boolean LINUX = os.startsWith("Linux") && !ANDROID;
++ private static final boolean FREEBSD = os.startsWith("FreeBSD");
+ private static final boolean SOLARIS = os.startsWith("SunOS");
+ private static final boolean IOS = os.startsWith("iOS");
+
+@@ -124,6 +125,13 @@ public class PlatformUtil {
+ return LINUX;
+ }
+
++ /**
++ * Returns true if the operating system is a form of FreeBSD.
++ */
++ public static boolean isFreeBSD(){
++ return FREEBSD;
++ }
++
+ public static boolean useEGL() {
+ return useEGL;
+ }
+@@ -150,10 +158,10 @@ public class PlatformUtil {
}
/**
diff --git a/java/openjfx8-devel/files/patch-modules_fxpackager_src_main_native_library_common_PosixPlatform.cpp b/java/openjfx8-devel/files/patch-modules_fxpackager_src_main_native_library_common_PosixPlatform.cpp
new file mode 100644
index 000000000000..8b9e9d1e6ddd
--- /dev/null
+++ b/java/openjfx8-devel/files/patch-modules_fxpackager_src_main_native_library_common_PosixPlatform.cpp
@@ -0,0 +1,18 @@
+http://pkgs.fedoraproject.org/cgit/rpms/openjfx.git/tree/0001-Fix-wait-call-in-PosixPlatform.patch
+
+--- modules/fxpackager/src/main/native/library/common/PosixPlatform.cpp.orig 2017-09-08 16:56:55 UTC
++++ modules/fxpackager/src/main/native/library/common/PosixPlatform.cpp
+@@ -230,13 +230,7 @@ bool PosixProcess::Wait() {
+ int status = 0;
+ pid_t wpid = 0;
+
+- //TODO Use waitpid instead of wait
+-#ifdef LINUX
+- wait();
+-#endif
+-#ifdef MAC
+ wpid = wait(&status);
+-#endif
+
+ if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
+ if (errno != EINTR){
diff --git a/java/openjfx8-devel/files/patch-modules_graphics_src_main_java_com_sun_glass_ui_Platform.java b/java/openjfx8-devel/files/patch-modules_graphics_src_main_java_com_sun_glass_ui_Platform.java
new file mode 100644
index 000000000000..4e68db313d7f
--- /dev/null
+++ b/java/openjfx8-devel/files/patch-modules_graphics_src_main_java_com_sun_glass_ui_Platform.java
@@ -0,0 +1,20 @@
+--- modules/graphics/src/main/java/com/sun/glass/ui/Platform.java.orig 2017-09-08 16:56:55 UTC
++++ modules/graphics/src/main/java/com/sun/glass/ui/Platform.java
+@@ -52,6 +52,8 @@ final class Platform {
+ type = WINDOWS;
+ else if (userPlatform.equals("linux"))
+ type = GTK;
++ else if (userPlatform.equals("freebsd"))
++ type = GTK;
+ else if (userPlatform.equals("gtk"))
+ type = GTK;
+ else if (userPlatform.equals("ios"))
+@@ -68,6 +70,8 @@ final class Platform {
+ } else if (osNameLowerCase.startsWith("wind")) {
+ type = WINDOWS;
+ } else if (osNameLowerCase.startsWith("linux")) {
++ type = GTK;
++ } else if (osNameLowerCase.startsWith("freebsd")) {
+ type = GTK;
+ }
+ }
diff --git a/java/openjfx8-devel/files/patch-modules_graphics_src_main_java_com_sun_glass_utils_NativeLibLoader.java b/java/openjfx8-devel/files/patch-modules_graphics_src_main_java_com_sun_glass_utils_NativeLibLoader.java
new file mode 100644
index 000000000000..bfbd3bd91156
--- /dev/null
+++ b/java/openjfx8-devel/files/patch-modules_graphics_src_main_java_com_sun_glass_utils_NativeLibLoader.java
@@ -0,0 +1,20 @@
+--- modules/graphics/src/main/java/com/sun/glass/utils/NativeLibLoader.java.orig 2017-09-08 16:56:55 UTC
++++ modules/graphics/src/main/java/com/sun/glass/utils/NativeLibLoader.java
+@@ -173,7 +173,7 @@ public class NativeLibLoader {
+ relativeDir = "../../bin";
+ } else if (osName.startsWith("Mac")) {
+ relativeDir = "..";
+- } else if (osName.startsWith("Linux")) {
++ } else if (osName.startsWith("Linux") || osName.startsWith("FreeBSD")) {
+ relativeDir = "../" + System.getProperty("os.arch");
+ }
+
+@@ -189,7 +189,7 @@ public class NativeLibLoader {
+ } else if (osName.startsWith("Mac")) {
+ libPrefix = "lib";
+ libSuffix = ".dylib";
+- } else if (osName.startsWith("Linux")) {
++ } else if (osName.startsWith("Linux") || osName.startsWith("FreeBSD")) {
+ libPrefix = "lib";
+ libSuffix = ".so";
+ }
diff --git a/java/openjfx8-devel/files/patch-modules_graphics_src_main_java_com_sun_javafx_font_PrismFontFactory.java b/java/openjfx8-devel/files/patch-modules_graphics_src_main_java_com_sun_javafx_font_PrismFontFactory.java
new file mode 100644
index 000000000000..2f0f581766ce
--- /dev/null
+++ b/java/openjfx8-devel/files/patch-modules_graphics_src_main_java_com_sun_javafx_font_PrismFontFactory.java
@@ -0,0 +1,54 @@
+--- modules/graphics/src/main/java/com/sun/javafx/font/PrismFontFactory.java.orig 2017-09-08 16:56:55 UTC
++++ modules/graphics/src/main/java/com/sun/javafx/font/PrismFontFactory.java
+@@ -51,6 +51,7 @@ public abstract class PrismFontFactory implements Font
+ public static final boolean debugFonts;
+ public static final boolean isWindows;
+ public static final boolean isLinux;
++ public static final boolean isFreeBSD;
+ public static final boolean isMacOSX;
+ public static final boolean isIOS;
+ public static final boolean isAndroid;
+@@ -90,6 +91,7 @@ public abstract class PrismFontFactory implements Font
+ isWindows = PlatformUtil.isWindows();
+ isMacOSX = PlatformUtil.isMac();
+ isLinux = PlatformUtil.isLinux();
++ isFreeBSD = PlatformUtil.isFreeBSD();
+ isIOS = PlatformUtil.isIOS();
+ isAndroid = PlatformUtil.isAndroid();
+ isEmbedded = PlatformUtil.isEmbedded();
+@@ -136,7 +138,7 @@ public abstract class PrismFontFactory implements Font
+ }
+ }
+
+- useNativeRasterizer = isMacOSX || isWindows || isLinux;
++ useNativeRasterizer = isMacOSX || isWindows || isLinux || isFreeBSD;
+ String defPrismText = useNativeRasterizer ? "native" : "t2k";
+ String prismText = System.getProperty("prism.text", defPrismText);
+ if (useNativeRasterizer) {
+@@ -173,7 +175,7 @@ public abstract class PrismFontFactory implements Font
+ private static String getNativeFactoryName() {
+ if (isWindows) return DW_FACTORY;
+ if (isMacOSX || isIOS) return CT_FACTORY;
+- if (isLinux || isAndroid) return FT_FACTORY;
++ if (isLinux || isAndroid || isFreeBSD) return FT_FACTORY;
+ return null;
+ }
+
+@@ -858,7 +860,7 @@ public abstract class PrismFontFactory implements Font
+ break;
+ }
+ }
+- if (fontResource == null && isLinux) {
++ if (fontResource == null && isLinux && isFreeBSD) {
+ String path = FontConfigManager.getDefaultFontPath();
+ if (path != null) {
+ fontResource = createFontResource(jreDefaultFontLC,
+@@ -1742,7 +1744,7 @@ public abstract class PrismFontFactory implements Font
+ familyToFontListMap,
+ Locale.ENGLISH);
+
+- } else if (isLinux) {
++ } else if (isLinux || isFreeBSD) {
+ FontConfigManager.populateMaps(tmpFontToFileMap,
+ fontToFamilyNameMap,
+ familyToFontListMap,
diff --git a/java/openjfx8-devel/files/patch-modules_graphics_src_main_java_com_sun_javafx_tk_Toolkit.java b/java/openjfx8-devel/files/patch-modules_graphics_src_main_java_com_sun_javafx_tk_Toolkit.java
new file mode 100644
index 000000000000..3dcded07766b
--- /dev/null
+++ b/java/openjfx8-devel/files/patch-modules_graphics_src_main_java_com_sun_javafx_tk_Toolkit.java
@@ -0,0 +1,11 @@
+--- modules/graphics/src/main/java/com/sun/javafx/tk/Toolkit.java.orig 2017-09-08 16:56:55 UTC
++++ modules/graphics/src/main/java/com/sun/javafx/tk/Toolkit.java
+@@ -185,6 +185,8 @@ public abstract class Toolkit {
+ return DEFAULT_TOOLKIT;
+ } else if (PlatformUtil.isLinux()) {
+ return DEFAULT_TOOLKIT;
++ } else if (PlatformUtil.isFreeBSD()) {
++ return DEFAULT_TOOLKIT;
+ } else if (PlatformUtil.isIOS()) {
+ return DEFAULT_TOOLKIT;
+ } else if (PlatformUtil.isAndroid()) {
diff --git a/java/openjfx8-devel/files/patch-modules_graphics_src_main_java_com_sun_prism_impl_PrismSettings.java b/java/openjfx8-devel/files/patch-modules_graphics_src_main_java_com_sun_prism_impl_PrismSettings.java
index c63d8483030a..ee3c466944e2 100644
--- a/java/openjfx8-devel/files/patch-modules_graphics_src_main_java_com_sun_prism_impl_PrismSettings.java
+++ b/java/openjfx8-devel/files/patch-modules_graphics_src_main_java_com_sun_prism_impl_PrismSettings.java
@@ -1,4 +1,4 @@
---- modules/graphics/src/main/java/com/sun/prism/impl/PrismSettings.java.orig 2017-07-22 15:59:03 UTC
+--- modules/graphics/src/main/java/com/sun/prism/impl/PrismSettings.java.orig 2017-09-08 16:56:55 UTC
+++ modules/graphics/src/main/java/com/sun/prism/impl/PrismSettings.java
@@ -212,6 +212,8 @@ public final class PrismSettings {
tryOrderArr = new String[] { "es2" };
diff --git a/java/openjfx8-devel/files/patch-modules_graphics_src_main_native-font_fontpath__linux.c b/java/openjfx8-devel/files/patch-modules_graphics_src_main_native-font_fontpath__linux.c
new file mode 100644
index 000000000000..3afbe712be22
--- /dev/null
+++ b/java/openjfx8-devel/files/patch-modules_graphics_src_main_native-font_fontpath__linux.c
@@ -0,0 +1,11 @@
+--- modules/graphics/src/main/native-font/fontpath_linux.c.orig 2017-09-08 16:56:55 UTC
++++ modules/graphics/src/main/native-font/fontpath_linux.c
+@@ -23,7 +23,7 @@
+ * questions.
+ */
+
+-#if defined (__linux__) && ! defined (ANDROID_NDK)
++#if (defined (__linux__) && ! defined (ANDROID_NDK)) || defined(__FreeBSD__)
+
+ #include <string.h>
+ #include <stdio.h>
diff --git a/java/openjfx8-devel/files/patch-modules_graphics_src_main_native-font_freetype.c b/java/openjfx8-devel/files/patch-modules_graphics_src_main_native-font_freetype.c
new file mode 100644
index 000000000000..8c0b323bd012
--- /dev/null
+++ b/java/openjfx8-devel/files/patch-modules_graphics_src_main_native-font_freetype.c
@@ -0,0 +1,15 @@
+--- modules/graphics/src/main/native-font/freetype.c.orig 2017-09-08 16:56:55 UTC
++++ modules/graphics/src/main/native-font/freetype.c
+@@ -23,7 +23,6 @@
+ * questions.
+ */
+
+-#if defined __linux__ || ANDROID_NDK
+ #if defined _ENABLE_PANGO || _ENABLE_HARFBUZZ
+
+ #include <jni.h>
+@@ -646,4 +645,3 @@ JNIEXPORT jboolean JNICALL JNICALL OS_NATIVE(isHarfbuz
+ }
+
+ #endif /* ENABLE_PANGO || ENABLE_HARFBUZZ */
+-#endif /* __linux__ || ANDROID_NDK */
diff --git a/java/openjfx8-devel/files/patch-modules_graphics_src_main_native-font_pango.c b/java/openjfx8-devel/files/patch-modules_graphics_src_main_native-font_pango.c
new file mode 100644
index 000000000000..637ecd86602e
--- /dev/null
+++ b/java/openjfx8-devel/files/patch-modules_graphics_src_main_native-font_pango.c
@@ -0,0 +1,15 @@
+--- modules/graphics/src/main/native-font/pango.c.orig 2017-09-08 16:56:55 UTC
++++ modules/graphics/src/main/native-font/pango.c
+@@ -23,7 +23,6 @@
+ * questions.
+ */
+
+-#if defined __linux__
+ #if defined _ENABLE_PANGO
+
+ #include <jni.h>
+@@ -410,4 +409,3 @@ JNIEXPORT void JNICALL OS_NATIVE(pango_1font_1descript
+ }
+
+ #endif /* ENABLE_PANGO */
+-#endif /* __linux__ */
diff --git a/java/openjfx8-devel/files/patch-modules_graphics_src_main_native-glass_gtk_glass__evloop.cpp b/java/openjfx8-devel/files/patch-modules_graphics_src_main_native-glass_gtk_glass__evloop.cpp
new file mode 100644
index 000000000000..9f0b4e256453
--- /dev/null
+++ b/java/openjfx8-devel/files/patch-modules_graphics_src_main_native-glass_gtk_glass__evloop.cpp
@@ -0,0 +1,17 @@
+--- modules/graphics/src/main/native-glass/gtk/glass_evloop.cpp.orig 2017-09-08 16:56:55 UTC
++++ modules/graphics/src/main/native-glass/gtk/glass_evloop.cpp
+@@ -25,7 +25,8 @@
+ #include "glass_evloop.h"
+
+ #include <glib.h>
+-#include <malloc.h>
++#include <sys/param.h>
++#include <stdlib.h>
+
+ static GSList * evloopHookList;
+
+@@ -85,4 +86,3 @@ glass_evloop_hook_remove(GevlHookRegistration hookReg)
+ evloopHookList = g_slist_remove(evloopHookList, hookReg);
+ free(hookReg);
+ }
+-
diff --git a/java/openjfx8-devel/files/patch-modules_graphics_src_main_native-glass_gtk_glass__general.cpp b/java/openjfx8-devel/files/patch-modules_graphics_src_main_native-glass_gtk_glass__general.cpp
new file mode 100644
index 000000000000..b7ee01c502cb
--- /dev/null
+++ b/java/openjfx8-devel/files/patch-modules_graphics_src_main_native-glass_gtk_glass__general.cpp
@@ -0,0 +1,10 @@
+--- modules/graphics/src/main/native-glass/gtk/glass_general.cpp.orig 2017-09-08 16:56:55 UTC
++++ modules/graphics/src/main/native-glass/gtk/glass_general.cpp
+@@ -372,6 +372,7 @@ JNI_OnLoad(JavaVM *jvm, void *reserved)
+
+ gdk_threads_enter();
+ gtk_init(NULL, NULL);
++ gdk_threads_leave();
+
+ return JNI_VERSION_1_6;
+ }
diff --git a/java/openjfx8-devel/files/patch-modules_graphics_src_main_native-glass_gtk_glass__window.h b/java/openjfx8-devel/files/patch-modules_graphics_src_main_native-glass_gtk_glass__window.h
new file mode 100644
index 000000000000..f57060221460
--- /dev/null
+++ b/java/openjfx8-devel/files/patch-modules_graphics_src_main_native-glass_gtk_glass__window.h
@@ -0,0 +1,16 @@
+--- modules/graphics/src/main/native-glass/gtk/glass_window.h.orig 2017-09-08 16:56:55 UTC
++++ modules/graphics/src/main/native-glass/gtk/glass_window.h
+@@ -365,7 +365,7 @@ class WindowContextChild: public WindowContextBase { (
+ class WindowContextTop: public WindowContextBase {
+ jlong screen;
+ WindowFrameType frame_type;
+- struct WindowContext *owner;
++ WindowContext *owner;
+ WindowGeometry geometry;
+ int stale_config_notifications;
+ struct _Resizable{// we can't use set/get gtk_window_resizable function
+@@ -455,4 +455,3 @@ class EventsCounterHelper { (public)
+ };
+
+ #endif /* GLASS_WINDOW_H */
+-
diff --git a/java/openjfx8-devel/files/patch-modules_graphics_src_main_native-prism-es2_PrismES2Defs.h b/java/openjfx8-devel/files/patch-modules_graphics_src_main_native-prism-es2_PrismES2Defs.h
new file mode 100644
index 000000000000..fa24df290f0c
--- /dev/null
+++ b/java/openjfx8-devel/files/patch-modules_graphics_src_main_native-prism-es2_PrismES2Defs.h
@@ -0,0 +1,11 @@
+--- modules/graphics/src/main/native-prism-es2/PrismES2Defs.h.orig 2017-09-08 16:56:55 UTC
++++ modules/graphics/src/main/native-prism-es2/PrismES2Defs.h
+@@ -26,7 +26,7 @@
+ #ifndef _Prism_es2_defs_h_
+ #define _Prism_es2_defs_h_
+
+-#if defined(SOLARIS) || defined(LINUX) || defined(ANDROID_NDK) /* SOLARIS || LINUX */
++#if defined(SOLARIS) || defined(LINUX) || defined(ANDROID_NDK) || defined(FREEBSD) /* SOLARIS || LINUX */
+ #define GLX_GLEXT_PROTOTYPES
+ #define GLX_GLXEXT_PROTOTYPES
+ #define UNIX
diff --git a/java/openjfx8-devel/files/patch-modules_media_src_main_native_gstreamer_projects_bsd_gstreamer-lite_Makefile b/java/openjfx8-devel/files/patch-modules_media_src_main_native_gstreamer_projects_bsd_gstreamer-lite_Makefile
new file mode 100644
index 000000000000..cc61d4f26f4d
--- /dev/null
+++ b/java/openjfx8-devel/files/patch-modules_media_src_main_native_gstreamer_projects_bsd_gstreamer-lite_Makefile
@@ -0,0 +1,38 @@
+--- modules/media/src/main/native/gstreamer/projects/bsd/gstreamer-lite/Makefile.orig 2017-10-03 19:30:23 UTC
++++ modules/media/src/main/native/gstreamer/projects/bsd/gstreamer-lite/Makefile
+@@ -27,7 +27,7 @@ DIRLIST = gstreamer/gst \
+ gst-plugins-base/gst/volume \
+ gst-plugins-good/gst/audioparsers \
+ gst-plugins-good/gst/isomp4 \
+- gst-plugins-base/ext/alsa \
++ gst-plugins-base/ext/bsdaudio \
+ gst-plugins-good/gst/audiofx \
+ gst-plugins-good/gst/equalizer \
+ gst-plugins-good/gst/spectrum \
+@@ -67,10 +67,10 @@ INCLUDES = -I$(BASE_DIR)/plugins
+ -I$(SRCBASE_DIR)/gst-plugins-good/gst/isomp4 \
+ -I$(SRCBASE_DIR)/gst-plugins-bad/gst-libs
+
+-PACKAGES_INCLUDES := $(shell pkg-config --cflags alsa glib-2.0)
+-PACKAGES_LIBS := $(shell pkg-config --libs alsa glib-2.0 gobject-2.0 gmodule-2.0 gthread-2.0)
++PACKAGES_INCLUDES := $(shell pkg-config --cflags glib-2.0)
++PACKAGES_LIBS := $(shell pkg-config --libs glib-2.0 gobject-2.0 gmodule-2.0 gthread-2.0)
+
+-LDFLAGS = -L$(BUILD_DIR) -lm $(PACKAGES_LIBS)
++LDFLAGS = -L$(BUILD_DIR) -lm $(PACKAGES_LIBS) -lsndio
+
+ ifeq ($(ARCH), x32)
+ CFLAGS += -m32
+@@ -227,10 +227,8 @@ SOURCES = \
+ gst-plugins-good/gst/isomp4/qtdemux_dump.c \
+ gst-plugins-good/gst/isomp4/qtdemux_types.c \
+ gst-plugins-good/gst/isomp4/qtdemux.c \
+- gst-plugins-base/ext/alsa/gstalsaplugin.c \
+- gst-plugins-base/ext/alsa/gstalsa.c \
+- gst-plugins-base/ext/alsa/gstalsadeviceprobe.c \
+- gst-plugins-base/ext/alsa/gstalsasink.c \
++ gst-plugins-base/ext/bsdaudio/gstbsdaudio.c \
++ gst-plugins-base/ext/bsdaudio/bsdaudiosink.c \
+ gst-plugins-good/gst/audiofx/audiofx.c \
+ gst-plugins-good/gst/audiofx/audiopanorama.c \
+ gst-plugins-good/gst/equalizer/gstiirequalizer.c \
diff --git a/java/openjfx8-devel/files/patch-modules_media_src_main_native_jfxmedia_platform_gstreamer_GstPipelineFactory.cpp b/java/openjfx8-devel/files/patch-modules_media_src_main_native_jfxmedia_platform_gstreamer_GstPipelineFactory.cpp
new file mode 100644
index 000000000000..6e8aff262d97
--- /dev/null
+++ b/java/openjfx8-devel/files/patch-modules_media_src_main_native_jfxmedia_platform_gstreamer_GstPipelineFactory.cpp
@@ -0,0 +1,11 @@
+--- modules/media/src/main/native/jfxmedia/platform/gstreamer/GstPipelineFactory.cpp.orig 2017-09-08 16:56:55 UTC
++++ modules/media/src/main/native/jfxmedia/platform/gstreamer/GstPipelineFactory.cpp
+@@ -351,6 +351,8 @@ GstElement* CGstPipelineFactory::CreateAudioSinkElemen
+ return CreateElement("directsoundsink");
+ #elif TARGET_OS_MAC
+ return CreateElement("osxaudiosink");
++#elif TARGET_OS_BSD
++ return CreateElement("bsdaudiosink");
+ #elif TARGET_OS_LINUX
+ return CreateElement("alsasink");
+ #else
diff --git a/java/openjfx8-devel/files/patch-modules_media_src_main_native_jfxmedia_projects_bsd_Makefile b/java/openjfx8-devel/files/patch-modules_media_src_main_native_jfxmedia_projects_bsd_Makefile
new file mode 100644
index 000000000000..2b1eae925e67
--- /dev/null
+++ b/java/openjfx8-devel/files/patch-modules_media_src_main_native_jfxmedia_projects_bsd_Makefile
@@ -0,0 +1,26 @@
+--- modules/media/src/main/native/jfxmedia/projects/bsd/Makefile.orig 2017-10-03 19:30:23 UTC
++++ modules/media/src/main/native/jfxmedia/projects/bsd/Makefile
+@@ -1,5 +1,5 @@
+ #
+-# Linux/ARM jfxmedia makefile
++# BSD jfxmedia makefile
+ #
+
+ BUILD_DIR = $(OUTPUT_DIR)/$(BUILD_TYPE)
+@@ -18,6 +18,7 @@ DIRLIST = jni \
+ TARGET = $(BUILD_DIR)/lib$(BASE_NAME).so
+
+ CFLAGS = -DTARGET_OS_LINUX=1 \
++ -DTARGET_OS_BSD=1 \
+ -D_GNU_SOURCE \
+ -DGST_REMOVE_DEPRECATED \
+ -DGST_DISABLE_GST_DEBUG \
+@@ -46,7 +47,7 @@ ifdef HOST_COMPILE
+
+ INCLUDES = $(BASE_INCLUDES) \
+ -I$(JAVA_HOME)/include \
+- -I$(JAVA_HOME)/include/linux \
++ -I$(JAVA_HOME)/include/freebsd \
+ -I$(GSTREAMER_LITE_DIR)/gstreamer \
+ -I$(GSTREAMER_LITE_DIR)/gst-plugins-base/gst-libs \
+ -I$(GSTREAMER_LITE_DIR)/gstreamer/libs \
diff --git a/java/openjfx8-devel/files/patch-modules_web_src_main_native_Source_JavaScriptCore_PlatformJava.cmake b/java/openjfx8-devel/files/patch-modules_web_src_main_native_Source_JavaScriptCore_PlatformJava.cmake
new file mode 100644
index 000000000000..2599b506351f
--- /dev/null
+++ b/java/openjfx8-devel/files/patch-modules_web_src_main_native_Source_JavaScriptCore_PlatformJava.cmake
@@ -0,0 +1,8 @@
+--- modules/web/src/main/native/Source/JavaScriptCore/PlatformJava.cmake.orig 2017-09-08 16:56:55 UTC
++++ modules/web/src/main/native/Source/JavaScriptCore/PlatformJava.cmake
+@@ -46,4 +46,4 @@ list(APPEND JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES
+ ${JDK_INCLUDE_DIRS}
+ )
+
+-add_dependencies(WTF icudatagen)
++#add_dependencies(WTF icudatagen)
diff --git a/java/openjfx8-devel/files/patch-modules_web_src_main_native_Source_PlatformJava.cmake b/java/openjfx8-devel/files/patch-modules_web_src_main_native_Source_PlatformJava.cmake
new file mode 100644
index 000000000000..a2c47e55df65
--- /dev/null
+++ b/java/openjfx8-devel/files/patch-modules_web_src_main_native_Source_PlatformJava.cmake
@@ -0,0 +1,10 @@
+--- modules/web/src/main/native/Source/PlatformJava.cmake.orig 2017-09-08 16:56:55 UTC
++++ modules/web/src/main/native/Source/PlatformJava.cmake
+@@ -1,5 +1,5 @@
+-add_subdirectory(ThirdParty/sqlite)
+-add_subdirectory(ThirdParty/icu)
++# add_subdirectory(ThirdParty/sqlite)
++# add_subdirectory(ThirdParty/icu)
+
+ # libxml2 should be compiled only on windows
+ if (WIN32)
diff --git a/java/openjfx8-devel/files/patch-modules_web_src_main_native_Source_WTF_wtf_CMakeLists.txt b/java/openjfx8-devel/files/patch-modules_web_src_main_native_Source_WTF_wtf_CMakeLists.txt
new file mode 100644
index 000000000000..e32a465f6b56
--- /dev/null
+++ b/java/openjfx8-devel/files/patch-modules_web_src_main_native_Source_WTF_wtf_CMakeLists.txt
@@ -0,0 +1,10 @@
+--- modules/web/src/main/native/Source/WTF/wtf/CMakeLists.txt.orig 2017-09-08 16:56:55 UTC
++++ modules/web/src/main/native/Source/WTF/wtf/CMakeLists.txt
+@@ -309,6 +309,7 @@ list(APPEND WTF_SOURCES
+ )
+ set(WTF_SYSTEM_INCLUDE_DIRECTORIES
+ ${ICU_INCLUDE_DIRS}
++ ${CMAKE_INSTALL_PREFIX}/include
+ )
+ list(APPEND WTF_LIBRARIES
+ ${ICU_DATA_LIBRARIES}
diff --git a/java/openjfx8-devel/files/patch-modules_web_src_main_native_Source_WTF_wtf_unicode_java_UnicodeJava.h b/java/openjfx8-devel/files/patch-modules_web_src_main_native_Source_WTF_wtf_unicode_java_UnicodeJava.h
new file mode 100644
index 000000000000..e516309fd44b
--- /dev/null
+++ b/java/openjfx8-devel/files/patch-modules_web_src_main_native_Source_WTF_wtf_unicode_java_UnicodeJava.h
@@ -0,0 +1,24 @@
+--- modules/web/src/main/native/Source/WTF/wtf/unicode/java/UnicodeJava.h.orig 2017-09-08 16:56:55 UTC
++++ modules/web/src/main/native/Source/WTF/wtf/unicode/java/UnicodeJava.h
+@@ -15,21 +15,6 @@
+
+ #define CharProp(p) java_lang_Character_##p
+
+-#if PLATFORM(JAVA) && OS(WINDOWS)
+-typedef wchar_t UChar;
+-#else
+-typedef uint16_t UChar;
+-#endif
+-
+-// #ifdef UChar32
+-// #undef UChar32
+-// #endif
+-
+-#ifndef __UMACHINE_H__ //XXX: recheck
+-typedef uint32_t UChar32;
+-#endif
+-
+-#define U_MASK(x) ((uint32_t)1<<(x))
+ #define USE_FAST_PATH(c, fast, slow) ((c) <= 0x7F ? fast((char)c) : slow(c))
+
+ #define CHECK_PROPERTY(c, mask, isSet) \
diff --git a/java/openjfx8-devel/files/patch-modules_web_src_main_native_Source_WebCore_PlatformJava.cmake b/java/openjfx8-devel/files/patch-modules_web_src_main_native_Source_WebCore_PlatformJava.cmake
new file mode 100644
index 000000000000..f2b197047ee2
--- /dev/null
+++ b/java/openjfx8-devel/files/patch-modules_web_src_main_native_Source_WebCore_PlatformJava.cmake
@@ -0,0 +1,11 @@
+--- modules/web/src/main/native/Source/WebCore/PlatformJava.cmake.orig 2017-09-08 16:56:55 UTC
++++ modules/web/src/main/native/Source/WebCore/PlatformJava.cmake
+@@ -239,7 +239,7 @@ set(WebCore_FORWARDING_HEADERS_FILES
+ set(WebCore_USER_AGENT_SCRIPTS_DEPENDENCIES ${WEBCORE_DIR}/platform/java/RenderThemeJava.cpp)
+
+ list(APPEND WebCore_LIBRARIES
+- SqliteJava
++ ${CMAKE_INSTALL_PREFIX}/lib/libsqlite3.so
+ ${ICU_I18N_LIBRARIES}
+ ${ICU_LIBRARIES}
+ )
diff --git a/java/openjfx8-devel/files/patch-modules_web_src_main_native_Source_cmake_OptionsJava.cmake b/java/openjfx8-devel/files/patch-modules_web_src_main_native_Source_cmake_OptionsJava.cmake
index 8fe77bbc6619..256db5291c76 100644
--- a/java/openjfx8-devel/files/patch-modules_web_src_main_native_Source_cmake_OptionsJava.cmake
+++ b/java/openjfx8-devel/files/patch-modules_web_src_main_native_Source_cmake_OptionsJava.cmake
@@ -1,6 +1,19 @@
---- modules/web/src/main/native/Source/cmake/OptionsJava.cmake.orig 2017-07-22 15:59:03 UTC
+--- modules/web/src/main/native/Source/cmake/OptionsJava.cmake.orig 2017-09-08 16:56:55 UTC
+++ modules/web/src/main/native/Source/cmake/OptionsJava.cmake
-@@ -264,6 +264,7 @@ if (CMAKE_MAJOR_VERSION LESS 3)
+@@ -52,9 +52,9 @@ elseif (APPLE)
+ set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
+ elseif (UNIX)
+ #### ICU ####
+- set(ICU_JAVA_COMMON_LIB icuuc)
+- set(ICU_I18N_LIBRARIES icui18n)
+- set(ICU_JAVA_DATA_LIB ${CMAKE_BINARY_DIR}/lib/libicudata.a)
++ set(ICU_JAVA_COMMON_LIB ${CMAKE_INSTALL_PREFIX}/lib/libicuuc.so)
++ set(ICU_I18N_LIBRARIES ${CMAKE_INSTALL_PREFIX}/lib/libicui18n.so)
++ set(ICU_JAVA_DATA_LIB ${CMAKE_INSTALL_PREFIX}/lib/libicudata.so)
+ #### ICU-END ####
+
+ find_package(LibXml2 2.7.0 REQUIRED)
+@@ -233,8 +233,9 @@ if (CMAKE_MAJOR_VERSION LESS 3)
endif ()
set(ICU_INCLUDE_DIRS
@@ -8,3 +21,6 @@
"${THIRDPARTY_DIR}/icu/source/common"
"${THIRDPARTY_DIR}/icu/source/i18n"
)
+
+-
++set(ICU_LIBRARIES ${ICU_JAVA_COMMON_LIB} ${ICU_JAVA_DATA_LIB})
diff --git a/java/openjfx8-devel/files/patch-modules_web_src_main_native_Tools_DumpRenderTree_TestRunner.cpp b/java/openjfx8-devel/files/patch-modules_web_src_main_native_Tools_DumpRenderTree_TestRunner.cpp
new file mode 100644
index 000000000000..98c975585586
--- /dev/null
+++ b/java/openjfx8-devel/files/patch-modules_web_src_main_native_Tools_DumpRenderTree_TestRunner.cpp
@@ -0,0 +1,11 @@
+--- modules/web/src/main/native/Tools/DumpRenderTree/TestRunner.cpp.orig 2017-09-08 16:56:55 UTC
++++ modules/web/src/main/native/Tools/DumpRenderTree/TestRunner.cpp
+@@ -2410,7 +2410,7 @@ void TestRunner::runUIScript(JSContextRef context, JSS
+ if (!m_UIScriptContext)
+ m_UIScriptContext = std::make_unique<WTR::UIScriptContext>(*this);
+
+- String scriptString(JSStringGetCharactersPtr(script), JSStringGetLength(script));
++ String scriptString(reinterpret_cast<const UChar*>(JSStringGetCharactersPtr(script)), JSStringGetLength(script));
+ m_UIScriptContext->runUIScript(scriptString, callbackID);
+ }
+
diff --git a/java/openjfx8-devel/files/patch-modules_web_src_main_native_Tools_DumpRenderTree_java_CMakeLists.txt b/java/openjfx8-devel/files/patch-modules_web_src_main_native_Tools_DumpRenderTree_java_CMakeLists.txt
new file mode 100644
index 000000000000..c220daf08117
--- /dev/null
+++ b/java/openjfx8-devel/files/patch-modules_web_src_main_native_Tools_DumpRenderTree_java_CMakeLists.txt
@@ -0,0 +1,13 @@
+--- modules/web/src/main/native/Tools/DumpRenderTree/java/CMakeLists.txt.orig 2017-09-08 16:56:55 UTC
++++ modules/web/src/main/native/Tools/DumpRenderTree/java/CMakeLists.txt
+@@ -89,9 +89,7 @@ add_library(DumpRenderTreeJava SHARED ${DumpRenderTree
+ add_definitions(-DWEBCORE_EXPORT=WTF_IMPORT -DWEBCORE_TESTSUPPORT_EXPORT=WTF_IMPORT)
+ add_dependencies(DumpRenderTreeJava DumpRenderTreeBindings)
+
+-if (UNIX AND NOT APPLE)
+- set_target_properties(DumpRenderTreeJava PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
+-elseif (WIN32)
++if (WIN32)
+ # Workaround for MSBuild. It always creates Release|Debug folder
+ # according to the build type on each target.
+ install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/DumpRenderTreeJava.dll DESTINATION ${CMAKE_BINARY_DIR}/lib OPTIONAL)
diff --git a/java/openjfx8-devel/files/patch-modules_web_src_main_native_Tools_Scripts_webkitdirs.pm b/java/openjfx8-devel/files/patch-modules_web_src_main_native_Tools_Scripts_webkitdirs.pm
new file mode 100644
index 000000000000..b816724242db
--- /dev/null
+++ b/java/openjfx8-devel/files/patch-modules_web_src_main_native_Tools_Scripts_webkitdirs.pm
@@ -0,0 +1,11 @@
+--- modules/web/src/main/native/Tools/Scripts/webkitdirs.pm.orig 2017-09-08 16:56:55 UTC
++++ modules/web/src/main/native/Tools/Scripts/webkitdirs.pm
+@@ -1957,7 +1957,7 @@ sub generateBuildSystemFromCMakeProject
+ chdir($buildPath) or die;
+
+ # We try to be smart about when to rerun cmake, so that we can have faster incremental builds.
+- my $willUseNinja = canUseNinja() && canUseNinjaGenerator();
++ my $willUseNinja = 0; # canUseNinja() && canUseNinjaGenerator();
+ if (-e cmakeCachePath() && -e cmakeGeneratedBuildfile($willUseNinja)) {
+ return 0;
+ }
diff --git a/java/openjfx8-devel/files/sndiosink.c b/java/openjfx8-devel/files/sndiosink.c
new file mode 100644
index 000000000000..eda86ee726f2
--- /dev/null
+++ b/java/openjfx8-devel/files/sndiosink.c
@@ -0,0 +1,524 @@
+/*
+ * Copyright (C) <2008> Jacob Meuser <jakemsr@sdf.lonestar.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/**
+ * SECTION:element-sndiosink
+ * @see_also: #GstAutoAudioSink
+ *
+ * <refsect2>
+ * <para>
+ * This element outputs sound to a sound card using sndio.
+ * </para>
+ * <para>
+ * Simple example pipeline that plays an Ogg/Vorbis file via sndio:
+ * <programlisting>
+ * gst-launch -v filesrc location=foo.ogg ! decodebin ! audioconvert ! audioresample ! sndiosink
+ * </programlisting>
+ * </para>
+ * </refsect2>
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "sndiosink.h"
+#include <unistd.h>
+#include <errno.h>
+
+#define _(x) x
+
+GST_DEBUG_CATEGORY_EXTERN (gst_sndio_debug);
+#define GST_CAT_DEFAULT gst_sndio_debug
+
+enum
+{
+ PROP_0,
+ PROP_HOST
+};
+
+static GstStaticPadTemplate sndio_sink_factory =
+ GST_STATIC_PAD_TEMPLATE ("sink",
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ GST_STATIC_CAPS ("audio/x-raw-int, "
+ "endianness = (int) { 1234, 4321 }, "
+ "signed = (boolean) { TRUE, FALSE }, "
+ "width = (int) { 8, 16, 24, 32 }, "
+ "depth = (int) { 8, 16, 24, 32 }, "
+ "rate = (int) [ 8000, 192000 ], "
+ "channels = (int) [ 1, 16 ] ")
+ );
+
+static void gst_sndiosink_finalize (GObject * object);
+
+static GstCaps *gst_sndiosink_getcaps (GstBaseSink * bsink);
+
+static gboolean gst_sndiosink_open (GstAudioSink * asink);
+static gboolean gst_sndiosink_close (GstAudioSink * asink);
+static gboolean gst_sndiosink_prepare (GstAudioSink * asink,
+ GstRingBufferSpec * spec);
+static gboolean gst_sndiosink_unprepare (GstAudioSink * asink);
+static guint gst_sndiosink_write (GstAudioSink * asink, gpointer data,
+ guint length);
+static guint gst_sndiosink_delay (GstAudioSink * asink);
+static void gst_sndiosink_reset (GstAudioSink * asink);
+
+static void gst_sndiosink_set_property (GObject * object, guint prop_id,
+ const GValue * value, GParamSpec * pspec);
+static void gst_sndiosink_get_property (GObject * object, guint prop_id,
+ GValue * value, GParamSpec * pspec);
+static void gst_sndiosink_cb(void * addr, int delta);
+
+GST_BOILERPLATE (GstSndioSink, gst_sndiosink, GstAudioSink, GST_TYPE_AUDIO_SINK);
+
+static void
+gst_sndiosink_base_init (gpointer g_class)
+{
+ GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
+
+ gst_element_class_set_details_simple (element_class,
+ "Sndio audio sink", "Sink/Audio", "Plays audio through sndio",
+ "Jacob Meuser <jakemsr@sdf.lonestar.org>");
+
+ gst_element_class_add_pad_template (element_class,
+ gst_static_pad_template_get (&sndio_sink_factory));
+}
+
+static void
+gst_sndiosink_class_init (GstSndioSinkClass * klass)
+{
+ GObjectClass *gobject_class;
+ GstBaseSinkClass *gstbasesink_class;
+ GstBaseAudioSinkClass *gstbaseaudiosink_class;
+ GstAudioSinkClass *gstaudiosink_class;
+
+ gobject_class = (GObjectClass *) klass;
+ gstbasesink_class = (GstBaseSinkClass *) klass;
+ gstbaseaudiosink_class = (GstBaseAudioSinkClass *) klass;
+ gstaudiosink_class = (GstAudioSinkClass *) klass;
+
+ parent_class = g_type_class_peek_parent (klass);
+
+ gobject_class->finalize = gst_sndiosink_finalize;
+
+ gstbasesink_class->get_caps = GST_DEBUG_FUNCPTR (gst_sndiosink_getcaps);
+
+ gstaudiosink_class->open = GST_DEBUG_FUNCPTR (gst_sndiosink_open);
+ gstaudiosink_class->close = GST_DEBUG_FUNCPTR (gst_sndiosink_close);
+ gstaudiosink_class->prepare = GST_DEBUG_FUNCPTR (gst_sndiosink_prepare);
+ gstaudiosink_class->unprepare = GST_DEBUG_FUNCPTR (gst_sndiosink_unprepare);
+ gstaudiosink_class->write = GST_DEBUG_FUNCPTR (gst_sndiosink_write);
+ gstaudiosink_class->delay = GST_DEBUG_FUNCPTR (gst_sndiosink_delay);
+ gstaudiosink_class->reset = GST_DEBUG_FUNCPTR (gst_sndiosink_reset);
+
+ gobject_class->set_property = gst_sndiosink_set_property;
+ gobject_class->get_property = gst_sndiosink_get_property;
+
+ /* default value is filled in the _init method */
+ g_object_class_install_property (gobject_class, PROP_HOST,
+ g_param_spec_string ("host", "Host",
+ "Device or socket sndio will access", NULL, G_PARAM_READWRITE));
+}
+
+static void
+gst_sndiosink_init (GstSndioSink * sndiosink, GstSndioSinkClass * klass)
+{
+ sndiosink->hdl = NULL;
+ sndiosink->host = g_strdup (g_getenv ("AUDIODEVICE"));
+}
+
+static void
+gst_sndiosink_finalize (GObject * object)
+{
+ GstSndioSink *sndiosink = GST_SNDIOSINK (object);
+
+ gst_caps_replace (&sndiosink->cur_caps, NULL);
+ g_free (sndiosink->host);
+
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+static GstCaps *
+gst_sndiosink_getcaps (GstBaseSink * bsink)
+{
+ GstSndioSink *sndiosink;
+
+ sndiosink = GST_SNDIOSINK (bsink);
+
+ /* no hdl, we're done with the template caps */
+ if (sndiosink->cur_caps == NULL) {
+ GST_LOG_OBJECT (sndiosink, "getcaps called, returning template caps");
+ return NULL;
+ }
+
+ GST_LOG_OBJECT (sndiosink, "returning %" GST_PTR_FORMAT, sndiosink->cur_caps);
+
+ return gst_caps_ref (sndiosink->cur_caps);
+}
+
+static gboolean
+gst_sndiosink_open (GstAudioSink * asink)
+{
+ GstPadTemplate *pad_template;
+ GstSndioSink *sndiosink;
+ struct sio_par par;
+ struct sio_cap cap;
+ GArray *rates, *chans;
+ GValue rates_v = { 0 };
+ GValue chans_v = { 0 };
+ GValue value = { 0 };
+ struct sio_enc enc;
+ struct sio_conf conf;
+ int confs[SIO_NCONF];
+ int rate, chan;
+ int i, j, k;
+ int nconfs;
+
+ sndiosink = GST_SNDIOSINK (asink);
+
+ GST_DEBUG_OBJECT (sndiosink, "open");
+
+ /* conect */
+ sndiosink->hdl = sio_open (sndiosink->host, SIO_PLAY, 0);
+
+ if (sndiosink->hdl == NULL)
+ goto couldnt_connect;
+
+ /* Use sndio defaults as the only encodings, but get the supported
+ * sample rates and number of channels.
+ */
+
+ if (!sio_getpar(sndiosink->hdl, &par))
+ goto no_server_info;
+
+ if (!sio_getcap(sndiosink->hdl, &cap))
+ goto no_server_info;
+
+ rates = g_array_new(FALSE, FALSE, sizeof(int));
+ chans = g_array_new(FALSE, FALSE, sizeof(int));
+
+ /* find confs that have the default encoding */
+ nconfs = 0;
+ for (i = 0; i < cap.nconf; i++) {
+ for (j = 0; j < SIO_NENC; j++) {
+ if (cap.confs[i].enc & (1 << j)) {
+ enc = cap.enc[j];
+ if (enc.bits == par.bits && enc.sig == par.sig && enc.le == par.le) {
+ confs[nconfs] = i;
+ nconfs++;
+ break;
+ }
+ }
+ }
+ }
+
+ /* find the rates and channels of the confs that have the default encoding */
+ for (i = 0; i < nconfs; i++) {
+ conf = cap.confs[confs[i]];
+ /* rates */
+ for (j = 0; j < SIO_NRATE; j++) {
+ if (conf.rate & (1 << j)) {
+ rate = cap.rate[j];
+ for (k = 0; k < rates->len && rate; k++) {
+ if (rate == g_array_index(rates, int, k))
+ rate = 0;
+ }
+ /* add in ascending order */
+ if (rate) {
+ for (k = 0; k < rates->len; k++) {
+ if (rate < g_array_index(rates, int, k)) {
+ g_array_insert_val(rates, k, rate);
+ break;
+ }
+ }
+ if (k == rates->len)
+ g_array_append_val(rates, rate);
+ }
+ }
+ }
+ /* channels */
+ for (j = 0; j < SIO_NCHAN; j++) {
+ if (conf.pchan & (1 << j)) {
+ chan = cap.pchan[j];
+ for (k = 0; k < chans->len && chan; k++) {
+ if (chan == g_array_index(chans, int, k))
+ chan = 0;
+ }
+ /* add in ascending order */
+ if (chan) {
+ for (k = 0; k < chans->len; k++) {
+ if (chan < g_array_index(chans, int, k)) {
+ g_array_insert_val(chans, k, chan);
+ break;
+ }
+ }
+ if (k == chans->len)
+ g_array_append_val(chans, chan);
+ }
+ }
+ }
+ }
+ /* not sure how this can happen, but it might */
+ if (cap.nconf == 0) {
+ g_array_append_val(rates, par.rate);
+ g_array_append_val(chans, par.pchan);
+ }
+
+ g_value_init(&rates_v, GST_TYPE_LIST);
+ g_value_init(&chans_v, GST_TYPE_LIST);
+ g_value_init(&value, G_TYPE_INT);
+
+ for (i = 0; i < rates->len; i++) {
+ g_value_set_int(&value, g_array_index(rates, int, i));
+ gst_value_list_append_value(&rates_v, &value);
+ }
+ for (i = 0; i < chans->len; i++) {
+ g_value_set_int(&value, g_array_index(chans, int, i));
+ gst_value_list_append_value(&chans_v, &value);
+ }
+
+ g_array_free(rates, TRUE);
+ g_array_free(chans, TRUE);
+
+ pad_template = gst_static_pad_template_get (&sndio_sink_factory);
+ sndiosink->cur_caps = gst_caps_copy (gst_pad_template_get_caps (pad_template));
+ gst_object_unref (pad_template);
+
+ for (i = 0; i < sndiosink->cur_caps->structs->len; i++) {
+ GstStructure *s;
+
+ s = gst_caps_get_structure (sndiosink->cur_caps, i);
+ gst_structure_set (s, "endianness", G_TYPE_INT, par.le ? 1234 : 4321, NULL);
+ gst_structure_set (s, "signed", G_TYPE_BOOLEAN, par.sig ? TRUE : FALSE, NULL);
+ gst_structure_set (s, "width", G_TYPE_INT, par.bits, NULL);
+ // gst_structure_set (s, "depth", G_TYPE_INT, par.bps * 8, NULL); /* XXX */
+ gst_structure_set_value (s, "rate", &rates_v);
+ gst_structure_set_value (s, "channels", &chans_v);
+ }
+
+ return TRUE;
+
+ /* ERRORS */
+couldnt_connect:
+ {
+ GST_ELEMENT_ERROR (sndiosink, RESOURCE, OPEN_WRITE,
+ (_("Could not establish connection to sndio")),
+ ("can't open connection to sndio"));
+ return FALSE;
+ }
+no_server_info:
+ {
+ GST_ELEMENT_ERROR (sndiosink, RESOURCE, OPEN_WRITE,
+ (_("Failed to query sndio capabilities")),
+ ("couldn't get sndio info!"));
+ return FALSE;
+ }
+}
+
+static gboolean
+gst_sndiosink_close (GstAudioSink * asink)
+{
+ GstSndioSink *sndiosink = GST_SNDIOSINK (asink);
+
+ GST_DEBUG_OBJECT (sndiosink, "close");
+
+ gst_caps_replace (&sndiosink->cur_caps, NULL);
+ sio_close (sndiosink->hdl);
+ sndiosink->hdl = NULL;
+
+ return TRUE;
+}
+
+static void
+gst_sndiosink_cb(void *addr, int delta)
+{
+ GstSndioSink *sndiosink = GST_SNDIOSINK ((GstAudioSink *)addr);
+
+ sndiosink->realpos += delta;
+
+ if (sndiosink->realpos >= sndiosink->playpos)
+ sndiosink->latency = 0;
+ else
+ sndiosink->latency = sndiosink->playpos - sndiosink->realpos;
+}
+
+static gboolean
+gst_sndiosink_prepare (GstAudioSink * asink, GstRingBufferSpec * spec)
+{
+ GstSndioSink *sndiosink = GST_SNDIOSINK (asink);
+ struct sio_par par;
+ int spec_bpf;
+
+ GST_DEBUG_OBJECT (sndiosink, "prepare");
+
+ sndiosink->playpos = sndiosink->realpos = sndiosink->latency = 0;
+
+ sio_initpar(&par);
+ par.sig = spec->sign;
+ par.le = !spec->bigend;
+ par.bits = spec->width;
+ // par.bps = spec->depth / 8; /* XXX */
+ par.rate = spec->rate;
+ par.pchan = spec->channels;
+
+ spec_bpf = ((spec->width / 8) * spec->channels);
+
+ par.appbufsz = (spec->segsize * spec->segtotal) / spec_bpf;
+
+ if (!sio_setpar(sndiosink->hdl, &par))
+ goto cannot_configure;
+
+ sio_getpar(sndiosink->hdl, &par);
+
+ spec->sign = par.sig;
+ spec->bigend = !par.le;
+ spec->width = par.bits;
+ // spec->depth = par.bps * 8; /* XXX */
+ spec->rate = par.rate;
+ spec->channels = par.pchan;
+
+ sndiosink->bpf = par.bps * par.pchan;
+
+ spec->segsize = par.round * par.pchan * par.bps;
+ spec->segtotal = par.bufsz / par.round;
+
+ /* FIXME: this is wrong for signed ints (and the
+ * audioringbuffers should do it for us anyway) */
+ spec->silence_sample[0] = 0;
+ spec->silence_sample[1] = 0;
+ spec->silence_sample[2] = 0;
+ spec->silence_sample[3] = 0;
+
+ sio_onmove(sndiosink->hdl, gst_sndiosink_cb, sndiosink);
+
+ if (!sio_start(sndiosink->hdl))
+ goto cannot_start;
+
+ GST_INFO_OBJECT (sndiosink, "successfully opened connection to sndio");
+
+ return TRUE;
+
+ /* ERRORS */
+cannot_configure:
+ {
+ GST_ELEMENT_ERROR (sndiosink, RESOURCE, OPEN_WRITE,
+ (_("Could not configure sndio")),
+ ("can't configure sndio"));
+ return FALSE;
+ }
+cannot_start:
+ {
+ GST_ELEMENT_ERROR (sndiosink, RESOURCE, OPEN_WRITE,
+ (_("Could not start sndio")),
+ ("can't start sndio"));
+ return FALSE;
+ }
+}
+
+static gboolean
+gst_sndiosink_unprepare (GstAudioSink * asink)
+{
+ GstSndioSink *sndiosink = GST_SNDIOSINK (asink);
+
+ if (sndiosink->hdl == NULL)
+ return TRUE;
+
+ sio_stop(sndiosink->hdl);
+
+ return TRUE;
+}
+
+static guint
+gst_sndiosink_write (GstAudioSink * asink, gpointer data, guint length)
+{
+ GstSndioSink *sndiosink = GST_SNDIOSINK (asink);
+ guint done;
+
+ done = sio_write (sndiosink->hdl, data, length);
+
+ if (done == 0)
+ goto write_error;
+
+ sndiosink->playpos += (done / sndiosink->bpf);
+
+ data = (char *) data + done;
+
+ return done;
+
+ /* ERRORS */
+write_error:
+ {
+ GST_ELEMENT_ERROR (sndiosink, RESOURCE, WRITE,
+ ("Failed to write data to sndio"), GST_ERROR_SYSTEM);
+ return 0;
+ }
+}
+
+static guint
+gst_sndiosink_delay (GstAudioSink * asink)
+{
+ GstSndioSink *sndiosink = GST_SNDIOSINK (asink);
+
+ if (sndiosink->latency == (guint) - 1) {
+ GST_WARNING_OBJECT (asink, "couldn't get latency");
+ return 0;
+ }
+
+ GST_DEBUG_OBJECT (asink, "got latency: %u", sndiosink->latency);
+
+ return sndiosink->latency;
+}
+
+static void
+gst_sndiosink_reset (GstAudioSink * asink)
+{
+ /* no way to flush the buffers with sndio ? */
+
+ GST_DEBUG_OBJECT (asink, "reset called");
+}
+
+static void
+gst_sndiosink_set_property (GObject * object, guint prop_id, const GValue * value,
+ GParamSpec * pspec)
+{
+ GstSndioSink *sndiosink = GST_SNDIOSINK (object);
+
+ switch (prop_id) {
+ case PROP_HOST:
+ g_free (sndiosink->host);
+ sndiosink->host = g_value_dup_string (value);
+ break;
+ default:
+ break;
+ }
+}
+
+static void
+gst_sndiosink_get_property (GObject * object, guint prop_id, GValue * value,
+ GParamSpec * pspec)
+{
+ GstSndioSink *sndiosink = GST_SNDIOSINK (object);
+
+ switch (prop_id) {
+ case PROP_HOST:
+ g_value_set_string (value, sndiosink->host);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
diff --git a/java/openjfx8-devel/files/sndiosink.h b/java/openjfx8-devel/files/sndiosink.h
new file mode 100644
index 000000000000..25bb8799bd4d
--- /dev/null
+++ b/java/openjfx8-devel/files/sndiosink.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) <2008> Jacob Meuser <jakemsr@sdf.lonestar.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+
+#ifndef __GST_SNDIOSINK_H__
+#define __GST_SNDIOSINK_H__
+
+#include <sndio.h>
+
+#include <gst/gst.h>
+#include <gst/audio/gstaudiosink.h>
+
+G_BEGIN_DECLS
+
+#define GST_TYPE_SNDIOSINK \
+ (gst_sndiosink_get_type())
+#define GST_SNDIOSINK(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SNDIOSINK,GstSndioSink))
+#define GST_SNDIOSINK_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SNDIOSINK,GstSndioSinkClass))
+#define GST_IS_SNDIOSINK(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SNDIOSINK))
+#define GST_IS_SNDIOSINK_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SNDIOSINK))
+
+typedef struct _GstSndioSink GstSndioSink;
+typedef struct _GstSndioSinkClass GstSndioSinkClass;
+
+struct _GstSndioSink {
+ GstAudioSink sink;
+
+ struct sio_hdl *hdl;
+ gchar *host;
+
+ /* bytes per frame */
+ int bpf;
+
+ /* frames counts */
+ volatile long long realpos;
+ volatile long long playpos;
+ volatile guint latency;
+
+ GstCaps *cur_caps;
+};
+
+struct _GstSndioSinkClass {
+ GstAudioSinkClass parent_class;
+};
+
+GType gst_sndiosink_get_type (void);
+
+G_END_DECLS
+
+#endif /* __GST_SNDIOSINK_H__ */