From dm@home3.dinoex.sub.de  Mon Jul 26 12:09:25 2010
Return-Path: <dm@home3.dinoex.sub.de>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 66E3A106564A
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 26 Jul 2010 12:09:25 +0000 (UTC)
	(envelope-from dm@home3.dinoex.sub.de)
Received: from uucp.dinoex.sub.de (uucp.dinoex.sub.de [194.45.71.2])
	by mx1.freebsd.org (Postfix) with ESMTP id F3E228FC1B
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 26 Jul 2010 12:09:24 +0000 (UTC)
Received: from home3.dinoex.sub.de (home3.dinoex.sub.de [194.45.71.20])
	by uucp.dinoex.sub.de (8.14.4/8.14.2) with ESMTP id o6QC8vZ9061783
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 26 Jul 2010 14:09:13 +0200 (CEST)
	(envelope-from dm@home3.dinoex.sub.de)
Received: (from dm@localhost)
	by home3.dinoex.sub.de (8.14.4/8.14.4/Submit) id o6QC8utZ038426;
	Mon, 26 Jul 2010 14:08:56 +0200 (CEST)
	(envelope-from dm)
Message-Id: <201007261208.o6QC8utZ038426@home3.dinoex.sub.de>
Date: Mon, 26 Jul 2010 14:08:56 +0200 (CEST)
From: dirk.meyer@dinoex.sub.org
Reply-To: dirk.meyer@dinoex.sub.org
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] print/ghostscript8 fails to suppport X
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         148960
>Category:       ports
>Synopsis:       [patch] print/ghostscript8 fails to suppport X
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    doceng
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 26 12:10:04 UTC 2010
>Closed-Date:    Mon Aug 02 06:21:36 UTC 2010
>Last-Modified:  Mon Aug  2 06:30:01 UTC 2010
>Originator:     Dirk Meyer
>Release:        FreeBSD 8.1-RELEASE
>Organization:
privat
>Environment:

ghostscript8 and ghostview isntalled.

>Description:

The port does not check the output from "OPTIONS"
if the default of that option in "on"

http://www.freebsd.org/doc/en/books/porters-handbook/makefile-options.html#AEN2446

The ghostscript8 port has different defaults in "OPTIONS"

OPTIONS=      FOO "Enable option foo" ${DEFAULT_ON_OFF}

in case of default "off"  the port check the correctly:

.if defined(WITH_FOO)
CONFIGURE_ARGS+= ....
.else
CONFIGURE_ARGS+= ....
.endif

in case of default "on"  the port check the correctly:
.if defined(WITHOUT_FOO)
CONFIGURE_ARGS+= ....
.else
CONFIGURE_ARGS+= ....
.endif

WITH_FOO is not defined!

better would be:

.if defined(WITH_FOO) || !defined(WITHOUT_FOO)
CONFIGURE_ARGS+= ....
.else
CONFIGURE_ARGS+= ....
.endif

testcases:
1. default "on",  Option selected    => WITH_FOO=true
2. default "on",  Option deselected  => WITHOUT_FOO=true
3. default "off", Option selected    => WITH_FOO=true
4. default "off", Option deselected  => WITHOUT_FOO=true
5. default "on",  BATCH=yes          => WITH_FOO=true
5. default "off", BATCH=yes          => WITHOUT_FOO=yes, WITH_FOO=true


print/ghostscript8-nox11# make BATCH=yes -V WITH_X11 -V WITHOUT_X11
true
yes

print/ghostscript8# make BATCH=yes -V WITH_X11 -V WITHOUT_X11
true



>How-To-Repeat:

ghostview fails to display any files,
reporting "Unknown device: x11"

to confirm ghostscript does not list x11 with:
gs -h

>Fix:

	apply the patch to fix most of the problems:

Index: files/Makefile.drivers_post
===================================================================
RCS file: /home/pcvs/ports/print/ghostscript8/files/Makefile.drivers_post,v
retrieving revision 1.2
diff -u -r1.2 Makefile.drivers_post
--- files/Makefile.drivers_post	25 May 2010 21:30:43 -0000	1.2
+++ files/Makefile.drivers_post	26 Jul 2010 11:56:33 -0000
@@ -59,10 +59,13 @@
 .undef _CUPS_DEVS
 
 .for D in ${CUPS_DEVS}
