diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2014-05-21 20:03:14 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2014-05-21 20:03:14 +0000 |
commit | d7cffff692b26af273273d1e79bf6b55e5fc8557 (patch) | |
tree | 6918b0f84f2b152b5437dbb945daef1ebdb514b1 /java | |
parent | 2d730b1b6d23403a87cf895c59c2c9a6d58ab2d9 (diff) |
Notes
Diffstat (limited to 'java')
4 files changed, 94 insertions, 2 deletions
diff --git a/java/openjdk7/Makefile b/java/openjdk7/Makefile index 5f19c97d256f..33cb93918536 100644 --- a/java/openjdk7/Makefile +++ b/java/openjdk7/Makefile @@ -3,7 +3,7 @@ PORTNAME= openjdk PORTVERSION= ${JDK_MAJOR_VERSION}.${PORT_MINOR_VERSION}.${PORT_BUILD_NUMBER} -PORTREVISION= 4 +PORTREVISION= 5 PORTEPOCH= 1 CATEGORIES= java devel MASTER_SITES= http://download.java.net/openjdk/jdk${JDK_MAJOR_VERSION}u${JDK_MINOR_VERSION}/promoted/b${JDK_BUILD_NUMBER}/ \ @@ -130,7 +130,8 @@ MAKE_ENV+= EXTRA_CFLAGS=-DLIBICONV_PLUG post-patch: @${REINPLACE_CMD} "s|%%LOCALBASE%%|${LOCALBASE}|" \ - ${WRKSRC}/hotspot/src/os/bsd/vm/os_bsd.cpp + ${WRKSRC}/hotspot/src/os/bsd/vm/os_bsd.cpp \ + ${WRKSRC}/jdk/src/share/classes/sun/print/PSPrinterJob.java .if empty(ICONV_LIB) @${REINPLACE_CMD} 's| -liconv||' \ ${WRKSRC}/Makefile \ diff --git a/java/openjdk7/files/patch-src-share-classes-sun-print-PSPrinterJob.java b/java/openjdk7/files/patch-src-share-classes-sun-print-PSPrinterJob.java new file mode 100644 index 000000000000..c4993514bdd4 --- /dev/null +++ b/java/openjdk7/files/patch-src-share-classes-sun-print-PSPrinterJob.java @@ -0,0 +1,36 @@ +--- jdk/src/share/classes/sun/print/PSPrinterJob.java ++++ jdk/src/share/classes/sun/print/PSPrinterJob.java +@@ -1568,9 +1568,31 @@ + } + + String osname = System.getProperty("os.name"); +- if (osname.equals("Linux") || osname.equals("FreeBSD") || osname.equals("NetBSD") || osname.equals("OpenBSD") || osname.equals("OS X")) { ++ if (osname.equals("Linux") || osname.endsWith("BSD") || osname.contains("OS X")) { ++ String lprPath = "/usr/bin/lpr"; ++ if (osname.endsWith("BSD")) { ++ final PrintService pservice = getPrintService(); ++ Boolean isIPPPrinter = ++ (Boolean)java.security.AccessController.doPrivileged( ++ new java.security.PrivilegedAction() { ++ public Object run() { ++ try { ++ Class psClass = ++ Class.forName("sun.print.IPPPrintService"); ++ if (psClass.isInstance(pservice)) { ++ return Boolean.TRUE; ++ } ++ } catch (Throwable t) { ++ } ++ return Boolean.FALSE; ++ } ++ }); ++ if (isIPPPrinter) { ++ lprPath = "%%LOCALBASE%%/bin/lpr"; ++ } ++ } + execCmd = new String[ncomps]; +- execCmd[n++] = "/usr/bin/lpr"; ++ execCmd[n++] = lprPath; + if ((pFlags & PRINTER) != 0) { + execCmd[n++] = "-P" + printer; + } diff --git a/java/openjdk7/files/patch-src-solaris-bin-java_md_solinux.c b/java/openjdk7/files/patch-src-solaris-bin-java_md_solinux.c new file mode 100644 index 000000000000..1d6b67c99987 --- /dev/null +++ b/java/openjdk7/files/patch-src-solaris-bin-java_md_solinux.c @@ -0,0 +1,38 @@ +--- jdk/src/solaris/bin/java_md_solinux.c ++++ jdk/src/solaris/bin/java_md_solinux.c +@@ -899,8 +899,9 @@ + * onwards the filename returned in DL_info structure from dladdr is + * an absolute pathname so technically realpath isn't required. + * On Linux we read the executable name from /proc/self/exe. +- * As a fallback, and for platforms other than Solaris and Linux, +- * we use FindExecName to compute the executable name. ++ * On FreeBSD we read the executable name from /proc/curproc/file. ++ * As a fallback, and for platforms other than Solaris, Linux, and ++ * FreeBSD, we use FindExecName to compute the executable name. + */ + const char* + SetExecname(char **argv) +@@ -927,9 +928,13 @@ + } + } + } +-#elif defined(__linux__) ++#elif defined(__linux__) || defined(__FreeBSD__) + { ++#if defined(__FreeBSD__) ++ const char* self = "/proc/curproc/file"; ++#else + const char* self = "/proc/self/exe"; ++#endif + char buf[PATH_MAX+1]; + int len = readlink(self, buf, PATH_MAX); + if (len >= 0) { +@@ -937,7 +942,7 @@ + exec_path = JLI_StringDup(buf); + } + } +-#else /* !__solaris__ && !__linux__ */ ++#else /* !__solaris__ && !__linux__ && !__FreeBSD__ */ + { + /* Not implemented */ + } diff --git a/java/openjdk7/files/patch-src-solaris-classes-sun-print-UnixPrintServiceLookup.java b/java/openjdk7/files/patch-src-solaris-classes-sun-print-UnixPrintServiceLookup.java new file mode 100644 index 000000000000..b2731645906d --- /dev/null +++ b/java/openjdk7/files/patch-src-solaris-classes-sun-print-UnixPrintServiceLookup.java @@ -0,0 +1,17 @@ +--- jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java ++++ jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java +@@ -140,12 +140,12 @@ + static int cmdIndex = UNINITIALIZED; + + String[] lpcFirstCom = { +- "/usr/sbin/lpc status | grep : | sed -ne '1,1 s/://p'", ++ "/usr/sbin/lpc status all | grep ':$' | sed -ne '1,1 s/://p'", + "/usr/sbin/lpc status | grep -E '^[ 0-9a-zA-Z_-]*@' | awk -F'@' '{print $1}'" + }; + + String[] lpcAllCom = { +- "/usr/sbin/lpc status all | grep : | sed -e 's/://'", ++ "/usr/sbin/lpc status all | grep ':$' | sed -e 's/://'", + "/usr/sbin/lpc status all | grep -E '^[ 0-9a-zA-Z_-]*@' | awk -F'@' '{print $1}' | sort" + }; + |