[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    [PATCH]
From:       James Richard Tyrer <tyrerj () acm ! org>
Date:       2003-07-01 6:03:49
[Download RAW message or body]

Attached is my patch to fix bug #59367.

I have installed this on my system and it works correctly with LPR. 
Specifically, I have the SF RPMs for GNUlpr.

This patch was made against KDE_3_1_BRANCH.  However, unless the text 
deleted from: "startkde" has been changed it should work with HEAD as well.

Your comments would be appreciated.

I will try to get CUPS running in a day or two and see if the issues can be 
resolved with CUPS.

A specific issue is the question of the directories for GhostScript.

I was unable to find any RPM packages that did not have the executable 
(which should be a link to: "gsc"): "/usr/bin/gs" and if you install BFS 
in: "/usr/local/" you appear to need a link in: "/usr/bin/" since some 
printing systems expect to find it there.  But, if anybody has GhostScript 
installed somewhere else, please advise.

I don't know about using this on other UNIX.  I don't even know if it is 
needed since part of the problem appears to be in Bash.

In any case, this should be deleted from: "startkde" since it doesn't work:

-#
-# Get Ghostscript to look into user's KDE fonts dir for additional Fontmap
-if test -n "$GS_LIB" ; then
-    GS_LIB=$kde_fontsdir:$GS_LIB
-    export GS_LIB
-else
-    GS_LIB=$kde_fontsdir
-    export GS_LIB
-fi
-

I find that some RPM packages don't install GhostScript as SO. :-(
Since this is needed for other packages, I did not address this issue in my 
  Make stuff.  Comments?

Note that I tried to make this fix not for KDE only.  Perhaps there is a 
good case to be made that it should be KDE centric.  It which case, it 
would use an RC file rather than using a 'profile.d' script and some 
(different) code would need to be in: "startkde".

--
JRT

["gsk-1.0beta1.patch" (text/plain)]

diff -Naur kdebase.old/README.gsk kdebase/README.gsk
--- kdebase.old/README.gsk	1970-01-01 00:00:00.000000000 +0000
+++ kdebase/README.gsk	2003-06-29 17:37:26.000000000 +0000
@@ -0,0 +1,33 @@
+The script: "gsk" is an experimental fix for a problem with
+GhostScript not finding fonts in directories specified with the
+paths in the GS_LIB and GS_FONTPATH environment strings.
+
+To try this, add the paramater:
+
+	--with-gsk 
+
+to the "./configure" command line.
+
+To use this, you must have installed GhostScript as a shared
+object.
+
+This will replace: "/usr/bin/gs" with a link to:
+"$KDEDIR/bin/gsk" and the script will call the: "gsc"
+executable.  If "/usr/bin/" is not writable, you will need to
+make the link manually.
+
+A prototype 'profile.d' script: "gs.sh" is included.  Install it
+in: "/etc/profile.d/" and use it to set the GS_LIB and
+GS_FONTPATH environment variables.  If your system doesn't
+support 'profile.d' scripts you will need to edit: "profile" to
+source the script.
+
+If you have other 'profile.d' scripts which set these two
+environment variables, you may wish to add their names to line
+33 of the: "gsk" script.
+
+For additional information, please see the GhostScript
+documentation.
+
+NOTE: The: "gsk" script has been tested with 'lpr'.  There is
+some question of whether it will work properly with CUPS.
\ No newline at end of file
diff -Naur kdebase.old/gs.sh kdebase/gs.sh
--- kdebase.old/gs.sh	1970-01-01 00:00:00.000000000 +0000
+++ kdebase/gs.sh	2003-06-27 06:48:48.000000000 +0000
@@ -0,0 +1,16 @@
+gs_lib="$HOME/.kde/share/fonts"
+gs_fontpath=""
+
+if test -n "$GS_FONTPATH" ; then
+    GS_FONTPATH=$GS_FONTPATH:$gs_fontpath
+else
+    GS_FONTPATH=$gs_fontpath
+fi
+
+if test -n "$GS_LIB" ; then
+    GS_LIB=$gs_lib:$GS_LIB
+else
+    GS_LIB=$gs_lib
+fi
+
+export GS_LIB GS_FONTPATH 
diff -Naur kdebase.old/gsk/Makefile.am kdebase/gsk/Makefile.am
--- kdebase.old/gsk/Makefile.am	1970-01-01 00:00:00.000000000 +0000
+++ kdebase/gsk/Makefile.am	2003-06-28 02:05:31.000000000 +0000
@@ -0,0 +1,7 @@
+bin_SCRIPTS = gsk
+
+install-exec-hook:
+	rm -f /usr/bin/gs
+	ln -s $(DESTDIR)$(bindir)/gsk /usr/bin/gs
+
+
diff -Naur kdebase.old/gsk/configure.in.in kdebase/gsk/configure.in.in
--- kdebase.old/gsk/configure.in.in	1970-01-01 00:00:00.000000000 +0000
+++ kdebase/gsk/configure.in.in	2003-06-29 18:44:09.000000000 +0000
@@ -0,0 +1,43 @@
+ac_gsk_install="no"
+
+AC_ARG_WITH(gsk,
+    AC_HELP_STRING([--with-gsk],
+                   [use gsk as a wrapper for GhostScript (EXPERIMENTAL) Linux only, see README.gsk]),
+[if test "$withval" = "yes" 
+    then
+        ac_gsk_install="yes"
+fi])
+
+AC_MSG_CHECKING(for gsc directory)
+
+AC_CACHE_VAL(ac_cv_gsk_install_gsc_dir,
+[
+ac_cv_gsk_install_gsc_dir="not found"
+
+for dir in /usr/bin /usr/local/bin ;
+    do
+    	if test -f "$dir/gsc" 
+	    then
+	    	ac_cv_gsk_install_gsc_dir="$dir"
+		break
+	fi
+done
+])
+
+gsc_dir="$ac_cv_gsk_install_gsc_dir"
+
+if test "$ac_cv_gsk_install_gsc_dir" = "not found" 
+    then
+	ac_gsk_install="no"
+	gsc_dir=""
+fi
+
+AC_MSG_RESULT($ac_cv_gsk_install_gsc_dir)
+
+AC_SUBST(gsc_dir)
+AC_CONFIG_FILES(gsk/gsk)
+
+if test "$ac_gsk_install" = "no"  
+    then
+    	DO_NOT_COMPILE="$DO_NOT_COMPILE gsk"
+fi
diff -Naur kdebase.old/gsk/gsk.in kdebase/gsk/gsk.in
--- kdebase.old/gsk/gsk.in	1970-01-01 00:00:00.000000000 +0000
+++ kdebase/gsk/gsk.in	2003-06-28 08:59:48.000000000 +0000
@@ -0,0 +1,23 @@
+#!/bin/sh
+# 
+
+if [ $USER = "root" ]; 
+    then
+    	home_usr="/root"
+    else
+    	home_usr="/home/$USER"
+fi
+
+if [ "$HOME" != "$home_usr" ];
+    then
+	HOME="$home_usr"
+	export HOME 
+	for i in /etc/profile.d/gs.sh ; do
+	    if [ -r "$i" ]; then
+		. $i
+	    fi
+	done
+	unset i
+fi
+
+exec @gsc_dir@/gsc "$@"
diff -Naur kdebase.old/startkde kdebase/startkde
--- kdebase.old/startkde	2003-05-31 20:27:18.000000000 +0000
+++ kdebase/startkde	2003-06-22 02:44:58.000000000 +0000
@@ -103,16 +103,6 @@
 test "$XDM_MANAGED" || bkg="-solid #C0C0C0"
 xsetroot -cursor_name left_ptr $bkg
 
-#
-# Get Ghostscript to look into user's KDE fonts dir for additional Fontmap
-if test -n "$GS_LIB" ; then
-    GS_LIB=$kde_fontsdir:$GS_LIB
-    export GS_LIB
-else
-    GS_LIB=$kde_fontsdir
-    export GS_LIB
-fi
-
 # Link "tmp" resource to directory in /tmp
 # Creates a directory /tmp/kde-$USER and links $KDEHOME/tmp-$HOSTNAME to it.
 lnusertemp tmp >/dev/null


>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic