diff options
author | jkim <jkim@FreeBSD.org> | 2014-05-22 04:06:16 +0800 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2014-05-22 04:06:16 +0800 |
commit | 0be5b667e35407968d7088c656d3bdadee10fd93 (patch) | |
tree | 0f7c18894eba5225d3d9ecd8f743f81938807416 /java/openjdk8 | |
parent | bbee51a76a4bd66652e9867d1bde0194fb8d22a2 (diff) | |
download | freebsd-ports-gnome-0be5b667e35407968d7088c656d3bdadee10fd93.tar.gz freebsd-ports-gnome-0be5b667e35407968d7088c656d3bdadee10fd93.tar.zst freebsd-ports-gnome-0be5b667e35407968d7088c656d3bdadee10fd93.zip |
Fix printing services. When CUPS is used, ${LOCALBASE}/bin/lpr must be used
to print a generated PostScript file. When lpd(8) is used, lpr(1) from base
must be used. Also, status command for lpc(8) requires a printer name. If
no argument is specified, i.e., "/usr/sbin/lpc status", then it displays the
command usage, i.e., "usage: status {all | printer ...}". Unfortunately,
"usage" is interpreted as a printer name because ":" is included. Add "all"
and adjust an expression for grep(1).
Diffstat (limited to 'java/openjdk8')
-rw-r--r-- | java/openjdk8/Makefile | 3 | ||||
-rw-r--r-- | java/openjdk8/files/patch-bsd | 39 | ||||
-rw-r--r-- | java/openjdk8/files/patch-jdk-src-share-classes-sun-print-PSPrinterJob.java | 34 |
3 files changed, 69 insertions, 7 deletions
diff --git a/java/openjdk8/Makefile b/java/openjdk8/Makefile index 7dd7b9e58768..8cf7e841fc77 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?= 6 +PORTREVISION?= 7 CATEGORIES= java devel MASTER_SITES= http://download.java.net/openjdk/jdk${JDK_MAJOR_VERSION}/promoted/b${JDK_BUILD_NUMBER}/:jdk \ https://adopt-openjdk.ci.cloudbees.com/job/jtreg/${JTREG_JENKINS_BUILD}/artifact/:jtreg \ @@ -195,6 +195,7 @@ post-patch: ${WRKSRC}/common/autoconf/toolchain.m4 \ ${WRKSRC}/configure \ ${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 @${REINPLACE_CMD} -e 's|/usr/local/java/classes|${LOCALBASE}/share/java/classes|' \ ${WRKSRC}/jdk/src/bsd/doc/man/*.1 diff --git a/java/openjdk8/files/patch-bsd b/java/openjdk8/files/patch-bsd index d52c004a91cf..6876b4010bbb 100644 --- a/java/openjdk8/files/patch-bsd +++ b/java/openjdk8/files/patch-bsd @@ -8328,7 +8328,19 @@ /* * Prevent recursions. Since LD_LIBRARY_PATH is the one which will be set by -@@ -928,9 +934,13 @@ +@@ -900,8 +906,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) +@@ -928,9 +935,13 @@ } } } @@ -8343,7 +8355,7 @@ char buf[PATH_MAX+1]; int len = readlink(self, buf, PATH_MAX); if (len >= 0) { -@@ -938,7 +948,7 @@ +@@ -938,7 +949,7 @@ exec_path = JLI_StringDup(buf); } } @@ -8352,7 +8364,7 @@ { /* Not implemented */ } -@@ -1000,7 +1010,7 @@ +@@ -1000,7 +1011,7 @@ int ContinueInNewThread0(int (JNICALL *continuation)(void *), jlong stack_size, void * args) { int rslt; @@ -8361,7 +8373,7 @@ pthread_t tid; pthread_attr_t attr; pthread_attr_init(&attr); -@@ -1025,7 +1035,7 @@ +@@ -1025,7 +1036,7 @@ } pthread_attr_destroy(&attr); @@ -8370,7 +8382,7 @@ thread_t tid; long flags = 0; if (thr_create(NULL, stack_size, (void *(*)(void *))continuation, args, flags, &tid) == 0) { -@@ -1036,7 +1046,7 @@ +@@ -1036,7 +1047,7 @@ /* See above. Continue in current thread if thr_create() failed */ rslt = continuation(args); } @@ -8379,7 +8391,7 @@ return rslt; } -@@ -1044,13 +1054,13 @@ +@@ -1044,13 +1055,13 @@ #define MAX_PID_STR_SZ 20 void SetJavaLauncherPlatformProps() { @@ -8571,6 +8583,21 @@ osname.contains("OS X")); } +@@ -140,12 +141,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" + }; + --- jdk/src/solaris/classes/sun/tools/attach/BsdVirtualMachine.java +++ jdk/src/solaris/classes/sun/tools/attach/BsdVirtualMachine.java @@ -266,7 +266,7 @@ diff --git a/java/openjdk8/files/patch-jdk-src-share-classes-sun-print-PSPrinterJob.java b/java/openjdk8/files/patch-jdk-src-share-classes-sun-print-PSPrinterJob.java new file mode 100644 index 000000000000..b32b1579c72b --- /dev/null +++ b/java/openjdk8/files/patch-jdk-src-share-classes-sun-print-PSPrinterJob.java @@ -0,0 +1,34 @@ +--- jdk/src/share/classes/sun/print/PSPrinterJob.java ++++ jdk/src/share/classes/sun/print/PSPrinterJob.java +@@ -1588,8 +1588,30 @@ + + String osname = System.getProperty("os.name"); + 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; + } |