-.if defined(WITHOUT_CUPS)
+.if defined(WITHOUT_CUPS) || defined(WITHOUT_GS_${D})
 .undef WITH_GS_${D}
 .elif defined(WITH_GS_${D})
 _CUPS_DEVS+= ${D}
+.elif ${OPTIONS_CUPS_DEFAULT} == "on"
+_CUPS_DEVS+= ${D}
+WITH_GS_${D}=yes
 .endif
 .endfor
 
@@ -78,10 +81,13 @@
 .undef _VGA_DEVS
 
 .for D in ${VGA_DEVS}
-.if defined(WITHOUT_SVGALIB)
+.if defined(WITHOUT_SVGALIB) || defined(WITHOUT_GS_${D})
 .undef WITH_GS_${D}
 .elif defined(WITH_GS_${D})
 _VGA_DEVS+= ${D}
+.elif ${OPTIONS_SVGALIB_DEFAULT} == "on"
+_VGA_DEVS+= ${D}
+WITH_GS_${D}=yes
 .endif
 .endfor
 
@@ -95,10 +101,13 @@
 .undef _X11_DEVS
 
 .for D in ${X11_DEVS}
-.if defined(WITHOUT_X11)
+.if defined(WITHOUT_X11) || defined(WITHOUT_GS_${D})
 . undef WITH_GS_${D}
 .elif defined(WITH_GS_${D})
 _X11_DEVS+= ${D}
+.elif ${OPTIONS_X11_DEFAULT} == "on"
+_X11_DEVS+= ${D}
+WITH_GS_${D}=yes
 .endif
 .endfor
 
@@ -121,10 +130,13 @@
 .undef _ICONV_DEVS
 
 .for D in ${ICONV_DEVS}
-.if defined(WITHOUT_ICONV)
+.if defined(WITHOUT_ICONV) || defined(WITHOUT_GS_${D})
 .undef WITH_GS_${D}
 .elif defined(WITH_GS_${D})
 _ICONV_DEVS+= ${D}
+.elif ${OPTIONS_ICONV_DEFAULT} == "on"
+_ICONV_DEVS+= ${D}
+WITH_GS_${D}=yes
 .endif
 .endfor
 
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->doceng 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Jul 26 12:10:29 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=148960 

From: Hiroki Sato <hrs@FreeBSD.org>
To: dirk.meyer@dinoex.sub.org
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: ports/148960: [patch] print/ghostscript8 fails to suppport X
Date: Mon, 02 Aug 2010 00:01:45 +0900 (JST)

 ----Security_Multipart(Mon_Aug__2_00_01_45_2010_341)--
 Content-Type: Text/Plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 Hi,
 
 dirk.meyer@dinoex.sub.org wrote
   in <201007261208.o6QC8utZ038426@home3.dinoex.sub.de>:
 
 di> better would be:
 di>
 di> .if defined(WITH_FOO) || !defined(WITHOUT_FOO)
 di> CONFIGURE_ARGS+= ....
 di> .else
 di> CONFIGURE_ARGS+= ....
 di> .endif
 
  Thank you for your report.  Could you test the patch found at
 
  http://people.allbsd.org/~hrs/FreeBSD/ghostscript_Makefile.driver_post.diff
 
  and let me know if the problem persists?
 
  This is based on your patch but "OPTIONS_FOO_DEFAULT==on" part is
  removed because the current code should define WITH_GS_${D} as
  ${OPTIONS_FOO_DEFAULT} in the !WITHOUT_GS_${D} case, and undefine
  WITH_GS_${D} in the WITHOUT_GS_${D} case.  Please correct me if I am
  wrong, anyway.
 
 -- Hiroki
 
 ----Security_Multipart(Mon_Aug__2_00_01_45_2010_341)--
 Content-Type: application/pgp-signature
 Content-Transfer-Encoding: 7bit
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.9 (FreeBSD)
 
 iEYEABECAAYFAkxVjFkACgkQTyzT2CeTzy1BXQCfQPgIdmK5secSrB/hefNW5XuG
 HNUAn3SlB7/TVhqKMyLwWNDyWH5CE/xr
 =xvIQ
 -----END PGP SIGNATURE-----
 
 ----Security_Multipart(Mon_Aug__2_00_01_45_2010_341)----

