java/openjfx14: add new port

OpenJFX is an open source, next generation client application platform for
desktop and embedded systems based on JavaSE. It is a collaborative effort by
many individuals and companies with the goal of producing a modern, efficient,
and fully featured toolkit for developing rich client applications.

PR:		248248
This commit is contained in:
Mikael Urankar
2020-10-28 17:15:33 +00:00
parent 6be7a09bd2
commit 119b9927c5
60 changed files with 2742 additions and 0 deletions

View File

@@ -102,6 +102,7 @@
SUBDIR += openjdk8-jre
SUBDIR += openjfx8-devel
SUBDIR += openjfx8-scenebuilder
SUBDIR += openjfx14
SUBDIR += phpeclipse
SUBDIR += proguard
SUBDIR += sablevm

165
java/openjfx14/Makefile Normal file
View File

@@ -0,0 +1,165 @@
# $FreeBSD$
PORTNAME= openjfx
DISTVERSION= 14.0.2.1+1
CATEGORIES= java x11-toolkits devel
MASTER_SITES= https://repo.maven.apache.org/maven2/org/apache/lucene/lucene-core/7.7.1/:core \
https://repo.maven.apache.org/maven2/org/apache/lucene/lucene-grouping/7.7.1/:grouping \
https://repo.maven.apache.org/maven2/org/apache/lucene/lucene-queries/7.7.1/:queries \
https://repo.maven.apache.org/maven2/org/apache/lucene/lucene-queryparser/7.7.1/:queryparser \
https://repo.maven.apache.org/maven2/org/apache/lucene/lucene-sandbox/7.7.1/:sandbox \
https://repo1.maven.org/maven2/org/antlr/antlr4/4.7.2/:antlr
PKGNAMESUFFIX= 14
DISTFILES= lucene-core-7.7.1.jar:core \
lucene-grouping-7.7.1.jar:grouping \
lucene-queries-7.7.1.jar:queries \
lucene-queryparser-7.7.1.jar:queryparser \
lucene-sandbox-7.7.1.jar:sandbox \
antlr4-4.7.2-complete.jar:antlr
MAINTAINER= mikael@FreeBSD.org
COMMENT= JavaFX SDK overlay for OpenJDK 11
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/LICENSE
ONLY_FOR_ARCHS= aarch64 amd64 powerpc64
BUILD_DEPENDS= zip:archivers/zip \
apache-ant>0:devel/apache-ant \
gradle62>=6.2:devel/gradle62 \
${JAVALIBDIR}/junit.jar:java/junit
LIB_DEPENDS= libasound.so:audio/alsa-lib \
libfontconfig.so:x11-fonts/fontconfig \
libfreetype.so:print/freetype2
USES= gettext-runtime gl gnome jpeg localbase:ldflags ninja pkgconfig \
sqlite xorg
USE_GITHUB= yes
GH_ACCOUNT= openjdk
GH_PROJECT= jfx
USE_GL= gl
USE_GNOME= atk cairo gdkpixbuf2 glib20 gtk20 gtk30 pango
USE_JAVA= yes
JAVA_VERSION= 11
USE_LDCONFIG= yes
USE_XORG= x11 xtst xxf86vm
CFLAGS+= -Wno-unused-command-line-argument
PLIST_SUB= INSTALLDIR=${_INSTALLDIR}
OPTIONS_DEFINE= MEDIA SWT TEST WEBKIT
OPTIONS_DEFAULT= MEDIA WEBKIT
OPTIONS_SUB= yes
MEDIA_DESC= Media module
SWT_DESC= SWT support
MEDIA_LIB_DEPENDS= libavcodec.so:multimedia/ffmpeg \
libsndio.so:audio/sndio
MEDIA_USES= gmake
MEDIA_VARS= COMPILE_MEDIA=true
SWT_BUILD_DEPENDS= swt>0:x11-toolkits/swt
SWT_RUN_DEPENDS= swt>0:x11-toolkits/swt
SWT_VARS= COMPILE_SWT=true
TEST_USES= display:test
TEST_VARS= AWT_TEST=true FULL_TEST=true
# Gradle calls CMake during the build
WEBKIT_IMPLIES= MEDIA
WEBKIT_BUILD_DEPENDS= cmake:devel/cmake
WEBKIT_LIB_DEPENDS= libicui18n.so:devel/icu
WEBKIT_USES= bison gmake gperf perl5 python:3.5+,build
WEBKIT_USE= GNOME=libxslt,libxml2 \
PERL5=build \
RUBY=yes \
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= CC=${WRKDIR}/bin/ccwrapper \
CXX=${WRKDIR}/bin/cxxwrapper \
GRADLE_USER_HOME=${WRKDIR}/gradle-home \
JAVA_VERSION=${JAVA_VERSION}
_GRADLE_RUN= ${SETENV} ${_GRADLE_ENV} gradle62 --no-daemon
_INSTALLDIR= ${PREFIX}/${PKGBASE}
post-extract:
${MKDIR} ${WRKDIR}/jars
.for f in core grouping queries queryparser sandbox
${CP} ${DISTDIR}/lucene-${f}-7.7.1.jar ${WRKDIR}/jars
.endfor
${CP} ${DISTDIR}/antlr4-4.7.2-complete.jar ${WRKDIR}/jars
# 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/javafx.media/src/main/native/jfxmedia/projects/linux \
${WRKSRC}/modules/javafx.media/src/main/native/jfxmedia/projects/bsd
@${CP} -r ${WRKSRC}/modules/javafx.media/src/main/native/gstreamer/projects/linux \
${WRKSRC}/modules/javafx.media/src/main/native/gstreamer/projects/bsd
post-patch:
@${MKDIR} ${WRKDIR}/bin
@${PRINTF} '#!/bin/sh\nexec ${CCACHE_BIN} ${CC} ${CFLAGS} ${LDFLAGS} "$$@"\n' > ${WRKDIR}/bin/ccwrapper
@${PRINTF} '#!/bin/sh\nexec ${CCACHE_BIN} ${CXX} ${CXXFLAGS} ${LDFLAGS} "$$@"\n' > ${WRKDIR}/bin/cxxwrapper
@${CHMOD} +x ${WRKDIR}/bin/ccwrapper ${WRKDIR}/bin/cxxwrapper
@${REINPLACE_CMD} -e 's|gcc|${WRKDIR}/bin/ccwrapper|g' \
-e 's|g\+\+|${WRKDIR}/bin/cxxwrapper|g' \
${WRKSRC}/buildSrc/bsd.gradle
# 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/javafx.media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/ext/bsdaudio
@${CP} ${FILESDIR}/gstsndio.* ${FILESDIR}/sndiosink.* \
${WRKSRC}/modules/javafx.media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/ext/bsdaudio
@cd ${WRKSRC}/modules/javafx.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 bundled libraries. We use the system's versions instead.
@cd ${WRKSRC}/modules/javafx.web/src/main/native/Source/ThirdParty && \
${RM} -r icu libxml libxslt sqlite
@${RM} -r ${WRKSRC}/modules/javafx.web/src/main/native/Source/WTF/icu
@cd ${WRKSRC}/modules/javafx.media/src/main/native/gstreamer/3rd_party && \
${RM} -r glib libffi
do-configure:
@${MKDIR} ${WRKDIR}/gradle-home
@${ECHO_CMD} "NUM_COMPILE_THREADS = ${MAKE_JOBS_NUMBER}" > ${WRKSRC}/gradle.properties
@${ECHO_CMD} "JFX_DEPS_URL = ${WRKDIR}/jars" > ${WRKSRC}/gradle.properties
.for prop in COMPILE_MEDIA COMPILE_WEBKIT AWT_TEST FULL_TEST
@${ECHO_CMD} "${prop} = ${${prop}:Ufalse}" >> ${WRKSRC}/gradle.properties
.endfor
@${ECHO_CMD} "BSD.compileSWT = ${COMPILE_SWT:Ufalse};" >> ${WRKSRC}/buildSrc/bsd.gradle
# the java doc are not installed on FreeBSD so exclude the javadoc task
# as it'll fail otherwise
do-build:
@cd ${WRKSRC} && ${SETENV} ${_GRADLE_RUN} zips --exclude-task javadoc
# it's not recommended to install openjfx inside openjdk directory
do-install:
@${MKDIR} ${STAGEDIR}${_INSTALLDIR} \
${STAGEDIR}${_INSTALLDIR}/lib \
${STAGEDIR}${_INSTALLDIR}/jmods
${INSTALL_DATA} ${WRKSRC}/build/javafx-exports.zip ${STAGEDIR}${_INSTALLDIR}
(cd ${WRKSRC}/build/artifacts/javafx-sdk-14.0.2.1/lib && ${COPYTREE_SHARE} . ${STAGEDIR}${_INSTALLDIR}/lib)
@${MV} ${STAGEDIR}${_INSTALLDIR}/lib/src.zip ${STAGEDIR}${_INSTALLDIR}/lib/javafx-src.zip
(cd ${WRKSRC}/build/artifacts/javafx-jmods-14.0.2.1 && ${COPYTREE_SHARE} . ${STAGEDIR}${_INSTALLDIR}/jmods)
@${FIND} ${STAGEDIR}${_INSTALLDIR}/lib -name '*.so' -exec ${STRIP_CMD} \{\} \;
do-test-TEST-on:
@cd ${WRKSRC} && ${_GRADLE_RUN} check test
.include <bsd.port.mk>

15
java/openjfx14/distinfo Normal file
View File

@@ -0,0 +1,15 @@
TIMESTAMP = 1600515648
SHA256 (lucene-core-7.7.1.jar) = 4a96eba551129bc7eebdff5586aeb8729da0889bd05d9ac2dab0ff4924548d27
SIZE (lucene-core-7.7.1.jar) = 3088010
SHA256 (lucene-grouping-7.7.1.jar) = c031e6dfc3f9c744fc2747228245a294e1276f1fca5003b11639de18162d61eb
SIZE (lucene-grouping-7.7.1.jar) = 87267
SHA256 (lucene-queries-7.7.1.jar) = b7f29a9874010697c83443091005301707899176f0873b41708fed3c47e58d78
SIZE (lucene-queries-7.7.1.jar) = 265080
SHA256 (lucene-queryparser-7.7.1.jar) = 7e1d509aa3fffd19ed0d89c8bb1fcd91bea37462955a9862fbc2d4600c4bb2a3
SIZE (lucene-queryparser-7.7.1.jar) = 381910
SHA256 (lucene-sandbox-7.7.1.jar) = 865f472ed473bd78ec8309306b6d9484a3fe26cffef1a895d8873927eebad5d1
SIZE (lucene-sandbox-7.7.1.jar) = 279651
SHA256 (antlr4-4.7.2-complete.jar) = 6852386d7975eff29171dae002cc223251510d35f291ae277948f381a7b380b4
SIZE (antlr4-4.7.2-complete.jar) = 2079769
SHA256 (openjdk-jfx-14.0.2.1+1_GH0.tar.gz) = 08830d79dbdaadf66a1feae356caed6d70636dfdbf47598dd48a59f407d05ef1
SIZE (openjdk-jfx-14.0.2.1+1_GH0.tar.gz) = 67975108

View File

