20029006 xman shows raw postscript output for man pages
authorAlan Coopersmith <Alan.Coopersmith@Oracle.COM>
Fri, 14 Nov 2014 15:59:31 -0800
changeset 1444 b3195591c9ff
parent 1443 df6261a3d4eb
child 1445 2424a17ad18c
20029006 xman shows raw postscript output for man pages
open-src/app/xman/Makefile
open-src/app/xman/groff.patch
pkg/manifests/x11-xman.p5m
--- a/open-src/app/xman/Makefile	Tue May 06 17:30:25 2014 -0700
+++ b/open-src/app/xman/Makefile	Fri Nov 14 15:59:31 2014 -0800
@@ -2,7 +2,7 @@
 #
 # xman - manual page browser
 #
-# Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
 # copy of this software and associated documentation files (the "Software"),
@@ -38,6 +38,7 @@
 
 # Patches to apply to source after unpacking, in order
 SOURCE_PATCHES = 6708109.patch,-p1
+SOURCE_PATCHES += groff.patch,-p1
 
 # Man pages to apply Sun footer to & attributes to list
 SUNTOUCHED_MANPAGES=man/xman.man
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/app/xman/groff.patch	Fri Nov 14 15:59:31 2014 -0800
@@ -0,0 +1,40 @@
+Update #ifdefs for Solaris to use correct groff options to get readable 
+output instead of raw PostScript output for man pages, and put the rest
+of the groff utilities (tbl, pic, etc.) ahead of the SVR4 ones in $PATH.
+
+diff --git a/main.c b/main.c
+index f75796d..ff364e2 100644
+--- a/main.c
++++ b/main.c
+@@ -152,6 +152,18 @@ main(int argc, char **argv)
+     saved_argv = (char **) XtMalloc(argc * sizeof(char *));
+     bcopy(argv, saved_argv, argc * sizeof(char *));
+ 
++#ifdef sun /* force use of groff tools vs. SVR4 nroff tools */
++    {
++	const char *orig_path = getenv("PATH");
++	char *new_path;
++
++	if (asprintf(&new_path, "PATH=/usr/gnu/bin:%s",
++		     orig_path ? orig_path : "/usr/bin") != -1) {
++	    putenv(new_path);
++	}
++    }
++#endif
++    
+     XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
+ 
+     initial_widget = XtAppInitialize(&app_con, "Xman", xman_options,
+diff --git a/vendor.h b/vendor.h
+index 548ded6..2ece09b 100644
+--- a/vendor.h
++++ b/vendor.h
+@@ -159,7 +159,7 @@ from the X Consortium.
+ # define REFER		"refer"
+ # if defined(CSRG_BASED)
+ #  define FORMAT	"nroff -mandoc"
+-# elif defined(linux)
++# elif defined(linux) || defined(sun)
+ #  define FORMAT	"GROFF_NO_SGR= groff -Tlatin1 -mandoc"
+ # elif defined(__DARWIN__)
+ #  define FORMAT	"nroff -man"
--- a/pkg/manifests/x11-xman.p5m	Tue May 06 17:30:25 2014 -0700
+++ b/pkg/manifests/x11-xman.p5m	Fri Nov 14 15:59:31 2014 -0800
@@ -1,4 +1,4 @@
-# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
 # copy of this software and associated documentation files (the "Software"),
@@ -31,3 +31,5 @@
 file path=usr/share/man/man1/xman.1
 # Xman app-defaults uses fonts including courier, symbol, helvetica, lucida
 depend type=require fmri=pkg:/system/font/xorg/xorg-core
+# Xman uses groff utilities to process man pages in nroff format
+depend type=require fmri=pkg:/text/groff/groff-core