From: dirk.meyer@dinoex.sub.org (Dirk Meyer)
To: FreeBSD-gnats-submit@FreeBSD.org, hrs@FreeBSD.org (Hiroki Sato)
Cc:  
Subject: Re: ports/148960: [patch] print/ghostscript8 fails to
	suppport X
Date: Mon, 02 Aug 2010 04:49:05 +0200

 >  Thank you for your report.  Could you test the patch found at
 >  http://people.allbsd.org/~hrs/FreeBSD/ghostscript_Makefile.driver_post.diff
 >  and let me know if the problem persists?
 
 The patch was apllied, but the port did not build.
 The port included now the saved options from its slave port.
 
 < ===>  Extracting for ghostscript8-current-8.71_2
 ---
 > ===>  Found saved configuration for ghostscript8-nox11-8.71_2
 > ===>  Extracting for ghostscript8-hrs-8.71_2
 
 To fix this, the port might set:
 LATEST_LINK=	${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}
 
 After removing "/var/db/ports/ the port builds.
 
 The buildlog looks fine, as the ghostscript8 builds fine.
 
 kind regards Dirk
 
 - Dirk Meyer, Im Grund 4, 34317 Habichtswald, Germany
 - [dirk.meyer@dinoex.sub.org],[dirk.meyer@guug.de],[dinoex@FreeBSD.org]
 
 building ghostscript8.n11 looks good without any options set.
 
 diff of buildlog:
 
 < ===>  Extracting for ghostscript8-current-nox11-8.71_2
 ---
 > ===>  Extracting for ghostscript8-hrs-8.71_2
 12,25c12,27
 < /usr/bin/tar -C /data/image/usr/ports/current/ghostscript8-nox11/work/ghostscript-8.71 -xzf /usr/ports/distfiles/ghostscript/epag-3.09.tar.gz
 < /bin/ln -s -f epag-3.09 /data/image/usr/ports/current/ghostscript8-nox11/work/ghostscript-8.71/epag
 < install  -o root -g wheel -m 444 /usr/ports/current/ghostscript8-nox11/../ghostscript8/files/epag.contrib.mak /data/image/usr/ports/current/ghostscript8-nox11/work/ghostscript-8.71/base/epag.contrib.mak
 < ===>  Patching for ghostscript8-current-nox11-8.71_2
 < ===>  Applying FreeBSD patches for ghostscript8-current-nox11-8.71_2
 < /usr/bin/sed -i.bak -e 's|%%DATADIR%%|/usr/local/share/ghostscript|g ;  s|%%GS_VERSION%%|8.71|g'  /data/image/usr/ports/current/ghostscript8-nox11/work/ghostscript-8.71/contrib/japanese/dmp_site.ps
 < ===>   ghostscript8-current-nox11-8.71_2 depends on executable: gmake - found
 < ===>   ghostscript8-current-nox11-8.71_2 depends on shared library: jpeg.11 - found
 < ===>   ghostscript8-current-nox11-8.71_2 depends on shared library: png.6 - found
 < ===>   ghostscript8-current-nox11-8.71_2 depends on shared library: tiff.4 - found
 < ===>   ghostscript8-current-nox11-8.71_2 depends on shared library: cupsimage.2 - found
 < ===>   ghostscript8-current-nox11-8.71_2 depends on shared library: fontconfig.1 - found
 < ===>   ghostscript8-current-nox11-8.71_2 depends on shared library: iconv.3 - found
 < ===>  Configuring for ghostscript8-current-nox11-8.71_2
 ---
 > /usr/bin/tar -C /data/image/usr/ports/current/ghostscript8-hrs/work/ghostscript-8.71 -xzf /usr/ports/distfiles/ghostscript/epag-3.09.tar.gz
 > /bin/ln -s -f epag-3.09 /data/image/usr/ports/current/ghostscript8-hrs/work/ghostscript-8.71/epag
 > install  -o root -g wheel -m 444 /usr/ports/current/ghostscript8-hrs/files/epag.contrib.mak /data/image/usr/ports/current/ghostscript8-hrs/work/ghostscript-8.71/base/epag.contrib.mak
 > ===>  Patching for ghostscript8-hrs-8.71_2
 > ===>  Applying FreeBSD patches for ghostscript8-hrs-8.71_2
 > /usr/bin/sed -i.bak -e 's|%%DATADIR%%|/usr/local/share/ghostscript|g ;  s|%%GS_VERSION%%|8.71|g'  /data/image/usr/ports/current/ghostscript8-hrs/work/ghostscript-8.71/contrib/japanese/dmp_site.ps
 > ===>   ghostscript8-hrs-8.71_2 depends on executable: gmake - found
 > ===>   ghostscript8-hrs-8.71_2 depends on file: /usr/local/libdata/pkgconfig/xt.pc - found
 > ===>   ghostscript8-hrs-8.71_2 depends on file: /usr/local/libdata/pkgconfig/xext.pc - found
 > ===>   ghostscript8-hrs-8.71_2 depends on shared library: jpeg.11 - found
 > ===>   ghostscript8-hrs-8.71_2 depends on shared library: png.6 - found
 > ===>   ghostscript8-hrs-8.71_2 depends on shared library: tiff.4 - found
 > ===>   ghostscript8-hrs-8.71_2 depends on shared library: cupsimage.2 - found
 > ===>   ghostscript8-hrs-8.71_2 depends on shared library: fontconfig.1 - found
 > ===>   ghostscript8-hrs-8.71_2 depends on shared library: iconv.3 - found
 > ===>  Configuring for ghostscript8-hrs-8.71_2
 199c201,206
 < checking for X... no
 ---
 > checking for X... libraries , headers 
 > checking for gethostbyname... yes
 > checking for connect... yes
 > checking for remove... yes
 > checking for shmat... yes
 > checking for IceConnectionNumber in -lICE... yes
 279c286,295
 < checking for X... disabled
 ---
 > checking for X... libraries /usr/local/lib, headers /usr/local/include
 > checking whether -R must be followed by a space... no
 > checking for gethostbyname... yes
 > checking for connect... yes
 > checking for remove... yes
 > checking for shmat... yes
 > checking for IceConnectionNumber in -lICE... yes
 > checking for XOpenDisplay in -lX11... yes
 > checking for XdbeQueryExtension in -lXext... yes
 > checking for XtAppCreateShell in -lXt... yes
 