@@ -0,0 +1,396 @@
/*
* Copyright (C) 2008 Jacob Meuser <jakemsr@sdf.lonestar.org>
* Copyright (C) 2012 Alexandre Ratchov <alex@caoua.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 <stdio.h>
#include "gstsndio.h"
GST_DEBUG_CATEGORY (gst_sndio_debug);
#define GST_CAT_DEFAULT gst_sndio_debug
GType gst_sndiosink_get_type (void);
gboolean
plugin_init_alsa (GstPlugin * plugin)
{
GST_DEBUG_CATEGORY_INIT (gst_sndio_debug, "sndio", 0, "sndio plugins");
/* prefer sndiosink over pulsesink (GST_RANK_PRIMARY + 10) */
if (!gst_element_register (plugin, "bsdaudiosink", GST_RANK_PRIMARY + 20,
gst_sndiosink_get_type()))
return FALSE;
return TRUE;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
sndio,
"sndio plugin library",
plugin_init_alsa, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
/*
* common code to src and sink
*/
void
gst_sndio_init (struct gstsndio *sio, GObject *obj)
{
sio->obj = obj;
sio->hdl = NULL;
sio->device = g_strdup (SIO_DEVANY);
}
void
gst_sndio_finalize (struct gstsndio *sio)
{
gst_caps_replace (&sio->cur_caps, NULL);
g_free (sio->device);
}
GstCaps *
gst_sndio_getcaps (struct gstsndio *sio, GstCaps * filter)
{
if (sio->cur_caps == NULL) {
/* XXX */
GST_LOG_OBJECT (sio->obj, "getcaps called, returning template caps");
return NULL;
}
GST_LOG_OBJECT (sio->obj, "returning %" GST_PTR_FORMAT, sio->cur_caps);
if (filter) {
return gst_caps_intersect_full (filter,
sio->cur_caps, GST_CAPS_INTERSECT_FIRST);
} else {
return gst_caps_ref (sio->cur_caps);
}
}
static void
gst_sndio_onvol (void *arg, unsigned int vol)
{
struct gstsndio *sio = arg;
sio->volume = vol;
g_object_notify (G_OBJECT (sio->obj), "mute");
g_object_notify (G_OBJECT (sio->obj), "volume");
}
gboolean
gst_sndio_open (struct gstsndio *sio, gint mode)
{
GValue list = G_VALUE_INIT, item = G_VALUE_INIT;
GstStructure *s;
GstCaps *caps;
struct sio_enc *enc;
struct sio_cap cap;
char fmt[16];
int i, chan;
GST_DEBUG_OBJECT (sio->obj, "open");
sio->hdl = sio_open (sio->device, mode, 0);
if (sio->hdl == NULL) {
GST_ELEMENT_ERROR (sio->obj, RESOURCE, OPEN_READ_WRITE,
("Couldn't open sndio device"), (NULL));
return FALSE;
}
sio->mode = mode;
if (!sio_getcap(sio->hdl, &cap)) {
GST_ELEMENT_ERROR (sio, RESOURCE, OPEN_WRITE,
("Couldn't get device capabilities"), (NULL));
sio_close(sio->hdl);
sio->hdl = NULL;
return FALSE;
}
if (cap.nconf == 0) {
GST_ELEMENT_ERROR (sio, RESOURCE, OPEN_WRITE,
("Device has empty capabilities"), (NULL));
sio_close(sio->hdl);
sio->hdl = NULL;
return FALSE;
}
sio_onvol (sio->hdl, gst_sndio_onvol, sio);
caps = gst_caps_new_empty ();
s = gst_structure_new ("audio/x-raw", (char *)NULL, (void *)NULL);
/*
* scan supported rates
*/
g_value_init (&list, GST_TYPE_LIST);
g_value_init (&item, G_TYPE_INT);
for (i = 0; i < SIO_NRATE; i++) {
if ((cap.confs[0].rate & (1 << i)) == 0)
continue;
g_value_set_int(&item, cap.rate[i]);
gst_value_list_append_value (&list, &item);
}
gst_structure_set_value (s, "rate", &list);
g_value_unset (&item);
g_value_unset (&list);
/*
* scan supported channels
*/
g_value_init (&list, GST_TYPE_LIST);
g_value_init (&item, G_TYPE_INT);
chan = (mode == SIO_PLAY) ? cap.confs[0].pchan : cap.confs[0].rchan;
for (i = 0; i < SIO_NCHAN; i++) {
if ((chan & (1 << i)) == 0)
continue;
g_value_set_int(&item, (mode == SIO_PLAY) ? cap.pchan[i] : cap.rchan[i]);
gst_value_list_append_value (&list, &item);
}
gst_structure_set_value (s, "channels", &list);
g_value_unset (&item);
g_value_unset (&list);
/*
* scan supported encodings
*/
g_value_init (&list, GST_TYPE_LIST);
g_value_init (&item, G_TYPE_STRING);
for (i = 0; i < SIO_NENC; i++) {
if ((cap.confs[0].enc & (1 << i)) == 0)
continue;
enc = cap.enc + i;
if (enc->bits % 8 != 0)
continue;
if (enc->bits < enc->bps * 8 && enc->msb)
continue;
if (enc->bits == enc->bps * 8) {
snprintf(fmt, sizeof(fmt), "%s%u%s",
enc->sig ? "S" : "U",
enc->bits,
enc->bps > 1 ? (enc->le ? "LE" : "BE") : "");
} else {
snprintf(fmt, sizeof(fmt), "%s%u_%u%s",
enc->sig ? "S" : "U",
enc->bits,
enc->bps * 8,
enc->bps > 1 ? (enc->le ? "LE" : "BE") : "");
}
g_value_set_string(&item, fmt);
gst_value_list_append_value (&list, &item);
}
gst_structure_set_value (s, "format", &list);
g_value_unset (&item);
g_value_unset (&list);
/*
* add the only supported layout: interleaved
*/
g_value_init (&item, G_TYPE_STRING);
g_value_set_string(&item, "interleaved");
gst_structure_set_value (s, "layout", &item);
g_value_unset (&item);
gst_caps_append_structure (caps, s);
sio->cur_caps = caps;
GST_DEBUG ("caps are %s", gst_caps_to_string(caps));
return TRUE;
}
gboolean
gst_sndio_close (struct gstsndio *sio)
{
GST_DEBUG_OBJECT (sio->obj, "close");
gst_caps_replace (&sio->cur_caps, NULL);
sio_close (sio->hdl);
sio->hdl = NULL;
return TRUE;
}
static void
gst_sndio_cb (void *addr, int delta)
{
struct gstsndio *sio = addr;
delta *= sio->bpf;
if (sio->mode == SIO_PLAY)
sio->delay -= delta;
else
sio->delay += delta;
}
gboolean
gst_sndio_prepare (struct gstsndio *sio, GstAudioRingBufferSpec *spec)
{
struct sio_par par, retpar;
unsigned nchannels;
GST_DEBUG_OBJECT (sio, "prepare");
if (spec->type != GST_AUDIO_RING_BUFFER_FORMAT_TYPE_RAW) {
GST_ELEMENT_ERROR (sio, RESOURCE, OPEN_READ_WRITE,
("Only raw buffer format supported by sndio"), (NULL));
return FALSE;
}
if (!GST_AUDIO_INFO_IS_INTEGER(&spec->info)) {
GST_ELEMENT_ERROR (sio, RESOURCE, OPEN_READ_WRITE,
("Only integer format supported"), (NULL));
return FALSE;
}
if (GST_AUDIO_INFO_DEPTH(&spec->info) % 8) {
GST_ELEMENT_ERROR (sio, RESOURCE, OPEN_READ_WRITE,
("Only depths multiple of 8 are supported"), (NULL));
return FALSE;
}
sio_initpar (&par);
switch (GST_AUDIO_INFO_FORMAT (&spec->info)) {
case GST_AUDIO_FORMAT_S8:
case GST_AUDIO_FORMAT_U8:
case GST_AUDIO_FORMAT_S16LE:
case GST_AUDIO_FORMAT_S16BE:
case GST_AUDIO_FORMAT_U16LE:
case GST_AUDIO_FORMAT_U16BE:
case GST_AUDIO_FORMAT_S32LE:
case GST_AUDIO_FORMAT_S32BE:
case GST_AUDIO_FORMAT_U32LE:
case GST_AUDIO_FORMAT_U32BE:
case GST_AUDIO_FORMAT_S24_32LE:
case GST_AUDIO_FORMAT_S24_32BE:
case GST_AUDIO_FORMAT_U24_32LE:
case GST_AUDIO_FORMAT_U24_32BE:
case GST_AUDIO_FORMAT_S24LE:
case GST_AUDIO_FORMAT_S24BE:
case GST_AUDIO_FORMAT_U24LE:
case GST_AUDIO_FORMAT_U24BE:
break;
default:
GST_ELEMENT_ERROR (sio, RESOURCE, OPEN_READ_WRITE,
("Unsupported audio format"),
("format = %d", GST_AUDIO_INFO_FORMAT (&spec->info)));
return FALSE;
}
par.sig = GST_AUDIO_INFO_IS_SIGNED(&spec->info);
par.bits = GST_AUDIO_INFO_WIDTH(&spec->info);
par.bps = GST_AUDIO_INFO_DEPTH(&spec->info) / 8;
if (par.bps > 1)
par.le = GST_AUDIO_INFO_IS_LITTLE_ENDIAN(&spec->info);
if (par.bits < par.bps * 8)
par.msb = 0;
par.rate = GST_AUDIO_INFO_RATE(&spec->info);
if (sio->mode == SIO_PLAY)
par.pchan = GST_AUDIO_INFO_CHANNELS(&spec->info);
else
par.rchan = GST_AUDIO_INFO_CHANNELS(&spec->info);
par.round = par.rate / 1000000. * spec->latency_time;
par.appbufsz = par.rate / 1000000. * spec->buffer_time;
if (!sio_setpar (sio->hdl, &par)) {
GST_ELEMENT_ERROR (sio, RESOURCE, OPEN_WRITE,
("Unsupported audio encoding"), (NULL));
return FALSE;
}
if (!sio_getpar (sio->hdl, &retpar)) {
GST_ELEMENT_ERROR (sio, RESOURCE, OPEN_WRITE,
("Couldn't get audio device parameters"), (NULL));
return FALSE;
}
#if 0
GST_DEBUG ("format = %s, "
"requested: sig = %d, bits = %d, bps = %d, le = %d, msb = %d, "
"rate = %d, pchan = %d, round = %d, appbufsz = %d; "
"returned: sig = %d, bits = %d, bps = %d, le = %d, msb = %d, "
"rate = %d, pchan = %d, round = %d, appbufsz = %d, bufsz = %d",
GST_AUDIO_INFO_NAME(&spec->info),
par.sig, par.bits, par.bps, par.le, par.msb,
par.rate, par.pchan, par.round, par.appbufsz,
retpar.sig, retpar.bits, retpar.bps, retpar.le, retpar.msb,
retpar.rate, retpar.pchan, retpar.round, retpar.appbufsz, retpar.bufsz);
#endif
if (par.bits != retpar.bits ||
par.bps != retpar.bps ||
par.rate != retpar.rate ||
(sio->mode == SIO_PLAY && par.pchan != retpar.pchan) ||
(sio->mode == SIO_REC && par.rchan != retpar.rchan) ||
(par.bps > 1 && par.le != retpar.le) ||
(par.bits < par.bps * 8 && par.msb != retpar.msb)) {
GST_ELEMENT_ERROR (sio, RESOURCE, OPEN_WRITE,
("Audio device refused requested parameters"), (NULL));
return FALSE;
}
nchannels = (sio->mode == SIO_PLAY) ? retpar.pchan : retpar.rchan;
spec->segsize = retpar.round * retpar.bps * nchannels;
spec->segtotal = retpar.bufsz / retpar.round;
sio->bpf = retpar.bps * nchannels;
sio->delay = 0;
sio_onmove (sio->hdl, gst_sndio_cb, sio);
if (!sio_start (sio->hdl)) {
GST_ELEMENT_ERROR (sio->obj, RESOURCE, OPEN_READ_WRITE,
("Could not start sndio"), (NULL));
return FALSE;
}
return TRUE;
}
gboolean
gst_sndio_unprepare (struct gstsndio *sio)
{
if (sio->hdl)
sio_stop (sio->hdl);
return TRUE;
}
void
gst_sndio_set_property (struct gstsndio *sio, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
switch (prop_id) {
case PROP_DEVICE:
g_free (sio->device);
sio->device = g_value_dup_string (value);
break;
case PROP_VOLUME:
sio_setvol (sio->hdl, g_value_get_double (value) * SIO_MAXVOL);
break;
case PROP_MUTE:
if (g_value_get_boolean (value))
sio_setvol (sio->hdl, 0);
break;
default:
break;
}
}
void
gst_sndio_get_property (struct gstsndio *sio, guint prop_id,
GValue * value, GParamSpec * pspec)
{
switch (prop_id) {
case PROP_DEVICE:
g_value_set_string (value, sio->device);
break;
case PROP_VOLUME:
g_value_set_double (value, (gdouble)sio->volume / SIO_MAXVOL);
break;
case PROP_MUTE:
g_value_set_boolean (value, (sio->volume == 0));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (sio->obj, prop_id, pspec);
}
}

View File

@@ -0,0 +1,78 @@
/*
* Copyright (C) 2012 Alexandre Ratchov <alex@caoua.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_SNDIO_H__
#define __GST_SNDIO_H__
#include <sndio.h>
#include <gst/gst.h>
#include <gst/audio/gstaudiosink.h>
#include <gst/audio/gstaudiosrc.h>
#include <gst/audio/streamvolume.h>
enum
{
PROP_0,
PROP_DEVICE,
PROP_VOLUME,
PROP_MUTE
};
#define GST_SNDIO_CAPS_STRING \
"audio/x-raw, " \
"format = (string) { " \
"S8, U8, " \
"S16LE, S16BE, U16LE, U16BE, " \
"S32LE, S32BE, U32LE, U32BE, " \
"S24_32LE, S24_32BE, U24_32LE, " \
"U24_32BE, S24LE, S24BE, U24LE, U24BE " \
"}, " \
"layout = (string) interleaved, " \
"rate = (int) [ 8000, 192000 ], " \
"channels = (int) [1, 16]"
/*
* data common to src and sink
*/
struct gstsndio {
struct sio_hdl *hdl;
gchar *device;
gint mode;
gint bpf; /* bytes per frame */
gint delay; /* bytes stored in the audio fifo */
guint volume; /* volume level */
GstCaps *cur_caps; /* saved capabilities of opened device */
GObject *obj; /* for logging */
};
#define GST_SNDIO_DELAY(s) ((s)->delay / (s)->bpf)
void gst_sndio_init (struct gstsndio *sio, GObject *obj);
void gst_sndio_finalize (struct gstsndio *sio);
GstCaps *gst_sndio_getcaps (struct gstsndio *sio, GstCaps * filter);
gboolean gst_sndio_open (struct gstsndio *sio, gint mode);
gboolean gst_sndio_close (struct gstsndio *sio);
gboolean gst_sndio_prepare (struct gstsndio *sio, GstAudioRingBufferSpec *spec);
gboolean gst_sndio_unprepare (struct gstsndio *sio);
void gst_sndio_set_property (struct gstsndio *sio, guint prop_id,
const GValue * value, GParamSpec * pspec);
void gst_sndio_get_property (struct gstsndio *sio, guint prop_id,
GValue * value, GParamSpec * pspec);
int gst_sndio_setpar(gpointer sio, GstAudioRingBufferSpec * spec,
int mode, struct sio_hdl *hdl);
GstCaps *gst_sndio_caps (gpointer sio, int mode, struct sio_hdl *hdl);
#endif

