--- a/components/desktop/xscreensaver/patches/04-solaris-paths.patch Mon Mar 07 13:01:10 2016 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,309 +0,0 @@
-Various fixes to deal with how & where we install things on Solaris:
-
-- Only run hacks from the hacks dir, not $PATH
-
-- Find helper programs even though they are not in $PATH
-
-- Show author names when reading RSS feeds from sites like blogs.sun.com
-
-- Show Solaris package names in demo app when hacks are not installed
-
-- Use gnome-help to display man pages nicely, without requiring internet
- access (which some customers at secure sites won't have configured),
- instead of opening a web browser to view the man page at jwz.org or
- opening a gnome-terminal to run the man command.
-
-Mostly not acceptable upstream.
-
-Backport notes: this change relies on the gnome-help version delivered in
-Nevada that supports "man:xscreensaver" style URL's to display man pages.
-When backporting to older releases you will probably want to uncomment the
-lines shown for GNOME 2.4/2.6.
-
-Also, you'll need to fix the package names shown when the hacks are not
-installed to be the older SUNWxscreensaver-* for Solaris 10 & older.
----
- driver/Makefile.in | 9 ++++--
- driver/XScreenSaver.ad.in | 14 +++++++---
- driver/demo-Gtk.c | 4 +-
- driver/subprocs.c | 54 +++++++++++++++++++++++++++++++++++++-
- driver/xscreensaver-demo.glade2 | 8 +++--
- driver/xscreensaver-text | 6 +++-
- driver/xscreensaver.man | 5 +--
- hacks/glx/Makefile.in | 4 +-
- 8 files changed, 84 insertions(+), 20 deletions(-)
-
-diff --git a/driver/Makefile.in b/driver/Makefile.in
---- a/driver/Makefile.in
-+++ b/driver/Makefile.in
-@@ -27,7 +27,7 @@ INTLTOOL_MERGE = @INTLTOOL_MERGE@
- GTK_DATADIR = @GTK_DATADIR@
- GTK_APPDIR = $(GTK_DATADIR)/applications
- GTK_ICONDIR = $(GTK_DATADIR)/pixmaps
--GTK_GLADEDIR = $(GTK_DATADIR)/xscreensaver/glade
-+GTK_GLADEDIR = $(prefix)/lib/xscreensaver/config
- HACK_CONF_DIR = @HACK_CONF_DIR@
-
- CC = @CC@
-@@ -36,8 +36,11 @@ CFLAGS = @CFLAGS@
- LDFLAGS = @LDFLAGS@
- DEFS = @DEFS@
- INTL_DEFS = -DLOCALEDIR=\"$(localedir)\"
--SUBP_DEFS = $(DEFS) -DDEFAULT_PATH_PREFIX='"@HACKDIR@"'
--GTK_DEFS = $(DEFS) -DDEFAULT_ICONDIR='"$(GTK_GLADEDIR)"'
-+SUBP_DEFS = $(DEFS) -DHACK_PATH='"@HACKDIR@"' \
-+ -DDEFAULT_PATH_PREFIX='"@HACKDIR@:$(libexecdir)"' \
-+ -DHELPER_PATH='"$(libexecdir)"'
-+GTK_DEFS = $(DEFS) -DDEFAULT_ICONDIR='"$(GTK_GLADEDIR)"' \
-+ -DBINDIR='"$(bindir)"'
- CONF_DEFS = -DHACK_CONFIGURATION_PATH='"$(HACK_CONF_DIR)"'
-
- LIBS = @LIBS@
-diff --git a/driver/XScreenSaver.ad.in b/driver/XScreenSaver.ad.in
---- a/driver/XScreenSaver.ad.in
-+++ b/driver/XScreenSaver.ad.in
-@@ -91,18 +91,24 @@ GetViewPortIsFullOfLies: False
-
- ! This is the URL loaded by the "Help" button on the splash screen,
- ! and by the "Documentation" menu item in xscreensaver-demo.
--*helpURL: http://www.jwz.org/xscreensaver/man.html
-+*helpURL: man:xscreensaver
-
- ! loadURL -- how the "Help" buttons load the helpURL (/bin/sh syntax.)
- ! manualCommand -- how the "Documentation" buttons display man pages.
- !
- ! And there are so very many options to choose from!
- !
-+! Modern GNOME:
-+!
-+*loadURL: gnome-help '%s'
-+*manualCommand: gnome-help 'man:%s'
-+!
- ! Gnome 2.4, 2.6: (yelp can't display man pages, as of 2.6.3)
- !
--@GNOME24@*loadURL: @WITH_BROWSER@ '%s'
--@GNOME24@*manualCommand: gnome-terminal --title '%s manual' \
--@GNOME24@ --command '/bin/sh -c "man %s; read foo"'
-+!*loadURL: gnome-terminal --title 'xscreensaver manual' \
-+! --command '/bin/ksh -c "man xscreensaver; read foo"'
-+!*manualCommand: gnome-terminal --title '%s manual' \
-+! --command '/bin/ksh -c "man %s; read foo"'
- !
- ! Gnome 2.2:
- !
-diff --git a/driver/demo-Gtk.c b/driver/demo-Gtk.c
---- a/driver/demo-Gtk.c
-+++ b/driver/demo-Gtk.c
-@@ -991,7 +991,7 @@ restart_menu_cb (GtkWidget *widget, gpointer user_data)
- flush_dialog_changes_and_save (s);
- xscreensaver_command (GDK_DISPLAY(), XA_EXIT, 0, False, NULL);
- sleep (1);
-- if (system ("xscreensaver -nosplash &") < 0)
-+ if (system (BINDIR "/xscreensaver -nosplash &") < 0)
- fprintf (stderr, "%s: fork error\n", blurb());
-
- await_xscreensaver (s);
-@@ -4951,7 +4951,7 @@ main (int argc, char **argv)
-
- if (init_results == 1)
- {
-- system ("xscreensaver -nosplash &");
-+ system (BINDIR "/xscreensaver -nosplash &");
- return 0;
- }
-
-diff --git a/driver/subprocs.c b/driver/subprocs.c
---- a/driver/subprocs.c
-+++ b/driver/subprocs.c
-@@ -14,6 +14,7 @@
- # include "config.h"
- #endif
-
-+#include <sys/stat.h>
- #include <ctype.h>
- #include <stdio.h>
- #include <string.h>
-@@ -791,6 +792,8 @@ print_path_error (const char *program)
- free (cmd);
- perror (buf);
-
-+/* mali - security issue do not want to display user's path */
-+#ifdef EXPOSE_USER_PATH
- if (errno == ENOENT &&
- (token = getenv("PATH")))
- {
-@@ -821,6 +824,7 @@ print_path_error (const char *program)
- }
- fprintf (stderr, "\n");
- }
-+#endif
- }
-
-
-@@ -877,12 +881,42 @@ fork_and_exec (saver_screen_info *ssi, const char *command)
- return forked;
- }
-
-+static Bool
-+check_if_hacks_dir_exists(Bool verbose_p)
-+{
-+ const char hackdir[] = HACK_PATH;
-+
-+ int status;
-+ struct stat st;
-+
-+ status = stat (hackdir, &st);
-+
-+ if (status == 0 && S_ISDIR(st.st_mode))
-+ {
-+ return True;
-+ }
-+ else
-+ {
-+ if (verbose_p)
-+ {
-+ fprintf(stderr,
-+ "%s: Warning: dir: %s missing. Will not run hacks\n",
-+ blurb(), hackdir);
-+ }
-+ return False;
-+ }
-+}
-
- void
- spawn_screenhack (saver_screen_info *ssi)
- {
- saver_info *si = ssi->global;
- saver_preferences *p = &si->prefs;
-+ char* complete_hack_command;
-+
-+ if (si->prefs.verbose_p)
-+ fprintf(stderr, "--> spawn_screenhack()\n");
-+
- XFlush (si->dpy);
-
- if (!monitor_powered_on_p (si))
-@@ -962,6 +996,12 @@ spawn_screenhack (saver_screen_info *ssi)
- ;
- }
-
-+ if ((new_hack >= 0) &&
-+ (check_if_hacks_dir_exists(p->verbose_p) == False))
-+ {
-+ new_hack = -1;
-+ }
-+
- if (new_hack < 0) /* don't run a hack */
- {
- ssi->current_hack = -1;
-@@ -1009,7 +1049,17 @@ spawn_screenhack (saver_screen_info *ssi)
- if (si->selection_mode < 0)
- si->selection_mode = 0;
-
-- forked = fork_and_exec (ssi, hack->command);
-+ /* We need complete path to hack command else any executable
-+ * with the same name in the path gets executed.
-+ */
-+ complete_hack_command = malloc (10 + strlen(hack->command) +
-+ strlen (HACK_PATH));
-+ sprintf(complete_hack_command, HACK_PATH"/%s", hack->command);
-+
-+
-+ forked = fork_and_exec (ssi, complete_hack_command);
-+ free (complete_hack_command);
-+
- switch ((int) forked)
- {
- case -1: /* fork failed */
-@@ -1186,7 +1236,7 @@ get_best_gl_visual (saver_info *si, Screen *screen)
- char *av[10];
- int ac = 0;
-
-- av[ac++] = "xscreensaver-gl-helper";
-+ av[ac++] = HELPER_PATH "/xscreensaver-gl-helper";
- av[ac] = 0;
-
- if (pipe (fds))
-diff --git a/driver/xscreensaver-demo.glade2 b/driver/xscreensaver-demo.glade2
---- a/driver/xscreensaver-demo.glade2
-+++ b/driver/xscreensaver-demo.glade2
-@@ -927,6 +927,6 @@ Installed</property>
- <property name="visible">True</property>
- <property name="label" translatable="yes">Very few (or no) screen savers appear to be available.
-
--This probably means that the "xscreensaver-extras" and
--"xscreensaver-gl-extras" packages are not installed.</property>
-+This probably means that the “desktop/xscreensaver/hacks” and
-+“desktop/xscreensaver/hacks/hacks-gl” packages are not installed.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
-diff --git a/driver/xscreensaver-text b/driver/xscreensaver-text
---- a/driver/xscreensaver-text
-+++ b/driver/xscreensaver-text
-@@ -698,12 +698,15 @@ sub reformat_rss($) {
- $i++;
-
- my ($title, $body1, $body2, $body3);
-+ my $author;
-
- $title = $3 if (m@<((TITLE) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
- $body1 = $3 if (m@<((DESCRIPTION) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
- $body2 = $3 if (m@<((CONTENT) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
- $body3 = $3 if (m@<((SUMMARY) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
-
-+ $author = $3 if (m@<((DC:CREATOR) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
-+
- # If there are both <description> and <content> or <content:encoded>,
- # use whichever one contains more text.
- #
-@@ -727,10 +730,11 @@ sub reformat_rss($) {
-
- $title = rss_field_to_html ($title || '');
- $body1 = rss_field_to_html ($body1 || '');
-+ $author = rss_field_to_html ($author || '');
-
- $title = '' if ($body1 eq $title); # Identical in Twitter's atom feed.
-
-- reformat_html ("$title<P>$body1", 1);
-+ reformat_html ("$title<BR>$author<P>$body1", 1);
- print "\n";
- }
- }
-diff --git a/driver/xscreensaver.man b/driver/xscreensaver.man
---- a/driver/xscreensaver.man
-+++ b/driver/xscreensaver.man
-@@ -97,9 +97,8 @@ xscreensaver-command -restart
- If you want to set the system-wide defaults, then make your edits to
- the xscreensaver app-defaults file, which should have been installed
- when xscreensaver itself was installed. The app-defaults file will
--usually be named /usr/lib/X11/app-defaults/XScreenSaver, but different
--systems might keep it in a different place (for example,
--/usr/openwin/lib/app-defaults/XScreenSaver on Solaris.)
-+usually be named /usr/share/X11/app-defaults/XScreenSaver, but different
-+systems might keep it in a different place.
-
- When settings are changed in the Preferences dialog box (see above)
- the current settings will be written to the \fI.xscreensaver\fP file.
-diff --git a/hacks/glx/Makefile.in b/hacks/glx/Makefile.in
---- a/hacks/glx/Makefile.in
-+++ b/hacks/glx/Makefile.in
-@@ -278,7 +278,7 @@ install-program:: $(EXES)
- # the xscreensaver-gl-helper program, in $bindir
- install-program:: $(EXES)
- @exes="@GL_UTIL_EXES@" ; \
-- idir="$(install_prefix)$(bindir)" ; \
-+ idir="$(install_prefix)$(libexecdir)" ; \
- if [ "$$exes" != "" ]; then \
- if [ ! -d $$idir ]; then \
- $(INSTALL_DIRS) $$idir ; \
-@@ -347,7 +347,7 @@ uninstall-program::
- # the xscreensaver-gl-helper program, in $bindir
- uninstall-program::
- @exes="$(GL_UTIL_EXES)" ; \
-- idir="$(install_prefix)$(bindir)" ; \
-+ idir="$(install_prefix)$(libexecdir)" ; \
- for program in $$exes; do \
- echo rm -f $$idir/$$program ; \
- rm -f $$idir/$$program ; \
-