State-Changed-From-To: open->closed 
State-Changed-By: hrs 
State-Changed-When: Mon Aug 2 06:19:32 UTC 2010 
State-Changed-Why:  
Committed a fix.  Please let me know if you can find something 
wrong.  Thanks for the report! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=148960 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/148960: commit references a PR
Date: Mon,  2 Aug 2010 06:15:30 +0000 (UTC)

 hrs         2010-08-02 06:15:08 UTC
 
   FreeBSD ports repository
 
   Modified files:
     print/ghostscript8   Makefile 
     print/ghostscript8/files Makefile.drivers_post 
                              patch-base-gdevl256.c 
                              patch-base-gdevvglb.c 
   Added files:
     print/ghostscript8/files patch-base-configure.ac 
                              patch-base-sjpx.c 
   Log:
   - Fix compile errors when vgalib and lvga256 drivers are enabled.
   - Use external libraries instead of bundled old ones[1].
   - Fix WITHOUT_FOO handling[2].
   
   Submitted by:   mi[1], dinoex[2]
   PR:     ports/126513
   PR:     ports/148960
   
   Revision  Changes    Path
   1.199     +9 -4      ports/print/ghostscript8/Makefile
   1.3       +5 -5      ports/print/ghostscript8/files/Makefile.drivers_post
   1.1       +20 -0     ports/print/ghostscript8/files/patch-base-configure.ac (new)
   1.2       +15 -2     ports/print/ghostscript8/files/patch-base-gdevl256.c
   1.2       +15 -2     ports/print/ghostscript8/files/patch-base-gdevvglb.c
   1.1       +36 -0     ports/print/ghostscript8/files/patch-base-sjpx.c (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