View File

@@ -0,0 +1,303 @@
--- build.gradle.orig 2020-07-17 12:21:33 UTC
+++ build.gradle
@@ -295,6 +295,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")
ext.MAVEN_GROUP_ID = "org.openjfx"
@@ -302,7 +303,7 @@ ext.MAVEN_GROUP_ID = "org.openjfx"
// 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) fail("Unsupported build OS ${OS_NAME}")
+if (!IS_MAC && !IS_WINDOWS && !IS_LINUX && !IS_BSD) fail("Unsupported build OS ${OS_NAME}")
if (IS_WINDOWS && OS_ARCH != "x86" && OS_ARCH != "amd64") {
fail("Unknown and unsupported build architecture: $OS_ARCH")
} else if (IS_MAC && OS_ARCH != "x86_64") {
@@ -385,7 +386,7 @@ defineProperty("BUILD_WORKING_LIBAV", "false")
ext.IS_BUILD_WORKING_LIBAV = IS_LINUX ? Boolean.parseBoolean(BUILD_WORKING_LIBAV) : false
// 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.
@@ -413,7 +414,8 @@ ext.SWT_FILE_NAME = IS_MAC ? "org.eclipse.swt.cocoa.ma
IS_WINDOWS && IS_64 ? "org.eclipse.swt.win32.win32.x86_64_3.105.3.v20170228-0512" :
IS_WINDOWS && !IS_64 ? "org.eclipse.swt.win32.win32.x86_3.105.3.v20170228-0512" :
IS_LINUX && IS_64 ? "org.eclipse.swt.gtk.linux.x86_64_3.105.3.v20170228-0512" :
- IS_LINUX && !IS_64 ? "org.eclipse.swt.gtk.linux.x86_3.105.3.v20170228-0512" : ""
+ IS_LINUX && !IS_64 ? "org.eclipse.swt.gtk.linux.x86_3.105.3.v20170228-0512" :
+ IS_BSD ? "/usr/local/share/java/classes/swt.jar" : ""
// Specifies whether to run full tests (true) or smoke tests (false)
defineProperty("FULL_TEST", "false")
@@ -495,6 +497,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.
@@ -558,7 +566,7 @@ defineProperty("MAVEN_VERSION", IS_MILESTONE_FCS ? "${
// 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
@@ -704,7 +712,7 @@ void fetchExternalTools(String configName, List packag
def File pkgdir = file("$destdir/$basename")
if (pkgname.endsWith(".tgz") || pkgname.endsWith("tar.gz")) {
- if (IS_LINUX || IS_MAC) {
+ if (IS_LINUX || IS_MAC || IS_BSD) {
// use native tar to support symlinks
pkgdir.mkdirs()
exec {
@@ -1180,7 +1188,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
if (!targetProperties.containsKey('modLibDest')) targetProperties.modLibDest = targetProperties.libDest
@@ -2067,6 +2075,11 @@ project(":graphics") {
}
dependencies {
+ if (IS_BSD) {
+ compile files(SWT_FILE_NAME)
+ } else {
+ compile name: SWT_FILE_NAME
+ }
stubCompile group: "junit", name: "junit", version: "4.8.2"
antlr group: "org.antlr", name: "antlr4", version: "4.7.2", classifier: "complete"
@@ -2602,31 +2615,10 @@ project(":swt") {
commonModuleSetup(project, [ 'base', 'graphics' ])
dependencies {
- compile name: SWT_FILE_NAME
- }
-
- classes {
- doLast {
- // Copy all of the download libraries to libs directory for the sake of the IDEs
- File libsDir = rootProject.file("build/libs");
- File swtLib = new File(libsDir, "swt-debug.jar")
- libsDir.mkdirs();
-
- // Skip copy if file is present.
- if (swtLib.exists()) return;
-
- for (File f : configurations.compile.files) {
- // Have to rename the swt jar because it is some platform specific name but
- // for the sake of the IDEs we need to have a single stable name that works
- // on every platform
- copy {
- into libsDir
- from f.getParentFile()
- include "**/*swt*.jar"
- includeEmptyDirs = false
- rename ".*swt.*jar", "swt-debug\\.jar"
- }
- }
+ if (IS_BSD) {
+ compile files(SWT_FILE_NAME)
+ } else {
+ compile name: SWT_FILE_NAME
}
}
@@ -2809,7 +2801,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}",
@@ -2838,7 +2830,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",
IS_64 ? "ARCH=x64" : "ARCH=x32", "CC=${mediaProperties.compiler}",
"AR=${mediaProperties.ar}", "LINKER=${mediaProperties.linker}")
@@ -2856,7 +2848,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",
IS_64 ? "ARCH=x64" : "ARCH=x32",
"CC=${mediaProperties.compiler}", "AR=${mediaProperties.ar}", "LINKER=${mediaProperties.linker}")
@@ -2879,7 +2871,7 @@ project(":media") {
buildNative.dependsOn buildPlugins
- if (t.name == "linux") {
+ if (t.name == "linux" || t.name == "bsd") {
// Pre-defined command line arguments
def cfgCMDArgs = ["sh", "configure"]
def commonCfgArgs = ["--enable-shared", "--disable-debug", "--disable-static", "--disable-yasm", "--disable-doc", "--disable-programs", "--disable-everything"]
@@ -2984,7 +2976,7 @@ project(":media") {
}
exec {
workingDir("$libavDir")
- commandLine("make")
+ commandLine(MAKE_CMD)
}
}
}
@@ -3052,7 +3044,7 @@ project(":media") {
}
exec {
workingDir("$libavDir")
- commandLine("make")
+ commandLine(MAKE_CMD)
}
}
}
@@ -3138,7 +3130,7 @@ project(":media") {
}
exec {
workingDir("$libavDir")
- commandLine("make")
+ commandLine(MAKE_CMD)
}
}
}
@@ -3172,7 +3164,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/linux/avplugin")
args("CC=${mediaProperties.compiler}", "LINKER=${mediaProperties.linker}",
"OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}",
"BASE_NAME=avplugin", "VERSION=${version}", "LIBAV_DIR=${libavDir}",
@@ -3186,7 +3178,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}",
@@ -3200,7 +3192,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/linux/avplugin")
args("CC=${mediaProperties.compiler}", "LINKER=${mediaProperties.linker}",
"OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}",
"BASE_NAME=avplugin", "VERSION=${version}", "LIBAV_DIR=${libavDir}",
@@ -3211,7 +3203,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}", "LINKER=${mediaProperties.linker}",
"OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}",
"BASE_NAME=avplugin", IS_64 ? "ARCH=x64" : "ARCH=x32")
@@ -3262,7 +3254,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}",
"CC=${mediaProperties.compiler}", "AR=${mediaProperties.ar}", "LINKER=${mediaProperties.linker}")
@@ -3282,7 +3274,7 @@ project(":media") {
}
exec {
- commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/glib-lite")
+ commandLine (MAKE_CMD, "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/glib-lite")
args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=glib-lite")
args ("CC=${mediaProperties.compiler}", "LINKER=${mediaProperties.linker}")
}
@@ -3407,7 +3399,7 @@ project(":web") {
compileTargets { t ->
def targetProperties = project.rootProject.ext[t.upper]
def webkitProperties = targetProperties.webkit
- def classifier = (t.name != "linux" && t.name != "win") ? t.name :
+ def classifier = (t.name != "linux" && t.name != "bsd" && t.name != "win") ? t.name :
IS_64 ? "${t.name}-amd64" : "${t.name}-i586"
def webkitOutputDir = cygpath("$buildDir/${t.name}")
@@ -3436,13 +3428,16 @@ project(":web") {
environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
} else if (t.name == "mac") {
cmakeArgs = " $cmakeArgs -DCMAKE_OSX_DEPLOYMENT_TARGET=$MACOSX_MIN_VERSION -DCMAKE_OSX_SYSROOT=$MACOSX_SDK_PATH"
- } else if (t.name == "linux") {
- cmakeArgs = " $cmakeArgs -DCMAKE_SYSTEM_NAME=Linux"
- if (IS_64) {
- cmakeArgs = "$cmakeArgs -DCMAKE_SYSTEM_PROCESSOR=x86_64"
+ } else if (t.name == "linux" || t.name == "bsd") {
+ if (t.name == "linux") {
+ cmakeArgs = " $cmakeArgs -DCMAKE_SYSTEM_NAME=Linux"
} else {
- cmakeArgs = "$cmakeArgs -DCMAKE_SYSTEM_PROCESSOR=i586"
+ cmakeArgs = " $cmakeArgs -DCMAKE_SYSTEM_NAME=FreeBSD"
}
+ if ( OS_ARCH != "amd64" && OS_ARCH != "i386" ) {
+ cmakeArgs = "$cmakeArgs -DENABLE_JIT=OFF"
+ }
+ cmakeArgs = " $cmakeArgs -DCMAKE_SYSTEM_PROCESSOR=$OS_ARCH"
// TODO: Use cflags and ldflags from all platforms
def cFlags = webkitProperties.ccFlags?.join(' ') ?: ''
def lFlags = webkitProperties.linkFlags?.join(' ') ?: ''
@@ -3479,6 +3474,10 @@ project(":web") {
targetCpuBitDepthSwitch = "--32-bit"
}
cmakeArgs += " -DJAVAFX_RELEASE_VERSION=${jfxReleaseMajorVersion}"
+ cmakeArgs += " -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
+ cmakeArgs += " -DCMAKE_C_COMPILER:STRING=${System.getenv("CC")}"
+ cmakeArgs += " -DCMAKE_CXX_COMPILER:STRING=${System.getenv("CXX")}"
+
commandLine("perl", "$projectDir/src/main/native/Tools/Scripts/build-webkit",
"--java", "--icu-unicode", targetCpuBitDepthSwitch,
"--no-experimental-features", "--cmakeargs=${cmakeArgs}")
@@ -4928,7 +4927,7 @@ compileTargets { t ->
// OSX media natives
[ "jfxmedia_qtkit", "jfxmedia_avf", "glib-lite" ].each { name ->
from ("${mediaProject.buildDir}/native/${t.name}/${mediaBuildType}/${library(name)}") }
- } else if (t.name == "linux") {
+ } else if (t.name == "linux" || t.name == "bsd") {
from("${mediaProject.buildDir}/native/${t.name}/${mediaBuildType}") { include "libavplugin*.so" }
} else from ("${mediaProject.buildDir}/native/${t.name}/${mediaBuildType}/${library("glib-lite")}")
} else {
@@ -4941,7 +4940,7 @@ compileTargets { t ->
// copy libjfxmedia_{avf,qtkit}.dylib if they exist
[ "jfxmedia_qtkit", "jfxmedia_avf", "glib-lite" ].each { name ->
from ("$MEDIA_STUB/${library(name)}") }
- } else if (t.name == "linux") {
+ } else if (t.name == "linux" || t.name == "bsd") {
from(MEDIA_STUB) { include "libavplugin*.so" }
}
else if (t.name != "android" && t.name != "dalvik" ) {

View File

@@ -0,0 +1,332 @@
--- buildSrc/bsd.gradle.orig 2020-07-21 10:33:26 UTC
+++ buildSrc/bsd.gradle
@@ -0,0 +1,329 @@
+/*
+ * Copyright (c) 2013, 2019, 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;
+
+// Libraries end up in the lib/$OS_ARCH directory for Linux
+BSD.libDest = "lib"
+
+// Lambda for naming the generated libs
+BSD.library = { name -> return (IS_STATIC_BUILD ? "lib${name}.a" : "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
+ "-fstack-protector",
+ "-Wextra", "-Wall", "-Wformat-security", "-Wno-unused", "-Wno-parentheses"] // warning flags
+
+if (!IS_64) {
+ commonFlags += "-m32"
+}
+
+if (IS_STATIC_BUILD) {
+ commonFlags += "-DSTATIC_BUILD"
+}
+
+// Specify the compilation parameters and link parameters
+def ccFlags = [
+ commonFlags, "-I$JDK_HOME/include", "-I$JDK_HOME/include/freebsd", "-c",
+ "-ffunction-sections", "-fdata-sections",
+ IS_DEBUG_NATIVE ? ["-ggdb", "-DVERBOSE"] : ["-O2", "-DNDEBUG"]].flatten()
+def ccFlagsGTK3 = ccFlags
+//ccFlags.addAll(["-Wnon-virtual-dtor", "-Woverloaded-virtual", "-std=c++0x"])
+def dynamicLinkFlags = [ "-shared", commonFlags,
+ "-z", "relro",
+ "-Wl,--gc-sections"].flatten()
+
+def staticLinkFlags = [].flatten()
+
+def linkFlags = IS_STATIC_BUILD ? staticLinkFlags : dynamicLinkFlags;
+
+if (IS_DEBUG_NATIVE) {
+ linkFlags += "-g"
+}
+
+def toolchainDir
+if (hasProperty('toolchainDir')) {
+ toolchainDir = ext.toolchainDir + "/"
+} else {
+ toolchainDir = ""
+}
+
+def gtk2CCFlags = [ ];
+def gtk3CCFlags = [ "-Wno-deprecated-declarations" ];
+def gtk2LinkFlags = [ ];
+def gtk3LinkFlags = [ ];
+
+// Create $buildDir/freebsd_tools.properties file and load props from it
+setupTools("bsd_gtk2",
+ { propFile ->
+ ByteArrayOutputStream results1 = new ByteArrayOutputStream();
+ exec {
+ commandLine("${toolchainDir}pkg-config", "--cflags", "gtk+-2.0", "gthread-2.0", "xtst")
+ setStandardOutput(results1);
+ }
+ propFile << "cflagsGTK2=" << results1.toString().trim() << "\n";
+
+ ByteArrayOutputStream results3 = new ByteArrayOutputStream();
+ exec {
+ commandLine("${toolchainDir}pkg-config", "--libs", "gtk+-2.0", "gthread-2.0", "xtst")
+ setStandardOutput(results3);
+ }
+ propFile << "libsGTK2=" << results3.toString().trim() << "\n";
+ },
+ { properties ->
+ def cflagsGTK2 = properties.getProperty("cflagsGTK2")
+ def libsGTK2 = properties.getProperty("libsGTK2")
+ if (cflagsGTK2 && libsGTK2) {
+ gtk2CCFlags.addAll(cflagsGTK2.split(" "))
+ gtk2LinkFlags.addAll(libsGTK2.split(" "))
+ } else {
+ throw new IllegalStateException("GTK2 development packages not found. If GTK2 packages are installed, please remove the build directory and try again.")
+ }
+ }
+)
+
+setupTools("bsd_gtk3",
+ { propFile ->
+ ByteArrayOutputStream results2 = new ByteArrayOutputStream();
+ exec {
+ commandLine("${toolchainDir}pkg-config", "--cflags", "gtk+-3.0", "gthread-2.0", "xtst")
+ setStandardOutput(results2);
+ }
+ propFile << "cflagsGTK3=" << results2.toString().trim() << "\n";
+
+ ByteArrayOutputStream results4 = new ByteArrayOutputStream();
+ exec {
+ commandLine("${toolchainDir}pkg-config", "--libs", "gtk+-3.0", "gthread-2.0", "xtst")
+ setStandardOutput(results4);
+ }
+ propFile << "libsGTK3=" << results4.toString().trim() << "\n";
+
+ },
+ { properties ->
+ def cflagsGTK3 = properties.getProperty("cflagsGTK3")
+ def libsGTK3 = properties.getProperty("libsGTK3")
+ if (cflagsGTK3 && libsGTK3) {
+ gtk3CCFlags.addAll(cflagsGTK3.split(" "))
+ gtk3LinkFlags.addAll(libsGTK3.split(" "))
+ } else {
+ throw new IllegalStateException("GTK3 development packages not found. If GTK3 packages are installed, please remove the build directory and try again.")
+ }
+ }
+)
+
+def pangoCCFlags = ["-D_ENABLE_PANGO"];
+def pangoLinkFlags = [];
+setupTools("bsd_pango_tools",
+ { propFile ->
+ ByteArrayOutputStream results = new ByteArrayOutputStream();
+ exec {
+ commandLine "${toolchainDir}pkg-config", "--cflags", "pangoft2"
+ standardOutput = results
+ }
+ propFile << "cflags=" << results.toString().trim() << "\n";
+
+ results = new ByteArrayOutputStream();
+ exec {
+ commandLine "${toolchainDir}pkg-config", "--libs", "pangoft2"
+ standardOutput = results
+ }
+ propFile << "libs=" << results.toString().trim();
+ },
+ { properties ->
+ def cflags = properties.getProperty("cflags")
+ def libs = properties.getProperty("libs")
+ if (cflags && libs) {
+ pangoCCFlags.addAll(cflags.split(" "))
+ pangoLinkFlags.addAll(libs.split(" "))
+ } else {
+ throw new IllegalStateException("Linux pango packages not found.\nIf pango packages are installed, please remove the build directory and try again.")
+ }
+ }
+)
+
+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 "${toolchainDir}pkg-config", "--cflags", "freetype2"
+ standardOutput = results
+ }
+ propFile << "cflags=" << results.toString().trim() << "\n";
+
+ results = new ByteArrayOutputStream();
+ exec {
+ commandLine "${toolchainDir}pkg-config", "--libs", "freetype2"
+ standardOutput = results
+ }
+ propFile << "libs=" << results.toString().trim();
+ },
+ { properties ->
+ def cflags = properties.getProperty("cflags")
+ def libs = properties.getProperty("libs")
+ if (cflags && libs) {
+ freetypeCCFlags.addAll(cflags.split(" "))
+ if (!IS_STATIC_BUILD) {
+ freetypeLinkFlags.addAll(libs.split(" "))
+ }
+ } else {
+ throw new IllegalStateException("Linux freetype packages not found.\nIf freetype pacakges are installed, please remove the build directory and try again.")
+ }
+ }
+)
+
+def compiler = IS_COMPILE_PARFAIT ? "parfait-gcc" : "${toolchainDir}gcc";
+def linker = IS_STATIC_BUILD ? "ar" : IS_COMPILE_PARFAIT ? "parfait-g++" : "${toolchainDir}g++";
+
+BSD.glass = [:]
+BSD.glass.variants = ["glass", "glassgtk2", "glassgtk3"]
+
+FileTree ft_gtk_launcher = fileTree("${project(":graphics").projectDir}/src/main/native-glass/gtk/") {
+ include("**/launcher.c")
+}
+
+FileTree ft_gtk = fileTree("${project(":graphics").projectDir}/src/main/native-glass/gtk/") {
+ exclude("**/launcher.c")
+}
+
+BSD.glass.glass = [:]
+BSD.glass.glass.nativeSource = ft_gtk_launcher.getFiles()
+BSD.glass.glass.compiler = compiler
+BSD.glass.glass.ccFlags = [ccFlags].flatten()
+BSD.glass.glass.linker = linker
+BSD.glass.glass.linkFlags = IS_STATIC_BUILD? linkFlags : [linkFlags, "-lX11", "-ldl"].flatten()
+BSD.glass.glass.lib = "glass"
+
+BSD.glass.glassgtk2 = [:]
+BSD.glass.glassgtk2.nativeSource = ft_gtk.getFiles()
+BSD.glass.glassgtk2.compiler = compiler
+BSD.glass.glassgtk2.ccFlags = IS_STATIC_BUILD ?
+ ["-fno-threadsafe-statics", ccFlags, gtk2CCFlags].flatten() :
+ [ccFlags, gtk2CCFlags].flatten()
+BSD.glass.glassgtk2.linker = linker
+BSD.glass.glassgtk2.linkFlags = IS_STATIC_BUILD ? linkFlags : [linkFlags, gtk2LinkFlags].flatten()
+BSD.glass.glassgtk2.lib = "glassgtk2"
+
+BSD.glass.glassgtk3 = [:]
+BSD.glass.glassgtk3.nativeSource = ft_gtk.getFiles()
+BSD.glass.glassgtk3.compiler = compiler
+BSD.glass.glassgtk3.ccFlags = IS_STATIC_BUILD ?
+ ["-fno-threadsafe-statics", ccFlags, gtk3CCFlags].flatten() :
+ [ccFlags, gtk3CCFlags].flatten()
+BSD.glass.glassgtk3.linker = linker
+BSD.glass.glassgtk3.linkFlags = IS_STATIC_BUILD ? linkFlags : [linkFlags, gtk3LinkFlags].flatten()
+BSD.glass.glassgtk3.lib = "glassgtk3"
+
+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.nativeSource = file("${project(":graphics").projectDir}/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.nativeSource = file("${project(":graphics").projectDir}/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.iio = [:]
+BSD.iio.nativeSource = [
+ file("${project("graphics").projectDir}/src/main/native-iio"),
+ file("${project("graphics").projectDir}/src/main/native-iio/libjpeg")]
+BSD.iio.compiler = compiler
+BSD.iio.ccFlags = [ccFlags].flatten()
+BSD.iio.linker = linker
+BSD.iio.linkFlags = [linkFlags].flatten()
+BSD.iio.lib = "javafx_iio"
+
+BSD.prismES2 = [:]
+BSD.prismES2.nativeSource = [
+ file("${project("graphics").projectDir}/src/main/native-prism-es2"),
+ file("${project("graphics").projectDir}/src/main/native-prism-es2/GL"),
+ file("${project("graphics").projectDir}/src/main/native-prism-es2/x11")
+]
+BSD.prismES2.compiler = compiler
+BSD.prismES2.ccFlags = ["-DFREEBSD", ccFlags].flatten()
+BSD.prismES2.linker = linker
+BSD.prismES2.linkFlags =IS_STATIC_BUILD ? linkFlags : [linkFlags, "-lX11", "-lXxf86vm", "-lGL"].flatten()
+BSD.prismES2.lib = "prism_es2"
+
+def closedDir = file("$projectDir/../rt-closed")
+BSD.font = [:]
+BSD.font.compiler = compiler
+BSD.font.nativeSource = [file("${project("graphics").projectDir}/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.fontFreetype = [:]
+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 = IS_STATIC_BUILD ? linkFlags : [linkFlags, freetypeLinkFlags].flatten()
+BSD.fontFreetype.lib = "javafx_font_freetype"
+
+BSD.fontPango = [:]
+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 =IS_STATIC_BUILD ? linkFlags : [linkFlags, pangoLinkFlags].flatten()
+BSD.fontPango.lib = "javafx_font_pango"
+
+BSD.media = [:]
+BSD.media.compiler = compiler
+BSD.media.linker = linker
+BSD.media.ar = "${toolchainDir}ar"
+
+BSD.webkit = [:]
+BSD.webkit.compiler = compiler
+BSD.webkit.linker = linker
+BSD.webkit.ccFlags = commonFlags.flatten()
+BSD.webkit.linkFlags = linkFlags.flatten()

View File

@@ -0,0 +1,37 @@
--- modules/javafx.base/src/main/java/com/sun/javafx/PlatformUtil.java.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.base/src/main/java/com/sun/javafx/PlatformUtil.java
@@ -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 {
}
/**
- * Returns true if the operating system is a form of Linux or Solaris
+ * Returns true if the operating system is a form of Unix
*/
public static boolean isUnix(){
- return LINUX || SOLARIS;
+ return LINUX || SOLARIS || FREEBSD;
}
/**

View File

@@ -0,0 +1,36 @@
--- modules/javafx.controls/src/main/java/com/sun/javafx/scene/control/behavior/TextInputControlBehavior.java.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.controls/src/main/java/com/sun/javafx/scene/control/behavior/TextInputControlBehavior.java
@@ -54,6 +54,7 @@ import javafx.scene.input.MouseEvent;
import java.text.Bidi;
import java.util.function.Predicate;
+import static com.sun.javafx.PlatformUtil.isFreeBSD;
import static com.sun.javafx.PlatformUtil.isLinux;
import static com.sun.javafx.PlatformUtil.isMac;
import static com.sun.javafx.PlatformUtil.isWindows;
@@ -122,6 +123,7 @@ public abstract class TextInputControlBehavior<T exten
final Predicate<KeyEvent> validWhenEditable = e -> !c.isEditable();
final Predicate<KeyEvent> validOnWindows = e -> !PlatformUtil.isWindows();
final Predicate<KeyEvent> validOnLinux = e -> !PlatformUtil.isLinux();
+ final Predicate<KeyEvent> validOnFreeBSD = e -> !PlatformUtil.isFreeBSD();
KeyMapping cancelEditMapping;
KeyMapping fireMapping;
@@ -550,7 +552,7 @@ public abstract class TextInputControlBehavior<T exten
public void selectNextWord() {
TextInputControl textInputControl = getNode();
- if (isMac() || isLinux()) {
+ if (isMac() || isLinux() || isFreeBSD()) {
textInputControl.selectEndOfNextWord();
} else {
textInputControl.selectNextWord();
@@ -599,7 +601,7 @@ public abstract class TextInputControlBehavior<T exten
protected void nextWord() {
TextInputControl textInputControl = getNode();
- if (isMac() || isLinux()) {
+ if (isMac() || isLinux() || isFreeBSD()) {
textInputControl.endOfNextWord();
} else {
textInputControl.nextWord();

View File

@@ -0,0 +1,20 @@
--- modules/javafx.graphics/src/main/java/com/sun/glass/ui/Platform.java.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.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;
} else if (osNameLowerCase.startsWith("ios")) {
type = IOS;

View File

@@ -0,0 +1,20 @@
--- modules/javafx.graphics/src/main/java/com/sun/glass/utils/NativeLibLoader.java.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.graphics/src/main/java/com/sun/glass/utils/NativeLibLoader.java
@@ -358,7 +358,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 = ".";
}
@@ -374,7 +374,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";
}

View File

@@ -0,0 +1,11 @@
--- modules/javafx.graphics/src/main/java/com/sun/javafx/font/LogicalFont.java.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.graphics/src/main/java/com/sun/javafx/font/LogicalFont.java
@@ -175,7 +175,7 @@ public class LogicalFont implements CompositeFontResou
styleName = STYLE_BOLD_ITALIC;
}
fullName = familyName + " " + styleName;
- if (PrismFontFactory.isLinux) {
+ if (PrismFontFactory.isLinux || PrismFontFactory.isFreeBSD) {
FontConfigManager.FcCompFont fcCompFont =
FontConfigManager.getFontConfigFont(family, bold, italic);
physicalFullName = fcCompFont.firstFont.fullName;

View File

@@ -0,0 +1,45 @@
--- modules/javafx.graphics/src/main/java/com/sun/javafx/font/PrismFontFactory.java.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.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;
@@ -88,6 +89,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();
@@ -164,7 +166,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;
}
@@ -851,7 +853,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,
@@ -1770,7 +1772,7 @@ public abstract class PrismFontFactory implements Font
familyToFontListMap,
Locale.ENGLISH);
- } else if (isLinux) {
+ } else if (isLinux || isFreeBSD) {
FontConfigManager.populateMaps(tmpFontToFileMap,
fontToFamilyNameMap,
familyToFontListMap,

View File

@@ -0,0 +1,11 @@
--- modules/javafx.graphics/src/main/java/com/sun/javafx/tk/Toolkit.java.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.graphics/src/main/java/com/sun/javafx/tk/Toolkit.java
@@ -186,6 +186,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()) {

View File

@@ -0,0 +1,35 @@
--- modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/GlassSystemMenu.java.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/GlassSystemMenu.java
@@ -313,13 +313,13 @@ class GlassSystemMenu implements TKSystemMenu {
} else if (accelerator instanceof KeyCodeCombination) {
KeyCodeCombination kcc = (KeyCodeCombination)accelerator;
KeyCode code = kcc.getCode();
- assert PlatformUtil.isMac() || PlatformUtil.isLinux();
+ assert PlatformUtil.isMac() || PlatformUtil.isLinux() || PlatformUtil.isFreeBSD();
int modifier = glassModifiers(kcc);
if (PlatformUtil.isMac()) {
int finalCode = code.isLetterKey() ? code.getChar().toUpperCase().charAt(0)
: code.getCode();
glassSubMenuItem.setShortcut(finalCode, modifier);
- } else if (PlatformUtil.isLinux()) {
+ } else if (PlatformUtil.isLinux() || PlatformUtil.isFreeBSD()) {
String lower = code.getChar().toLowerCase();
if ((modifier & KeyEvent.MODIFIER_CONTROL) != 0) {
glassSubMenuItem.setShortcut(lower.charAt(0), modifier);
@@ -348,14 +348,14 @@ class GlassSystemMenu implements TKSystemMenu {
ret += KeyEvent.MODIFIER_ALT;
}
if (kcc.getShortcut() == KeyCombination.ModifierValue.DOWN) {
- if (PlatformUtil.isLinux()) {
+ if (PlatformUtil.isLinux() || PlatformUtil.isFreeBSD()) {
ret += KeyEvent.MODIFIER_CONTROL;
} else if (PlatformUtil.isMac()) {
ret += KeyEvent.MODIFIER_COMMAND;
}
}
if (kcc.getMeta() == KeyCombination.ModifierValue.DOWN) {
- if (PlatformUtil.isLinux()) {
+ if (PlatformUtil.isLinux() || PlatformUtil.isFreeBSD()) {
ret += KeyEvent.MODIFIER_WINDOWS; // RT-19326 - Linux shortcut support
} else if (PlatformUtil.isMac()) {
ret += KeyEvent.MODIFIER_COMMAND;

View File

@@ -0,0 +1,11 @@
--- modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java
@@ -460,7 +460,7 @@ class WindowStage extends GlassStage {
} else if (PlatformUtil.isWindows()) { //Windows Sized Icons
SMALL_ICON_HEIGHT = 32;
SMALL_ICON_WIDTH = 32;
- } else if (PlatformUtil.isLinux()) { //Linux icons
+ } else if (PlatformUtil.isLinux() || PlatformUtil.isFreeBSD()) { //Linux icons
SMALL_ICON_HEIGHT = 128;
SMALL_ICON_WIDTH = 128;
}

View File

@@ -0,0 +1,29 @@
--- modules/javafx.graphics/src/main/java/com/sun/prism/impl/PrismSettings.java.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.graphics/src/main/java/com/sun/prism/impl/PrismSettings.java
@@ -221,6 +221,8 @@ public final class PrismSettings {
tryOrderArr = new String[] { "es2" };
} else if (PlatformUtil.isLinux()) {
tryOrderArr = new String[] { "es2", "sw" };
+ } else if (PlatformUtil.isFreeBSD()) {
+ tryOrderArr = new String[] { "es2", "sw" };
} else {
tryOrderArr = new String[] { "sw" };
}
@@ -234,7 +236,7 @@ public final class PrismSettings {
for (String s : split(rOrder.toLowerCase(), ",")) {
switch (s) {
case "pisces":
- rSpec = PlatformUtil.isEmbedded() || !PlatformUtil.isLinux()
+ rSpec = PlatformUtil.isEmbedded() || !PlatformUtil.isLinux() || !PlatformUtil.isFreeBSD()
? RasterizerType.NativePisces
: RasterizerType.JavaPisces;
break;
@@ -269,7 +271,7 @@ public final class PrismSettings {
boolean doNativePisces;
String npprop = systemProperties.getProperty("prism.nativepisces");
if (npprop == null) {
- doNativePisces = PlatformUtil.isEmbedded() || !PlatformUtil.isLinux();
+ doNativePisces = PlatformUtil.isEmbedded() || !PlatformUtil.isLinux() || !PlatformUtil.isFreeBSD();
} else {
doNativePisces = Boolean.parseBoolean(npprop);
}

View File

@@ -0,0 +1,11 @@
--- modules/javafx.graphics/src/main/native-font/fontpath_linux.c.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.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>

View File

@@ -0,0 +1,15 @@
--- modules/javafx.graphics/src/main/native-font/freetype.c.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.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>
@@ -650,4 +649,3 @@ JNIEXPORT jboolean JNICALL JNICALL OS_NATIVE(isHarfbuz
}
#endif /* ENABLE_PANGO || ENABLE_HARFBUZZ */
-#endif /* __linux__ || ANDROID_NDK */

View File

@@ -0,0 +1,15 @@
--- modules/javafx.graphics/src/main/native-font/pango.c.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.graphics/src/main/native-font/pango.c
@@ -23,7 +23,6 @@
* questions.
*/
-#if defined __linux__
#if defined _ENABLE_PANGO
#include <jni.h>
@@ -432,4 +431,3 @@ JNIEXPORT void JNICALL OS_NATIVE(pango_1font_1descript
}
#endif /* ENABLE_PANGO */
-#endif /* __linux__ */

View File

@@ -0,0 +1,10 @@
--- modules/javafx.graphics/src/main/native-glass/gtk/GlassApplication.cpp.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.graphics/src/main/native-glass/gtk/GlassApplication.cpp
@@ -111,6 +111,7 @@ JNIEXPORT jint JNICALL Java_com_sun_glass_ui_gtk_GtkAp
gdk_threads_enter();
gtk_init(NULL, NULL);
+ gdk_threads_leave();
return JNI_TRUE;
}

View File

@@ -0,0 +1,11 @@
--- modules/javafx.graphics/src/main/native-glass/gtk/glass_evloop.cpp.orig 2020-07-24 17:23:31 UTC
+++ modules/javafx.graphics/src/main/native-glass/gtk/glass_evloop.cpp
@@ -25,7 +25,7 @@
#include "glass_evloop.h"
#include <glib.h>
-#include <malloc.h>
+#include <stdlib.h>
static GSList * evloopHookList;

View File

@@ -0,0 +1,16 @@
--- modules/javafx.graphics/src/main/native-glass/gtk/glass_window.h.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.graphics/src/main/native-glass/gtk/glass_window.h
@@ -366,7 +366,7 @@ class WindowContextTop: public WindowContextBase {
jlong screen;
WindowFrameType frame_type;
WindowType window_type;
- struct WindowContext *owner;
+ WindowContext *owner;
WindowGeometry geometry;
struct _Resizable{// we can't use set/get gtk_window_resizable function
_Resizable(): request(REQUEST_NONE), value(true), prev(false),
@@ -472,4 +472,3 @@ class EventsCounterHelper { (public)
};
#endif /* GLASS_WINDOW_H */
-

View File

@@ -0,0 +1,10 @@
--- modules/javafx.graphics/src/main/native-glass/gtk/launcher.c.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.graphics/src/main/native-glass/gtk/launcher.c
@@ -25,7 +25,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <linux/fb.h>
#include <fcntl.h>
#ifndef __USE_GNU // required for dladdr() & Dl_info
#define __USE_GNU

View File

@@ -0,0 +1,10 @@
--- modules/javafx.graphics/src/main/native-glass/gtk/wrapped.c.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.graphics/src/main/native-glass/gtk/wrapped.c
@@ -24,7 +24,6 @@
*/
#include <stdio.h>
-#include <linux/fb.h>
#include <fcntl.h>
#ifndef __USE_GNU // required for dladdr() & Dl_info
#define __USE_GNU

View File

@@ -0,0 +1,11 @@
--- modules/javafx.graphics/src/main/native-prism-es2/PrismES2Defs.h.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.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

View File

@@ -0,0 +1,13 @@
--- modules/javafx.media/src/main/java/com/sun/media/jfxmediaimpl/HostUtils.java.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.media/src/main/java/com/sun/media/jfxmediaimpl/HostUtils.java
@@ -66,6 +66,10 @@ public class HostUtils {
return osName.startsWith("linux");
}
+ public static boolean isFreeBSD() {
+ return osName.startsWith("freebsd");
+ }
+
public static boolean isIOS() {
return osName.startsWith("ios");
}

View File

@@ -0,0 +1,11 @@
--- modules/javafx.media/src/main/java/com/sun/media/jfxmediaimpl/NativeMediaManager.java.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.media/src/main/java/com/sun/media/jfxmediaimpl/NativeMediaManager.java
@@ -110,7 +110,7 @@ public class NativeMediaManager {
NativeLibLoader.loadLibrary("glib-lite");
}
- if (!HostUtils.isLinux() && !HostUtils.isIOS()) {
+ if (!HostUtils.isFreeBSD() && !HostUtils.isLinux() && !HostUtils.isIOS()) {
NativeLibLoader.loadLibrary("gstreamer-lite");
} else {
dependencies.add("gstreamer-lite");

View File

@@ -0,0 +1,86 @@
--- modules/javafx.media/src/main/native/gstreamer/gstreamer-lite/gstreamer/gst/gst_private.h.orig 2020-07-17 12:21:33 UTC
+++ modules/javafx.media/src/main/native/gstreamer/gstreamer-lite/gstreamer/gst/gst_private.h
@@ -237,12 +237,12 @@ GstCapsFeatures * __gst_caps_get_features_unchecked (c
#ifndef GST_DISABLE_REGISTRY
/* Secret variable to initialise gst without registry cache */
-GST_API gboolean _gst_disable_registry_cache;
+extern GST_API gboolean _gst_disable_registry_cache;
#endif
/* Secret variable to let the plugin scanner use the same base path
* as the main application in order to determine dependencies */
-GST_API gchar *_gst_executable_path;
+extern GST_API gchar *_gst_executable_path;
/* provide inline gst_g_value_get_foo_unchecked(), used in gststructure.c */
#define DEFINE_INLINE_G_VALUE_GET_UNCHECKED(ret_type,name_type,v_field) \
@@ -266,37 +266,37 @@ DEFINE_INLINE_G_VALUE_GET_UNCHECKED(const gchar *,stri
#ifndef GST_REMOVE_GST_DEBUG
-GST_API GstDebugCategory *GST_CAT_GST_INIT;
-GST_API GstDebugCategory *GST_CAT_MEMORY;
-GST_API GstDebugCategory *GST_CAT_PARENTAGE;
-GST_API GstDebugCategory *GST_CAT_STATES;
-GST_API GstDebugCategory *GST_CAT_SCHEDULING;
-GST_API GstDebugCategory *GST_CAT_BUFFER;
-GST_API GstDebugCategory *GST_CAT_BUFFER_LIST;
-GST_API GstDebugCategory *GST_CAT_BUS;
-GST_API GstDebugCategory *GST_CAT_CAPS;
-GST_API GstDebugCategory *GST_CAT_CLOCK;
-GST_API GstDebugCategory *GST_CAT_ELEMENT_PADS;
-GST_API GstDebugCategory *GST_CAT_PADS;
-GST_API GstDebugCategory *GST_CAT_PERFORMANCE;
-GST_API GstDebugCategory *GST_CAT_PIPELINE;
-GST_API GstDebugCategory *GST_CAT_PLUGIN_LOADING;
-GST_API GstDebugCategory *GST_CAT_PLUGIN_INFO;
-GST_API GstDebugCategory *GST_CAT_PROPERTIES;
-GST_API GstDebugCategory *GST_CAT_NEGOTIATION;
-GST_API GstDebugCategory *GST_CAT_REFCOUNTING;
-GST_API GstDebugCategory *GST_CAT_ERROR_SYSTEM;
-GST_API GstDebugCategory *GST_CAT_EVENT;
-GST_API GstDebugCategory *GST_CAT_MESSAGE;
-GST_API GstDebugCategory *GST_CAT_PARAMS;
-GST_API GstDebugCategory *GST_CAT_CALL_TRACE;
-GST_API GstDebugCategory *GST_CAT_SIGNAL;
-GST_API GstDebugCategory *GST_CAT_PROBE;
-GST_API GstDebugCategory *GST_CAT_REGISTRY;
-GST_API GstDebugCategory *GST_CAT_QOS;
-GST_API GstDebugCategory *GST_CAT_META;
-GST_API GstDebugCategory *GST_CAT_LOCKING;
-GST_API GstDebugCategory *GST_CAT_CONTEXT;
+extern GST_API GstDebugCategory *GST_CAT_GST_INIT;
+extern GST_API GstDebugCategory *GST_CAT_MEMORY;
+extern GST_API GstDebugCategory *GST_CAT_PARENTAGE;
+extern GST_API GstDebugCategory *GST_CAT_STATES;
+extern GST_API GstDebugCategory *GST_CAT_SCHEDULING;
+extern GST_API GstDebugCategory *GST_CAT_BUFFER;
+extern GST_API GstDebugCategory *GST_CAT_BUFFER_LIST;
+extern GST_API GstDebugCategory *GST_CAT_BUS;
+extern GST_API GstDebugCategory *GST_CAT_CAPS;
+extern GST_API GstDebugCategory *GST_CAT_CLOCK;
+extern GST_API GstDebugCategory *GST_CAT_ELEMENT_PADS;
+extern GST_API GstDebugCategory *GST_CAT_PADS;
+extern GST_API GstDebugCategory *GST_CAT_PERFORMANCE;
+extern GST_API GstDebugCategory *GST_CAT_PIPELINE;
+extern GST_API GstDebugCategory *GST_CAT_PLUGIN_LOADING;
+extern GST_API GstDebugCategory *GST_CAT_PLUGIN_INFO;
+extern GST_API GstDebugCategory *GST_CAT_PROPERTIES;
+extern GST_API GstDebugCategory *GST_CAT_NEGOTIATION;
+extern GST_API GstDebugCategory *GST_CAT_REFCOUNTING;
+extern GST_API GstDebugCategory *GST_CAT_ERROR_SYSTEM;
+extern GST_API GstDebugCategory *GST_CAT_EVENT;
+extern GST_API GstDebugCategory *GST_CAT_MESSAGE;
+extern GST_API GstDebugCategory *GST_CAT_PARAMS;
+extern GST_API GstDebugCategory *GST_CAT_CALL_TRACE;
+extern GST_API GstDebugCategory *GST_CAT_SIGNAL;
+extern GST_API GstDebugCategory *GST_CAT_PROBE;
+extern GST_API GstDebugCategory *GST_CAT_REGISTRY;
+extern GST_API GstDebugCategory *GST_CAT_QOS;
+extern GST_API GstDebugCategory *GST_CAT_META;
+extern GST_API GstDebugCategory *GST_CAT_LOCKING;
+extern GST_API GstDebugCategory *GST_CAT_CONTEXT;
/* Categories that should be completely private to
* libgstreamer should be done like this: */

View File

@@ -0,0 +1,11 @@
--- modules/javafx.media/src/main/native/gstreamer/gstreamer-lite/projects/build/linux/common/config.h.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.media/src/main/native/gstreamer/gstreamer-lite/projects/build/linux/common/config.h
@@ -376,7 +376,7 @@
#define HAVE_SYS_POLL_H 1
/* Define to 1 if you have the <sys/prctl.h> header file. */
-#define HAVE_SYS_PRCTL_H 1
+#undef HAVE_SYS_PRCTL_H
/* Define to 1 if you have the <sys/resource.h> header file. */
#undef HAVE_SYS_RESOURCE_H

View File

@@ -0,0 +1,11 @@
--- modules/javafx.media/src/main/native/jfxmedia/platform/gstreamer/GstAudioSpectrum.cpp 2020-07-17 20:51:26 UTC
+++ modules/javafx.media/src/main/native/jfxmedia/platform/gstreamer/GstAudioSpectrum.cpp
@@ -95,7 +95,7 @@ void CGstAudioSpectrum::SetBands(int bands, CBandsHold
g_object_set(m_pSpectrum, "bands", bands, NULL);
CBandsHolder *old_holder = (CBandsHolder*)g_atomic_pointer_get(&m_pHolder);
- g_atomic_pointer_compare_and_exchange((gpointer*)&m_pHolder, old_holder, holder);
+ g_atomic_pointer_compare_and_exchange((CBandsHolder**)&m_pHolder, old_holder, holder);
CBandsHolder::ReleaseRef(old_holder);
}

View File

@@ -0,0 +1,11 @@
--- modules/javafx.media/src/main/native/jfxmedia/platform/gstreamer/GstPipelineFactory.cpp.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.media/src/main/native/jfxmedia/platform/gstreamer/GstPipelineFactory.cpp
@@ -338,6 +338,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

View File

@@ -0,0 +1,42 @@
--- modules/javafx.media/src/main/native/jfxmedia/projects/bsd/Makefile.orig 2020-07-19 18:30:00 UTC
+++ modules/javafx.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 \
@@ -26,6 +27,7 @@ CFLAGS = -DTARGET_OS_LINUX=1 \
-DHAVE_CONFIG_H \
-DJFXMEDIA_JNI_EXPORTS \
-DLINUX \
+ -DG_DISABLE_DEPRECATED \
-ffunction-sections -fdata-sections
CPPFLAGS = -fno-rtti -ffunction-sections -fdata-sections
@@ -42,7 +44,6 @@ ifdef HOST_COMPILE
-Wformat-security \
-fstack-protector \
-Werror=implicit-function-declaration \
- -Werror=trampolines \
-msse2 \
-DGSTREAMER_LITE
@@ -51,7 +52,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 \

View File

@@ -0,0 +1,20 @@
--- modules/javafx.swing/src/main/java/javafx/embed/swing/JFXPanel.java.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.swing/src/main/java/javafx/embed/swing/JFXPanel.java
@@ -1043,7 +1043,7 @@ public class JFXPanel extends JComponent {
public boolean grabFocus() {
// On X11 grab is limited to a single XDisplay connection,
// so we can't delegate it to another GUI toolkit.
- if (PlatformUtil.isLinux()) return true;
+ if (PlatformUtil.isLinux() || PlatformUtil.isFreeBSD()) return true;
invokeOnClientEDT(() -> {
Window window = SwingUtilities.getWindowAncestor(JFXPanel.this);
@@ -1059,7 +1059,7 @@ public class JFXPanel extends JComponent {
public void ungrabFocus() {
// On X11 grab is limited to a single XDisplay connection,
// so we can't delegate it to another GUI toolkit.
- if (PlatformUtil.isLinux()) return;
+ if (PlatformUtil.isLinux() || PlatformUtil.isFreeBSD()) return;
invokeOnClientEDT(() -> {
Window window = SwingUtilities.getWindowAncestor(JFXPanel.this);

View File

@@ -0,0 +1,11 @@
--- modules/javafx.swing/src/main/java/javafx/embed/swing/SwingNode.java.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.swing/src/main/java/javafx/embed/swing/SwingNode.java
@@ -807,7 +807,7 @@ public class SwingNode extends Node {
private void ungrabFocus(boolean postUngrabEvent) {
// On X11 grab is limited to a single XDisplay connection,
// so we can't delegate it to another GUI toolkit.
- if (PlatformUtil.isLinux()) return;
+ if (PlatformUtil.isLinux() || PlatformUtil.isFreeBSD()) return;
if (grabbed &&
getScene() != null &&

View File

@@ -0,0 +1,11 @@
--- modules/javafx.web/src/main/native/Source/JavaScriptCore/assembler/ARM64Assembler.h.orig 2020-09-02 20:39:53 UTC
+++ modules/javafx.web/src/main/native/Source/JavaScriptCore/assembler/ARM64Assembler.h
@@ -2825,6 +2825,8 @@ class ARM64Assembler { (public)
linuxPageFlush(current, current + page);
linuxPageFlush(current, end);
+#elif OS(FREEBSD)
+ __clear_cache(code, reinterpret_cast<char*>(code) + size);
#else
#error "The cacheFlush support is missing on this platform."
#endif

View File

@@ -0,0 +1,11 @@
--- modules/javafx.web/src/main/native/Source/JavaScriptCore/offlineasm/arm64.rb.orig 2020-09-02 20:42:24 UTC
+++ modules/javafx.web/src/main/native/Source/JavaScriptCore/offlineasm/arm64.rb
@@ -1041,7 +1041,7 @@ class Instruction
$asm.puts "ldr #{operands[1].arm64Operand(:quad)}, [#{operands[1].arm64Operand(:quad)}, #{operands[0].asmLabel}@GOTPAGEOFF]"
# On Linux, use ELF GOT relocation specifiers.
- $asm.putStr("#elif OS(LINUX)")
+ $asm.putStr("#elif OS(LINUX) || OS(FREEBSD)")
$asm.puts "adrp #{operands[1].arm64Operand(:quad)}, :got:#{operands[0].asmLabel}"
$asm.puts "ldr #{operands[1].arm64Operand(:quad)}, [#{operands[1].arm64Operand(:quad)}, :got_lo12:#{operands[0].asmLabel}]"

View File

@@ -0,0 +1,8 @@
--- modules/javafx.web/src/main/native/Source/PlatformJava.cmake.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.web/src/main/native/Source/PlatformJava.cmake
@@ -1,4 +1 @@
-add_subdirectory(ThirdParty/sqlite)
-add_subdirectory(ThirdParty/icu)
-add_subdirectory(ThirdParty/libxml)
-add_subdirectory(ThirdParty/libxslt)
+

View File

@@ -0,0 +1,11 @@
--- modules/javafx.web/src/main/native/Source/WTF/wtf/MemoryPressureHandler.cpp.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.web/src/main/native/Source/WTF/wtf/MemoryPressureHandler.cpp
@@ -49,7 +49,7 @@ MemoryPressureHandler& MemoryPressureHandler::singleto
}
MemoryPressureHandler::MemoryPressureHandler()
-#if OS(LINUX)
+#if OS(LINUX) || OS(FREEBSD)
: m_holdOffTimer(RunLoop::main(), this, &MemoryPressureHandler::holdOffTimerFired)
#elif OS(WINDOWS)
: m_windowsMeasurementTimer(RunLoop::main(), this, &MemoryPressureHandler::windowsMeasurementTimerFired)

View File

@@ -0,0 +1,20 @@
--- modules/javafx.web/src/main/native/Source/WTF/wtf/MemoryPressureHandler.h.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.web/src/main/native/Source/WTF/wtf/MemoryPressureHandler.h
@@ -66,7 +66,7 @@ class MemoryPressureHandler { (public)
WTF_EXPORT_PRIVATE void setShouldUsePeriodicMemoryMonitor(bool);
-#if OS(LINUX)
+#if OS(LINUX) || OS(FREEBSD)
WTF_EXPORT_PRIVATE void triggerMemoryPressureEvent(bool isCritical);
#endif
@@ -200,7 +200,7 @@ class MemoryPressureHandler { (public)
Win32Handle m_lowMemoryHandle;
#endif
-#if OS(LINUX)
+#if OS(LINUX) || OS(FREEBSD)
RunLoop::Timer<MemoryPressureHandler> m_holdOffTimer;
void holdOffTimerFired();
#endif

View File

@@ -0,0 +1,15 @@
--- modules/javafx.web/src/main/native/Source/WTF/wtf/Platform.h.orig 2020-07-17 12:21:33 UTC
+++ modules/javafx.web/src/main/native/Source/WTF/wtf/Platform.h
@@ -352,6 +352,12 @@
#endif
#endif
+#if !CPU(ARM_THUMB2) && !CPU(ARM_TRADITIONAL) && !CPU(X86) && !CPU(X86_64) && !CPU(SH4) && !CPU(ARM64)
+#define ENABLE_ASSEMBLER 0
+#define ENABLE_JIT 0
+#define ENABLE_YARR_JIT 0
+#endif
+
/* ==== OS() - underlying operating system; only to be used for mandated low-level services like
virtual memory, not to choose a GUI toolkit ==== */

View File

@@ -0,0 +1,14 @@
--- modules/javafx.web/src/main/native/Source/WTF/wtf/PlatformJava.cmake.orig 2020-07-24 19:01:56 UTC
+++ modules/javafx.web/src/main/native/Source/WTF/wtf/PlatformJava.cmake
@@ -83,9 +83,8 @@ elseif (UNIX)
list(APPEND WTF_SOURCES
generic/RunLoopGeneric.cpp
generic/WorkQueueGeneric.cpp
- linux/CurrentProcessMemoryStatus.cpp
- linux/MemoryFootprintLinux.cpp
- linux/MemoryPressureHandlerLinux.cpp
+ generic/MemoryFootprintGeneric.cpp
+ unix/MemoryPressureHandlerUnix.cpp
unix/CPUTimeUnix.cpp
unix/LanguageUnix.cpp
)

View File

@@ -0,0 +1,28 @@
--- modules/javafx.web/src/main/native/Source/WTF/wtf/RAMSize.cpp.orig 2020-07-17 12:21:33 UTC
+++ modules/javafx.web/src/main/native/Source/WTF/wtf/RAMSize.cpp
@@ -35,6 +35,10 @@
#if OS(LINUX)
#include <sys/sysinfo.h>
#endif // OS(LINUX)
+#if OS(FREEBSD)
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#endif
#else
#include <bmalloc/bmalloc.h>
#endif
@@ -59,6 +63,14 @@ static size_t computeRAMSize()
struct sysinfo si;
sysinfo(&si);
return si.totalram * si.mem_unit;
+#elif OS(FREEBSD)
+ size_t physmem, len;
+ int mib[2] = { CTL_HW, HW_PHYSMEM };
+ if (sysctl(mib, 2, &physmem, &len, NULL, 0) == 0
+ && len == sizeof(physmem))
+ return physmem;
+ else
+ return 512 * MB; // guess
#else
#error "Missing a platform specific way of determining the available RAM"
#endif // OS(LINUX)

View File

@@ -0,0 +1,22 @@
--- modules/javafx.web/src/main/native/Source/WTF/wtf/generic/MemoryFootprintGeneric.cpp.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.web/src/main/native/Source/WTF/wtf/generic/MemoryFootprintGeneric.cpp
@@ -25,8 +25,9 @@
#include "config.h"
#include <wtf/MemoryFootprint.h>
+#include <wtf/Platform.h>
-#if !(defined(USE_SYSTEM_MALLOC) && USE_SYSTEM_MALLOC) && OS(LINUX)
+#if !USE(SYSTEM_MALLOC) && (OS(LINUX) || OS(FREEBSD))
#include <bmalloc/bmalloc.h>
#endif
@@ -34,7 +35,7 @@ namespace WTF {
size_t memoryFootprint()
{
-#if !(defined(USE_SYSTEM_MALLOC) && USE_SYSTEM_MALLOC) && OS(LINUX)
+#if !USE(SYSTEM_MALLOC) && (OS(LINUX) || OS(FREEBSD))
return bmalloc::api::memoryFootprint();
#else
return 0;

View File

@@ -0,0 +1,54 @@
--- modules/javafx.web/src/main/native/Source/WTF/wtf/linux/MemoryPressureHandlerLinux.cpp.orig 2020-07-17 12:21:33 UTC
+++ modules/javafx.web/src/main/native/Source/WTF/wtf/linux/MemoryPressureHandlerLinux.cpp
@@ -28,13 +28,20 @@
#include "config.h"
#include <wtf/MemoryPressureHandler.h>
-#include <malloc.h>
+#include <stdlib.h>
#include <unistd.h>
#include <wtf/MainThread.h>
#include <wtf/MemoryFootprint.h>
-#include <wtf/linux/CurrentProcessMemoryStatus.h>
#include <wtf/text/WTFString.h>
+#if OS(LINUX)
+#include <wtf/linux/CurrentProcessMemoryStatus.h>
+#elif OS(FREEBSD)
+#include <sys/sysctl.h>
+#include <sys/types.h>
+#include <sys/user.h>
+#endif
+
#define LOG_CHANNEL_PREFIX Log
namespace WTF {
@@ -105,9 +112,28 @@ void MemoryPressureHandler::holdOff(Seconds seconds)
static size_t processMemoryUsage()
{
+#if OS(LINUX)
ProcessMemoryStatus memoryStatus;
currentProcessMemoryStatus(memoryStatus);
return (memoryStatus.resident - memoryStatus.shared);
+#elif OS(FREEBSD)
+ static size_t pageSize = sysconf(_SC_PAGE_SIZE);
+ struct kinfo_proc info;
+ size_t infolen = sizeof(info);
+
+ int mib[4];
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PROC;
+ mib[2] = KERN_PROC_PID;
+ mib[3] = getpid();
+
+ if (sysctl(mib, 4, &info, &infolen, nullptr, 0))
+ return 0;
+
+ return static_cast<size_t>(info.ki_rssize - info.ki_tsize) * pageSize;
+#else
+#error "Missing a platform specific way of determining the memory usage"
+#endif
}
void MemoryPressureHandler::respondToMemoryPressure(Critical critical, Synchronous synchronous)

View File

@@ -0,0 +1,24 @@
--- modules/javafx.web/src/main/native/Source/WTF/wtf/unicode/java/UnicodeJava.h.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.web/src/main/native/Source/WTF/wtf/unicode/java/UnicodeJava.h
@@ -37,21 +37,6 @@
#define CharProp(p) com_sun_webkit_dom_CharacterDataImpl_##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) \

View File

@@ -0,0 +1,168 @@
--- modules/javafx.web/src/main/native/Source/WTF/wtf/unix/MemoryPressureHandlerUnix.cpp.orig 2020-07-19 18:56:35 UTC
+++ modules/javafx.web/src/main/native/Source/WTF/wtf/unix/MemoryPressureHandlerUnix.cpp
@@ -0,0 +1,165 @@
+/*
+ * Copyright (C) 2011, 2012 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2014 Raspberry Pi Foundation. All Rights Reserved.
+ * Copyright (C) 2018 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include <wtf/MemoryPressureHandler.h>
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <wtf/MainThread.h>
+#include <wtf/MemoryFootprint.h>
+#include <wtf/text/WTFString.h>
+
+#if OS(LINUX)
+#include <wtf/linux/CurrentProcessMemoryStatus.h>
+#elif OS(FREEBSD)
+#include <sys/sysctl.h>
+#include <sys/types.h>
+#include <sys/user.h>
+#endif
+
+#define LOG_CHANNEL_PREFIX Log
+
+namespace WTF {
+
+// Disable memory event reception for a minimum of s_minimumHoldOffTime
+// seconds after receiving an event. Don't let events fire any sooner than
+// s_holdOffMultiplier times the last cleanup processing time. Effectively
+// this is 1 / s_holdOffMultiplier percent of the time.
+// If after releasing the memory we don't free at least s_minimumBytesFreedToUseMinimumHoldOffTime,
+// we wait longer to try again (s_maximumHoldOffTime).
+// These value seems reasonable and testing verifies that it throttles frequent
+// low memory events, greatly reducing CPU usage.
+static const Seconds s_minimumHoldOffTime { 5_s };
+static const Seconds s_maximumHoldOffTime { 30_s };
+static const size_t s_minimumBytesFreedToUseMinimumHoldOffTime = 1 * MB;
+static const unsigned s_holdOffMultiplier = 20;
+
+void MemoryPressureHandler::triggerMemoryPressureEvent(bool isCritical)
+{
+ if (!m_installed)
+ return;
+
+ if (ReliefLogger::loggingEnabled())
+ LOG(MemoryPressure, "Got memory pressure notification (%s)", isCritical ? "critical" : "non-critical");
+
+ setUnderMemoryPressure(true);
+
+ if (isMainThread())
+ respondToMemoryPressure(isCritical ? Critical::Yes : Critical::No);
+ else
+ RunLoop::main().dispatch([this, isCritical] {
+ respondToMemoryPressure(isCritical ? Critical::Yes : Critical::No);
+ });
+
+ if (ReliefLogger::loggingEnabled() && isUnderMemoryPressure())
+ LOG(MemoryPressure, "System is no longer under memory pressure.");
+
+ setUnderMemoryPressure(false);
+}
+
+void MemoryPressureHandler::install()
+{
+ if (m_installed || m_holdOffTimer.isActive())
+ return;
+
+ m_installed = true;
+}
+
+void MemoryPressureHandler::uninstall()
+{
+ if (!m_installed)
+ return;
+
+ m_holdOffTimer.stop();
+
+ m_installed = false;
+}
+
+void MemoryPressureHandler::holdOffTimerFired()
+{
+ install();
+}
+
+void MemoryPressureHandler::holdOff(Seconds seconds)
+{
+ m_holdOffTimer.startOneShot(seconds);
+}
+
+static size_t processMemoryUsage()
+{
+#if OS(LINUX)
+ ProcessMemoryStatus memoryStatus;
+ currentProcessMemoryStatus(memoryStatus);
+ return (memoryStatus.resident - memoryStatus.shared);
+#elif OS(FREEBSD)
+ static size_t pageSize = sysconf(_SC_PAGE_SIZE);
+ struct kinfo_proc info;
+ size_t infolen = sizeof(info);
+
+ int mib[4];
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PROC;
+ mib[2] = KERN_PROC_PID;
+ mib[3] = getpid();
+
+ if (sysctl(mib, 4, &info, &infolen, nullptr, 0))
+ return 0;
+
+ return static_cast<size_t>(info.ki_rssize - info.ki_tsize) * pageSize;
+#else
+#error "Missing a platform specific way of determining the memory usage"
+#endif
+}
+
+void MemoryPressureHandler::respondToMemoryPressure(Critical critical, Synchronous synchronous)
+{
+ uninstall();
+
+ MonotonicTime startTime = MonotonicTime::now();
+ int64_t processMemory = processMemoryUsage();
+ releaseMemory(critical, synchronous);
+ int64_t bytesFreed = processMemory - processMemoryUsage();
+ Seconds holdOffTime = s_maximumHoldOffTime;
+ if (bytesFreed > 0 && static_cast<size_t>(bytesFreed) >= s_minimumBytesFreedToUseMinimumHoldOffTime)
+ holdOffTime = (MonotonicTime::now() - startTime) * s_holdOffMultiplier;
+ holdOff(std::max(holdOffTime, s_minimumHoldOffTime));
+}
+
+void MemoryPressureHandler::platformReleaseMemory(Critical)
+{
+#if HAVE(MALLOC_TRIM)
+ malloc_trim(0);
+#endif
+}
+
+Optional<MemoryPressureHandler::ReliefLogger::MemoryUsage> MemoryPressureHandler::ReliefLogger::platformMemoryUsage()
+{
+ return MemoryUsage {processMemoryUsage(), memoryFootprint()};
+}
+
+} // namespace WTF

View File

@@ -0,0 +1,11 @@
--- modules/javafx.web/src/main/native/Source/WebCore/css/StyleResolver.cpp.orig 2020-08-19 18:48:58 UTC
+++ modules/javafx.web/src/main/native/Source/WebCore/css/StyleResolver.cpp
@@ -211,7 +211,7 @@ StyleResolver::StyleResolver(Document& document)
if (view)
m_mediaQueryEvaluator = MediaQueryEvaluator { view->mediaType() };
else
- m_mediaQueryEvaluator = MediaQueryEvaluator { "all" };
+ m_mediaQueryEvaluator = MediaQueryEvaluator { };
if (root) {
m_rootDefaultStyle = styleForElement(*root, m_document.renderStyle(), nullptr, RuleMatchingBehavior::MatchOnlyUserAgentRules).renderStyle;

View File

@@ -0,0 +1,45 @@
--- modules/javafx.web/src/main/native/Source/bmalloc/bmalloc/AvailableMemory.cpp.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.web/src/main/native/Source/bmalloc/bmalloc/AvailableMemory.cpp
@@ -47,6 +47,11 @@
#if BOS(LINUX)
#include <algorithm>
#include <fcntl.h>
+#elif BOS(FREEBSD)
+#include "VMAllocate.h"
+#include <sys/sysctl.h>
+#include <sys/types.h>
+#include <sys/user.h>
#endif
#include <unistd.h>
#endif
@@ -184,7 +189,7 @@ size_t availableMemory()
return availableMemory;
}
-#if BPLATFORM(IOS_FAMILY) || BOS(LINUX)
+#if BPLATFORM(IOS_FAMILY) || BOS(LINUX) || BOS(FREEBSD)
MemoryStatus memoryStatus()
{
#if BPLATFORM(IOS_FAMILY)
@@ -200,6 +205,21 @@ MemoryStatus memoryStatus()
auto& memory = LinuxMemory::singleton();
size_t memoryFootprint = memory.footprint();
double percentInUse = static_cast<double>(memoryFootprint) / static_cast<double>(memory.availableMemory);
+#elif BOS(FREEBSD)
+ struct kinfo_proc info;
+ size_t infolen = sizeof(info);
+
+ int mib[4];
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PROC;
+ mib[2] = KERN_PROC_PID;
+ mib[3] = getpid();
+
+ size_t memoryFootprint = 0;
+ if (!sysctl(mib, 4, &info, &infolen, nullptr, 0))
+ memoryFootprint = static_cast<size_t>(info.ki_rssize) * vmPageSize();
+
+ double percentInUse = static_cast<double>(memoryFootprint) / static_cast<double>(availableMemory());
#endif
double percentAvailableMemoryInUse = std::min(percentInUse, 1.0);

View File

@@ -0,0 +1,20 @@
--- modules/javafx.web/src/main/native/Source/bmalloc/bmalloc/AvailableMemory.h.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.web/src/main/native/Source/bmalloc/bmalloc/AvailableMemory.h
@@ -32,7 +32,7 @@ namespace bmalloc {
size_t availableMemory();
-#if BPLATFORM(IOS_FAMILY) || BOS(LINUX)
+#if BPLATFORM(IOS_FAMILY) || BOS(LINUX) || BOS(FREEBSD)
struct MemoryStatus {
MemoryStatus(size_t memoryFootprint, double percentAvailableMemoryInUse)
: memoryFootprint(memoryFootprint)
@@ -61,7 +61,7 @@ inline double percentAvailableMemoryInUse()
inline bool isUnderMemoryPressure()
{
-#if BPLATFORM(IOS_FAMILY) || BOS(LINUX)
+#if BPLATFORM(IOS_FAMILY) || BOS(LINUX) || BOS(FREEBSD)
return percentAvailableMemoryInUse() > memoryPressureThreshold;
#else
return false;

View File

@@ -0,0 +1,11 @@
--- modules/javafx.web/src/main/native/Source/bmalloc/bmalloc/bmalloc.h.orig 2020-07-24 18:56:22 UTC
+++ modules/javafx.web/src/main/native/Source/bmalloc/bmalloc/bmalloc.h
@@ -111,7 +111,7 @@ inline size_t availableMemory()
return bmalloc::availableMemory();
}
-#if BPLATFORM(IOS_FAMILY) || BOS(LINUX)
+#if BPLATFORM(IOS_FAMILY) || BOS(LINUX) || BOS(FREEBSD)
inline size_t memoryFootprint()
{
return bmalloc::memoryFootprint();

View File

@@ -0,0 +1,21 @@
--- modules/javafx.web/src/main/native/Source/cmake/OptionsJava.cmake.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.web/src/main/native/Source/cmake/OptionsJava.cmake
@@ -31,14 +31,10 @@ endif ()
set(LIB_INSTALL_DIR "${CMAKE_INSTALL_FULL_LIBDIR}" CACHE PATH "Absolute path to library installation directory")
set(EXEC_INSTALL_DIR "${CMAKE_INSTALL_FULL_BINDIR}" CACHE PATH "Absolute path to executable installation directory")
-set(SQLITE_LIBRARIES SqliteJava)
-set(LIBXML2_LIBRARIES XMLJava)
-set(LIBXSLT_LIBRARIES XSLTJava)
-
-set(ICU_LIBRARIES icuuc icudata)
-set(ICU_I18N_LIBRARIES icui18n icuuc icudata)
-set(ICU_DATA_LIBRARIES icudata)
-
+find_package(LibXml2 2.8.0 REQUIRED)
+find_package(LibXslt REQUIRED)
+find_package(Sqlite REQUIRED)
+find_package(ICU REQUIRED)
find_package(JNI REQUIRED)
find_package(Threads REQUIRED)

View File

@@ -0,0 +1,12 @@
--- modules/javafx.web/src/main/native/Source/cmake/WebKitCommon.cmake.orig 2020-09-17 13:23:59 UTC
+++ modules/javafx.web/src/main/native/Source/cmake/WebKitCommon.cmake
@@ -17,8 +17,7 @@ if (NOT HAS_RUN_WEBKIT_COMMON)
find_package(Perl 5.10.0 REQUIRED)
find_package(PerlModules COMPONENTS JSON::PP REQUIRED)
- set(Python_ADDITIONAL_VERSIONS 3)
- find_package(PythonInterp 2.7.0 REQUIRED)
+ find_package(PythonInterp REQUIRED)
# We cannot check for RUBY_FOUND because it is set only when the full package is installed and
# the only thing we need is the interpreter. Unlike Python, cmake does not provide a macro

View File

@@ -0,0 +1,13 @@
--- modules/javafx.web/src/main/native/Source/cmake/WebKitCompilerFlags.cmake.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.web/src/main/native/Source/cmake/WebKitCompilerFlags.cmake
@@ -231,10 +231,6 @@ if (NOT MSVC)
string(REGEX MATCHALL "-fsanitize=[^ ]*" ENABLED_COMPILER_SANITIZERS ${CMAKE_CXX_FLAGS})
endif ()
-if (UNIX AND NOT APPLE AND NOT ENABLED_COMPILER_SANITIZERS)
- set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined ${CMAKE_SHARED_LINKER_FLAGS}")
-endif ()
-
# CODE_GENERATOR_PREPROCESSOR_WITH_LINEMARKERS only matters with GCC >= 4.7.0. Since this
# version, -P does not output empty lines, which currently breaks make_names.pl in

View File

@@ -0,0 +1,18 @@
https://github.com/WebKit/webkit/commit/35a79bf4c2e0ecb4a37e672de347a25254ea0601
* DumpRenderTree/TestRunner.cpp:
(TestRunner::runUIScript):
Manually convert between UChar and UniChar/unichar where needed.
--- modules/javafx.web/src/main/native/Tools/DumpRenderTree/TestRunner.cpp.orig 2020-07-19 19:13:03 UTC
+++ modules/javafx.web/src/main/native/Tools/DumpRenderTree/TestRunner.cpp
@@ -2463,7 +2463,7 @@ void TestRunner::runUIScript(JSContextRef context, JSS
if (!m_UIScriptContext)
m_UIScriptContext = makeUniqueWithoutFastMallocCheck<WTR::UIScriptContext>(*this);
- String scriptString(JSStringGetCharactersPtr(script), JSStringGetLength(script));
+ String scriptString(reinterpret_cast<const UChar*>(JSStringGetCharactersPtr(script)), JSStringGetLength(script));
m_UIScriptContext->runUIScript(scriptString, callbackID);
}

View File

@@ -0,0 +1,12 @@
--- modules/javafx.web/src/main/native/Tools/DumpRenderTree/java/CMakeLists.txt.orig 2020-07-17 10:21:33 UTC
+++ modules/javafx.web/src/main/native/Tools/DumpRenderTree/java/CMakeLists.txt
@@ -72,9 +72,5 @@ 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")
-endif ()
-
set_target_properties(DumpRenderTreeJava PROPERTIES OUTPUT_NAME "DumpRenderTreeJava")
target_link_libraries(DumpRenderTreeJava ${DumpRenderTree_LIBRARIES})

View File

@@ -0,0 +1,226 @@
/*
* Copyright (C) 2008 Jacob Meuser <jakemsr@sdf.lonestar.org>
* Copyright (C) 2012 Alexandre Ratchov <alex@caoua.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"
GST_DEBUG_CATEGORY_EXTERN (gst_sndio_debug);
#define GST_CAT_DEFAULT gst_sndio_debug
#define gst_sndiosink_parent_class parent_class
static GstStaticPadTemplate sndiosink_factory =
GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_SNDIO_CAPS_STRING)
);
G_DEFINE_TYPE_WITH_CODE (GstSndioSink, gst_sndiosink, GST_TYPE_AUDIO_SINK,
G_IMPLEMENT_INTERFACE (GST_TYPE_STREAM_VOLUME, NULL));
static void gst_sndiosink_finalize (GObject * object);
static GstCaps *gst_sndiosink_getcaps (GstBaseSink * bsink,
GstCaps * filter);
static gboolean gst_sndiosink_open (GstAudioSink * asink);
static gboolean gst_sndiosink_close (GstAudioSink * asink);
static gboolean gst_sndiosink_prepare (GstAudioSink * asink,
GstAudioRingBufferSpec * spec);
static gboolean gst_sndiosink_unprepare (GstAudioSink * asink);
static gint 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_init (GstSndioSink * sink)
{
gst_sndio_init (&sink->sndio, G_OBJECT(sink));
}
static void
gst_sndiosink_finalize (GObject * object)
{
GstSndioSink *sink = GST_SNDIOSINK (object);
gst_sndio_finalize (&sink->sndio);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static GstCaps *
gst_sndiosink_getcaps (GstBaseSink * bsink, GstCaps * filter)
{
GstSndioSink *sink = GST_SNDIOSINK (bsink);
return gst_sndio_getcaps (&sink->sndio, filter);
}
static gboolean
gst_sndiosink_open (GstAudioSink * asink)
{
GstSndioSink *sink = GST_SNDIOSINK (asink);
return gst_sndio_open (&sink->sndio, SIO_PLAY);
}
static gboolean
gst_sndiosink_close (GstAudioSink * asink)
{
GstSndioSink *sink = GST_SNDIOSINK (asink);
return gst_sndio_close (&sink->sndio);
}
static gboolean
gst_sndiosink_prepare (GstAudioSink * asink, GstAudioRingBufferSpec * spec)
{
GstSndioSink *sink = GST_SNDIOSINK (asink);
return gst_sndio_prepare (&sink->sndio, spec);
}
static gboolean
gst_sndiosink_unprepare (GstAudioSink * asink)
{
GstSndioSink *sink = GST_SNDIOSINK (asink);
return gst_sndio_unprepare (&sink->sndio);
}
static gint
gst_sndiosink_write (GstAudioSink * asink, gpointer data, guint length)
{
GstSndioSink *sink = GST_SNDIOSINK (asink);
guint done;
if (length == 0)
return 0;
done = sio_write (sink->sndio.hdl, data, length);
if (done == 0) {
GST_ELEMENT_ERROR (sink, RESOURCE, WRITE,
("Failed to write data to sndio"), (NULL));
return 0;
}
sink->sndio.delay += done;
return done;
}
static guint
gst_sndiosink_delay (GstAudioSink * asink)
{
GstSndioSink *sink = GST_SNDIOSINK (asink);
return GST_SNDIO_DELAY(&sink->sndio);
}
static void
gst_sndiosink_reset (GstAudioSink * asink)
{
}
static void
gst_sndiosink_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstSndioSink *sink = GST_SNDIOSINK (object);
gst_sndio_set_property (&sink->sndio, prop_id, value, pspec);
}
static void
gst_sndiosink_get_property (GObject * object, guint prop_id, GValue * value,
GParamSpec * pspec)
{
GstSndioSink *sink = GST_SNDIOSINK (object);
gst_sndio_get_property (&sink->sndio, prop_id, value, pspec);
}
static void
gst_sndiosink_class_init (GstSndioSinkClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
GstBaseSinkClass *gstbasesink_class;
GstAudioBaseSinkClass *gstbaseaudiosink_class;
GstAudioSinkClass *gstaudiosink_class;
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
gstbasesink_class = (GstBaseSinkClass *) klass;
gstbaseaudiosink_class = (GstAudioBaseSinkClass *) klass;
gstaudiosink_class = (GstAudioSinkClass *) klass;
parent_class = g_type_class_peek_parent (klass);
gobject_class->finalize = gst_sndiosink_finalize;
gobject_class->get_property = gst_sndiosink_get_property;
gobject_class->set_property = gst_sndiosink_set_property;
gst_element_class_set_static_metadata (gstelement_class,
"Audio sink (sndio)", "Sink/Audio",
"Output to a sound card via sndio",
"Jacob Meuser <jakemsr@sdf.lonestar.org>");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&sndiosink_factory));
gstbasesink_class->get_caps = GST_DEBUG_FUNCPTR (gst_sndiosink_getcaps);
gstaudiosink_class->open = GST_DEBUG_FUNCPTR (gst_sndiosink_open);
gstaudiosink_class->prepare = GST_DEBUG_FUNCPTR (gst_sndiosink_prepare);
gstaudiosink_class->unprepare = GST_DEBUG_FUNCPTR (gst_sndiosink_unprepare);
gstaudiosink_class->close = GST_DEBUG_FUNCPTR (gst_sndiosink_close);
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);
g_object_class_install_property (gobject_class, PROP_DEVICE,
g_param_spec_string ("device", "Device",
"sndio device as defined in sndio(7)",
SIO_DEVANY, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_VOLUME,
g_param_spec_double ("volume", "Volume",
"Linear volume of this stream, 1.0=100%", 0.0, 1.0,
1.0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_MUTE,
g_param_spec_boolean ("mute", "Mute",
"Mute state of this stream", FALSE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}

View File

@@ -0,0 +1,57 @@
/*
* Copyright (C) 2008 Jacob Meuser <jakemsr@sdf.lonestar.org>
* Copyright (C) 2012 Alexandre Ratchov <alex@caoua.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>
#include "gstsndio.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 gstsndio sndio;
};
struct _GstSndioSinkClass {
GstAudioSinkClass parent_class;
};
GType gst_sndiosink_get_type (void);
G_END_DECLS
#endif /* __GST_SNDIOSINK_H__ */

6
java/openjfx14/pkg-descr Normal file
View File

@@ -0,0 +1,6 @@
OpenJFX is an open source, next generation client application platform for
desktop and embedded systems based on JavaSE. It is a collaborative effort by
many individuals and companies with the goal of producing a modern, efficient,
and fully featured toolkit for developing rich client applications.
WWW: https://openjdk.java.net/projects/openjfx/

34
java/openjfx14/pkg-plist Normal file
View File

@@ -0,0 +1,34 @@
%%INSTALLDIR%%/javafx-exports.zip
%%INSTALLDIR%%/jmods/javafx.base.jmod
%%INSTALLDIR%%/jmods/javafx.controls.jmod
%%INSTALLDIR%%/jmods/javafx.fxml.jmod
%%INSTALLDIR%%/jmods/javafx.graphics.jmod
%%INSTALLDIR%%/jmods/javafx.media.jmod
%%INSTALLDIR%%/jmods/javafx.swing.jmod
%%INSTALLDIR%%/jmods/javafx.web.jmod
%%INSTALLDIR%%/lib/javafx.base.jar
%%INSTALLDIR%%/lib/javafx.controls.jar
%%INSTALLDIR%%/lib/javafx.fxml.jar
%%INSTALLDIR%%/lib/javafx.graphics.jar
%%INSTALLDIR%%/lib/javafx.media.jar
%%INSTALLDIR%%/lib/javafx.properties
%%INSTALLDIR%%/lib/javafx.swing.jar
%%INSTALLDIR%%/lib/javafx.web.jar
%%MEDIA%%%%INSTALLDIR%%/lib/libavplugin.so
%%INSTALLDIR%%/lib/libdecora_sse.so
%%MEDIA%%%%INSTALLDIR%%/lib/libfxplugins.so
%%INSTALLDIR%%/lib/libglass.so
%%INSTALLDIR%%/lib/libglassgtk2.so
%%INSTALLDIR%%/lib/libglassgtk3.so
%%MEDIA%%%%INSTALLDIR%%/lib/libgstreamer-lite.so
%%INSTALLDIR%%/lib/libjavafx_font.so
%%INSTALLDIR%%/lib/libjavafx_font_freetype.so
%%INSTALLDIR%%/lib/libjavafx_font_pango.so
%%INSTALLDIR%%/lib/libjavafx_iio.so
%%MEDIA%%%%INSTALLDIR%%/lib/libjfxmedia.so
%%WEBKIT%%%%INSTALLDIR%%/lib/libjfxwebkit.so
%%INSTALLDIR%%/lib/libprism_common.so
%%INSTALLDIR%%/lib/libprism_es2.so
%%INSTALLDIR%%/lib/libprism_sw.so
%%INSTALLDIR%%/lib/javafx-src.zip
%%SWT%%%%INSTALLDIR%%/lib/javafx-swt.jar