Bug 201864 - textproc/docproj: broken due to ghostscript / tex-dvips
Summary: textproc/docproj: broken due to ghostscript / tex-dvips
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Document Engineering Group (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-25 00:44 UTC by Peter Wemm
Modified: 2015-08-26 21:29 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (doceng)


Attachments
Fix _GS_PORT for consumers of ghostscript (815 bytes, patch)
2015-07-27 04:57 UTC, Peter Wemm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Wemm freebsd_committer freebsd_triage 2015-07-25 00:44:51 UTC
The docproj port is failing to build on the freebsd.org cluster:

[11-amd64-cluster-default-job-01] Extracting ghostscript9-nox11-9.06_10: .......... done
Message for ghostscript9-nox11-9.06_10:
Note: in order to use the script "dvipdf", dvips must be installed.
This program is provided by another package print/tex-dvipsk.

FAPIfontmap and FAPIcidfmap in /usr/local/share/ghostscript/9.06/Resource/Init
have to be configured if you want to use FAPI feature.
===>   peps-2.0_5 depends on file: ghostscript9>=0 - not found
*** Error code 1

Stop.
make: stopped in /usr/ports/graphics/peps

It looks like there is an undeclared dependency.
Comment 1 Koop Mast freebsd_committer freebsd_triage 2015-07-25 12:15:56 UTC
This is probably caused by my work on the ghostscript support in the ports framework.

I assume OPTIONS_UNSET=X11 is used and this worked before rev 392322?

As a work around please set WITHOUT_X11=1 together with the OPTIONS_UNSET.

The ghostscript uses isn't port OPTIONS aware. Neither was the old ghostscript code in Mk/bsd.port.mk. So I'm curious if this broke due to myself or that it didn't work to start with.
Comment 2 commit-hook freebsd_committer freebsd_triage 2015-07-27 01:19:42 UTC
A commit references this bug:

Author: hrs
Date: Mon Jul 27 01:18:55 UTC 2015
New revision: 392952
URL: https://svnweb.freebsd.org/changeset/ports/392952

Log:
  - Fix -nox11 packages and ghostscript:nox11 in ghostscript.mk.
    This also fixes an issue that user-defined OPTIONS_UNSET was overridden.

  - Loosen up depdendency a bit by using a binary instead of a package name.

  PR:	201864

Changes:
  head/Mk/Uses/ghostscript.mk
  head/print/ghostscript7-nox11/Makefile
  head/print/ghostscript8-nox11/Makefile
  head/print/ghostscript9-agpl-nox11/Makefile
  head/print/ghostscript9-nox11/Makefile
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-07-27 01:25:44 UTC
A commit references this bug:

Author: hrs
Date: Mon Jul 27 01:25:17 UTC 2015
New revision: 392953
URL: https://svnweb.freebsd.org/changeset/ports/392953

Log:
  Use OPTIONS_UNSET_FORCE instead of WITHOUT_X11.

  PR:	201864

Changes:
  head/textproc/docproj/Makefile
Comment 4 Peter Wemm freebsd_committer freebsd_triage 2015-07-27 01:31:13 UTC
I think the last commit 392953 is going to be a problem.  WITHOUT_X11 is not equivalent to UNSET += X11 due to Mk/Uses/ghostscript.mk

ghostscript.mk ONLY uses WITHOUT_X11
Comment 5 Peter Wemm freebsd_committer freebsd_triage 2015-07-27 01:32:46 UTC
Oops, never mind, I missed the change to ghostscript.mk above.
Comment 6 Peter Wemm freebsd_committer freebsd_triage 2015-07-27 01:35:12 UTC
Hmm, no, something is wrong.  The ports switched from the ghostscript-nox11 variant to plain ghostscript.

..
[00:00:15] ====>> Checking packages for incremental rebuild needed
[00:00:16] ====>> Deleting ImageMagick-nox11-6.9.1.9,1.txz: new dependency: print/ghostscript9
[00:00:17] ====>> Deleting docproj-2.0_3.txz: new dependency: print/ghostscript9
..

These previously depended on print/ghostscript9-nox11.
Comment 7 Peter Wemm freebsd_committer freebsd_triage 2015-07-27 01:48:41 UTC
Mk/Uses/ghostscript.mk r392952 is definitely a problem.  The change has broken how non-ghostscript ports select which variant (-nox11 or not) of the package to depend on.

before:
.if ${_GS_ARGS:Mnox11} || defined(WITHOUT_X11) 	 
_GS_NOX11_SUFFIX=       -nox11 	 
.endif 	 
_GS_PORT=       ghostscript${_GS_SELECTED}${_GS_AGPL_SUFFIX}${_GS_NOX11_SUFFIX}

after:
_GS_PORT=       ghostscript${_GS_SELECTED}${_GS_AGPL_SUFFIX}  	 
.if ${_GS_ARGS:Mnox11}
DEPENDS_ARGS+=  print_${_GS_PORT}_UNSET_FORCE+=X11
.endif

This does something entirely different to what it's supposed to do.  For example, the "graphics/peps" port has an X11 option.  If enabled, it depends on print/ghostscript9.  If X11 in graphics/peps is disabled, it depends on print/ghostscript9-nox11.

The ghostscript.mk change in r392952 completely breaks this.  Code was removed that *other* ports used, and was replaced with build configurations for ghostscript itself.
Comment 8 commit-hook freebsd_committer freebsd_triage 2015-07-27 04:13:56 UTC
A commit references this bug:

Author: hrs
Date: Mon Jul 27 04:13:30 UTC 2015
New revision: 392955
URL: https://svnweb.freebsd.org/changeset/ports/392955

Log:
  Fix the case when X11 option is defined and not specified in the parent port.

  PR:	201864

Changes:
  head/Mk/Uses/ghostscript.mk
Comment 9 Peter Wemm freebsd_committer freebsd_triage 2015-07-27 04:51:37 UTC
Unfortunately, Uses/ghostscript.mk is still selecting the wrong _GS_PORT even with 392955.

A replacement for this block of removed code is missing:
.if ${_GS_ARGS:Mnox11} || defined(WITHOUT_X11) 	 
_GS_NOX11_SUFFIX=       -nox11 	 
.endif 	 
_GS_PORT=       ghostscript${_GS_SELECTED}${_GS_AGPL_SUFFIX}${_GS_NOX11_SUFFIX}

You can see the effect of this by turning off X11 in graphics/peps, and doing a 'make -V _GS_PORT' in graphics/peps and seeing that ghostscript.mk has selected the wrong variant.
Comment 10 Peter Wemm freebsd_committer freebsd_triage 2015-07-27 04:56:25 UTC
root@overcee:/home/peter/fbsvn-ports/head/graphics/peps # make -V PORT_OPTIONS
  DOCS EXAMPLES IPV6 NLS X11
root@overcee:/home/peter/fbsvn-ports/head/graphics/peps # make -V _GS_PORT
ghostscript9
root@overcee:/home/peter/fbsvn-ports/head/graphics/peps # make config
.... turn off X11 ...
root@overcee:/home/peter/fbsvn-ports/head/graphics/peps # make -V PORT_OPTIONS
  DOCS EXAMPLES IPV6 NLS
root@overcee:/home/peter/fbsvn-ports/head/graphics/peps # make -V _GS_PORT
ghostscript9

I've fixed it for us, see attachment.
Comment 11 Peter Wemm freebsd_committer freebsd_triage 2015-07-27 04:57:41 UTC
Created attachment 159295 [details]
Fix _GS_PORT for consumers of ghostscript

This restores the functionality broken in r392952
Comment 12 Peter Wemm freebsd_committer freebsd_triage 2015-07-27 05:00:46 UTC
After that patch:

root@overcee:/home/peter/fbsvn-ports/head/graphics/peps # make -V _GS_PORT
ghostscript9
root@overcee:/home/peter/fbsvn-ports/head/graphics/peps # make -V PORT_OPTIONS
  DOCS EXAMPLES IPV6 NLS X11
root@overcee:/home/peter/fbsvn-ports/head/graphics/peps # make config
... turned X11 off ...
root@overcee:/home/peter/fbsvn-ports/head/graphics/peps # make -V PORT_OPTIONS
  DOCS EXAMPLES IPV6 NLS
root@overcee:/home/peter/fbsvn-ports/head/graphics/peps # make -V _GS_PORT
ghostscript9-nox11

With this functionality restored, things like "graphics/peps" will depend on print/ghostscript9-nox11, and print/ghostscript9-nox11 will build with UNSET_FORCE+=X11
Comment 13 Peter Wemm freebsd_committer freebsd_triage 2015-07-27 17:58:35 UTC
Even after r392958, the following change was needed to get the cluster ports tree to build:

Index: ghostscript.mk
===================================================================
--- ghostscript.mk      (revision 392988)
+++ ghostscript.mk      (working copy)
@@ -88,7 +88,7 @@
 _GS_PORT=      ghostscript${_GS_SELECTED}${_GS_AGPL_SUFFIX}${_GS_NOX11_SUFFIX}
 
 .undef _GS_NOX11_SUFFIX
-.if ${_GS_ARGS:Mnox11} || \
+.if ${_GS_ARGS:Mnox11} || defined(WITHOUT_X11) || \
     (defined(OPTIONS_DEFINE) && defined(PORT_OPTIONS) && \
      ${OPTIONS_DEFINE:MX11} && ${PORT_OPTIONS:MX11} == "")
 # XXX

This was in the attached patch but wasn't included in r392958.

texlive-base doesn't have an X11 option so it causes a build conflict between print/ghostscript9 and print/ghostscript9-nox11.

I am getting the feeling that the -nox11 thing is more trouble than it is worth.
Comment 14 Peter Wemm freebsd_committer freebsd_triage 2015-08-26 21:29:32 UTC
The recent ghostscript changes solve this.