Bug 148960 - [patch] print/ghostscript8 fails to suppport X
Summary: [patch] print/ghostscript8 fails to suppport X
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Document Engineering Group (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-26 13:10 UTC by dirk.meyer
Modified: 2010-08-02 07:30 UTC (History)
0 users

See Also:


Attachments
file.diff (1.57 KB, patch)
2010-07-26 13:10 UTC, dirk.meyer
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description dirk.meyer 2010-07-26 13:10:04 UTC
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

Fix: apply the patch to fix most of the problems:
How-To-Repeat: 
ghostview fails to display any files,
reporting "Unknown device: x11"

to confirm ghostscript does not list x11 with:
gs -h
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2010-07-26 13:10:29 UTC
Responsible Changed
From-To: freebsd-ports-bugs->doceng

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Hiroki Sato freebsd_committer freebsd_triage 2010-08-01 16:01:45 UTC
----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)----
Comment 3 dirk.meyer 2010-08-02 03:49:05 UTC
>  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
Comment 4 dfilter service freebsd_committer freebsd_triage 2010-08-02 07:15:30 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"
Comment 5 Hiroki Sato freebsd_committer freebsd_triage 2010-08-02 07:19:32 UTC
State Changed
From-To: open->closed

Committed a fix.  Please let me know if you can find something 
wrong.  Thanks for the report!