diff options
author | ale <ale@FreeBSD.org> | 2018-12-27 17:52:52 +0800 |
---|---|---|
committer | ale <ale@FreeBSD.org> | 2018-12-27 17:52:52 +0800 |
commit | 11238b36fbde8bedd38e6d39997d4a4711de86a8 (patch) | |
tree | 2053bbf6e05831e38264f5a50b41809e5a19bfc1 /java | |
parent | e9805e8aa3f435ce98933d1dfa0d22a844749f51 (diff) | |
download | freebsd-ports-gnome-11238b36fbde8bedd38e6d39997d4a4711de86a8.tar.gz freebsd-ports-gnome-11238b36fbde8bedd38e6d39997d4a4711de86a8.tar.zst freebsd-ports-gnome-11238b36fbde8bedd38e6d39997d4a4711de86a8.zip |
Add a WatchService implementation backed by kqueue,
leveraging the libinotify wrapper.
It's still possible to use the polling watchservice,
by defining the following system property:
sun.nio.fs.watchservice=polling
Diffstat (limited to 'java')
5 files changed, 68 insertions, 2 deletions
diff --git a/java/openjdk8/Makefile b/java/openjdk8/Makefile index b32d244c5b77..aa67c9071804 100644 --- a/java/openjdk8/Makefile +++ b/java/openjdk8/Makefile @@ -2,7 +2,7 @@ PORTNAME= openjdk PORTVERSION= ${JDK_MAJOR_VERSION}.${JDK_UPDATE_VERSION}.${JDK_BUILD_NUMBER:S/^0//} -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= java devel MASTER_SITES= http://download.java.net/openjdk/jdk${JDK_MAJOR_VERSION}/promoted/b${DIST_BUILD_NUMBER}/:jdk \ https://adopt-openjdk.ci.cloudbees.com/job/jtreg/${JTREG_JENKINS_BUILD}/artifact/:jtreg \ @@ -46,7 +46,8 @@ BUILD_DEPENDS= zip:archivers/zip \ autoconf>0:devel/autoconf \ ${LOCALBASE}/include/cups/cups.h:print/cups \ bash:shells/bash -LIB_DEPENDS= libfreetype.so:print/freetype2 +LIB_DEPENDS= libfreetype.so:print/freetype2 \ + libinotify.so:devel/libinotify RUN_DEPENDS= javavm:java/javavmwrapper \ dejavu>0:x11-fonts/dejavu @@ -406,6 +407,7 @@ post-patch: ${WRKSRC}/configure \ ${WRKSRC}/common/autoconf/toolchain.m4 \ ${WRKSRC}/jdk/make/lib/Awt2dLibraries.gmk \ + ${WRKSRC}/jdk/make/lib/NioLibraries.gmk \ ${WRKSRC}/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java \ ${WRKSRC}/jdk/src/share/classes/sun/print/PSPrinterJob.java \ ${WRKSRC}/jdk/src/solaris/classes/sun/nio/fs/BsdFileSystemProvider.java diff --git a/java/openjdk8/files/patch-jdk-make-CompileJavaClasses.gmk b/java/openjdk8/files/patch-jdk-make-CompileJavaClasses.gmk new file mode 100644 index 000000000000..82be1f09b4be --- /dev/null +++ b/java/openjdk8/files/patch-jdk-make-CompileJavaClasses.gmk @@ -0,0 +1,18 @@ +--- ./jdk/make/CompileJavaClasses.gmk.orig 2018-12-13 14:57:18.491487000 +0100 ++++ ./jdk/make/CompileJavaClasses.gmk 2018-12-13 14:58:08.484490000 +0100 +@@ -129,12 +129,12 @@ + sun/nio/fs/LinuxFileSystem.java \ + sun/nio/fs/LinuxFileSystemProvider.java \ + sun/nio/fs/LinuxNativeDispatcher.java \ +- sun/nio/fs/LinuxUserDefinedFileAttributeView.java \ +- sun/nio/fs/LinuxWatchService.java ++ sun/nio/fs/LinuxUserDefinedFileAttributeView.java + endif + + ifeq (, $(filter $(OPENJDK_TARGET_OS), linux bsd)) +- EXFILES += sun/nio/fs/MagicFileTypeDetector.java ++ EXFILES += sun/nio/fs/MagicFileTypeDetector.java \ ++ sun/nio/fs/LinuxWatchService.java + endif + + ifneq ($(OPENJDK_TARGET_OS), macosx) diff --git a/java/openjdk8/files/patch-jdk-make-lib-NioLibraries.gmk b/java/openjdk8/files/patch-jdk-make-lib-NioLibraries.gmk new file mode 100644 index 000000000000..38b9b50996b4 --- /dev/null +++ b/java/openjdk8/files/patch-jdk-make-lib-NioLibraries.gmk @@ -0,0 +1,14 @@ +--- ./jdk/make/lib/NioLibraries.gmk.orig 2018-12-13 14:21:04.047810000 +0100 ++++ ./jdk/make/lib/NioLibraries.gmk 2018-12-13 14:48:16.288168000 +0100 +@@ -92,8 +92,11 @@ + PollArrayWrapper.c \ + UnixAsynchronousServerSocketChannelImpl.c \ + UnixAsynchronousSocketChannelImpl.c \ ++ LinuxWatchService.c \ + UnixCopyFile.c \ + UnixNativeDispatcher.c ++ BUILD_LIBNIO_CFLAGS += -I%%LOCALBASE%%/include ++ BUILD_LIBNIO_LDFLAGS += -L%%LOCALBASE%%/lib -linotify + endif + + ifeq ($(OPENJDK_TARGET_OS), macosx) diff --git a/java/openjdk8/files/patch-jdk-make-mapfiles-libnio-mapfile-bsd b/java/openjdk8/files/patch-jdk-make-mapfiles-libnio-mapfile-bsd new file mode 100644 index 000000000000..94f6626b9fce --- /dev/null +++ b/java/openjdk8/files/patch-jdk-make-mapfiles-libnio-mapfile-bsd @@ -0,0 +1,17 @@ +--- ./jdk/make/mapfiles/libnio/mapfile-bsd.orig 2018-12-13 15:20:56.817147000 +0100 ++++ ./jdk/make/mapfiles/libnio/mapfile-bsd 2018-12-13 15:22:41.507010000 +0100 +@@ -143,6 +143,14 @@ + Java_sun_nio_fs_MagicFileTypeDetector_initialize0; + Java_sun_nio_fs_MagicFileTypeDetector_probe0; + Java_sun_nio_fs_UnixCopyFile_transfer; ++ Java_sun_nio_fs_LinuxWatchService_eventSize; ++ Java_sun_nio_fs_LinuxWatchService_eventOffsets; ++ Java_sun_nio_fs_LinuxWatchService_inotifyInit; ++ Java_sun_nio_fs_LinuxWatchService_inotifyAddWatch; ++ Java_sun_nio_fs_LinuxWatchService_inotifyRmWatch; ++ Java_sun_nio_fs_LinuxWatchService_configureBlocking; ++ Java_sun_nio_fs_LinuxWatchService_socketpair; ++ Java_sun_nio_fs_LinuxWatchService_poll; + Java_sun_nio_fs_UnixNativeDispatcher_access0; + Java_sun_nio_fs_UnixNativeDispatcher_chmod0; + Java_sun_nio_fs_UnixNativeDispatcher_chown0; diff --git a/java/openjdk8/files/patch-jdk-src-solaris-classes-sun-nio-fs-BsdFileSystem.java b/java/openjdk8/files/patch-jdk-src-solaris-classes-sun-nio-fs-BsdFileSystem.java new file mode 100644 index 000000000000..9fd4b9b78818 --- /dev/null +++ b/java/openjdk8/files/patch-jdk-src-solaris-classes-sun-nio-fs-BsdFileSystem.java @@ -0,0 +1,15 @@ +--- ./jdk/src/solaris/classes/sun/nio/fs/BsdFileSystem.java.orig 2018-12-13 14:23:02.834223000 +0100 ++++ ./jdk/src/solaris/classes/sun/nio/fs/BsdFileSystem.java 2018-12-13 17:34:09.359192000 +0100 +@@ -45,8 +45,10 @@ + public WatchService newWatchService() + throws IOException + { +- // use polling implementation until we implement a BSD/kqueue one +- return new PollingWatchService(); ++ if (System.getProperty("sun.nio.fs.watchservice", "").equals("polling")) ++ return new PollingWatchService(); ++ else ++ return new LinuxWatchService(this); // use the linux inotify implementation that wraps the kqueue calls + } + + // lazy initialization of the list of supported attribute views |