Bug 190434 - print/cups-base tries to build icons when building headless
Summary: print/cups-base tries to build icons when building headless
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: Kurt Jaeger
URL:
Keywords:
Depends on: 207746
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-30 23:40 UTC by Hernan Freschi
Modified: 2016-03-11 12:04 UTC (History)
3 users (show)

See Also:


Attachments
cups-base.diff (1022 bytes, patch)
2016-02-13 18:01 UTC, Tobias Kortkamp
no flags Details | Diff
cups-base.diff (1.23 KB, patch)
2016-02-13 18:10 UTC, Tobias Kortkamp
no flags Details | Diff
cups-base.diff (1.02 KB, patch)
2016-02-13 22:29 UTC, Tobias Kortkamp
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hernan Freschi 2014-05-30 23:40:00 UTC
When compiling print/cups-base, if WITHOUT_X11=yes is present in /etc/make.conf, CUPS still tries to update the "Icons cache". For this, it tries to build graphics/gtk-update-icon-cache, which in turns requires graphics/cairo, but Cairo builds without X11 support as requested, and graphics/gtk-update-icon-cache fails to build because it needs X11.

How-To-Repeat: 1. Add WITHOUT_X11=yes to /etc/make.conf
2. build print/cups-base with default options

It will fail building at graphics/gtk-update-icon-cache.
Comment 1 John Marino freebsd_committer freebsd_triage 2014-07-22 20:02:00 UTC
This port is unmaintained, so providing a patch would help
Comment 2 Tobias Kortkamp freebsd_committer freebsd_triage 2016-02-13 17:35:23 UTC
cups-base builds the icons because the ICONS options is enabled by default.  Disabling that option will prevent building of icons and related ports.  IMHO this bug can be closed.

These are the build dependencies that are added with ICONS:
< /usr/ports/accessibility/atk
< /usr/ports/devel/glib20
< /usr/ports/graphics/gdk-pixbuf2
< /usr/ports/graphics/gtk-update-icon-cache
< /usr/ports/x11-toolkits/pango
Comment 3 Kurt Jaeger freebsd_committer freebsd_triage 2016-02-13 17:38:54 UTC
Can the cups-base port detect the WITHOUT_X11 and disable ICONS ?
Comment 4 Tobias Kortkamp freebsd_committer freebsd_triage 2016-02-13 17:44:51 UTC
(In reply to Kurt Jaeger from comment #3)
This feels wrong to me because cups had no direct dependency on X11 and the graphics/gtk-update-icon-cache is a build dependency only.  Why should it care about WITHOUT_X11?

That being said I could try adding a check for this if you think this is the way to go here.
Comment 5 Kurt Jaeger freebsd_committer freebsd_triage 2016-02-13 17:59:57 UTC
I agree that it sounds strange, but the WITHOUT_X11 case causes the build to break, so if we can detect WITHOUT_X11 and disable ICONS, it avoids the break.
Comment 6 Tobias Kortkamp freebsd_committer freebsd_triage 2016-02-13 18:01:39 UTC
Created attachment 166935 [details]
cups-base.diff

Disable default option ICONS when using WITHOUT_X11
Comment 7 Tobias Kortkamp freebsd_committer freebsd_triage 2016-02-13 18:10:15 UTC
Created attachment 166936 [details]
cups-base.diff

Updated patch to refuse to compile when both ICONS and WITHOUT_X11 are set.
Comment 8 Kurt Jaeger freebsd_committer freebsd_triage 2016-02-13 21:34:20 UTC
(In reply to Tobias Kortkamp from comment #6)
bsd.sanity.mk has

#WARNING+=      "WITHOUT_X11 is deprecated use X11 option instead"

so maybe we need a X11-option in the port, and combine it with ICONS ?
Comment 9 Tobias Kortkamp freebsd_committer freebsd_triage 2016-02-13 22:29:22 UTC
Created attachment 166959 [details]
cups-base.diff

Replaced the ICONS option with X11.

I also experimented with introducing a X11 option and setting ICONS_IMPLIES=X11, X11_IMPLIES=ICONS etc, but this just seems to add noise to the port for no real gain AFAICT.
Comment 10 commit-hook freebsd_committer freebsd_triage 2016-02-13 22:36:25 UTC
A commit references this bug:

Author: pi
Date: Sat Feb 13 22:35:49 UTC 2016
New revision: 408833
URL: https://svnweb.freebsd.org/changeset/ports/408833

Log:
  print/cups-base: rename ICONS option to X11

  Why this change ?
  - When compiling print/cups-base, if WITHOUT_X11=yes is present in
    /etc/make.conf, CUPS still tries to update the "Icons cache".
  - For this, it tries to build graphics/gtk-update-icon-cache,
    which in turns requires graphics/cairo, but Cairo builds without
    X11 support as requested, and graphics/gtk-update-icon-cache
    fails to build because it needs X11.

  PR:		190434
  Submitted by:	Tobias Kortkamp <t@tobik.me>
  Reported by:	hjf@hjf.com.ar

Changes:
  head/print/cups-base/Makefile
Comment 11 Kurt Jaeger freebsd_committer freebsd_triage 2016-02-13 22:36:34 UTC
Committed, thanks.
Comment 12 commit-hook freebsd_committer freebsd_triage 2016-02-14 05:34:52 UTC
A commit references this bug:

Author: pi
Date: Sun Feb 14 05:34:25 UTC 2016
New revision: 408845
URL: https://svnweb.freebsd.org/changeset/ports/408845

Log:
  print/cups-base: revert change for ICONS option

  - This does not really solve the problem

  PR:		190434
  Pointy hat to:	pi

Changes:
  head/print/cups-base/Makefile
Comment 13 commit-hook freebsd_committer freebsd_triage 2016-02-14 05:35:54 UTC
A commit references this bug:

Author: pi
Date: Sun Feb 14 05:35:34 UTC 2016
New revision: 408846
URL: https://svnweb.freebsd.org/changeset/ports/408846

Log:
  print/cups-base: bump port revision

  PR:		190434
  Pointy hat to:	pi

Changes:
  head/print/cups-base/Makefile
Comment 14 Kurt Jaeger freebsd_committer freebsd_triage 2016-02-14 05:40:53 UTC
This needs more thought and testing.
Comment 15 Kurt Jaeger freebsd_committer freebsd_triage 2016-02-14 05:52:19 UTC
Changing ICONS -> X11 would still build graphics/gtk-update-icon-cache with
the WITHOUT_X11 from /etc/make.conf and would still break.

So this is not a working approach.
Comment 16 Tobias Kortkamp freebsd_committer freebsd_triage 2016-03-02 20:06:45 UTC
Having just learned about OPTIONS_EXCLUDE I think we could add
> .if defined(WITHOUT_X11)
> OPTIONS_EXCLUDE=        ICONS
> .endif
to the port.  Or in addition to the ICONS -> X11 change:
> .if defined(WITHOUT_X11)
> OPTIONS_EXCLUDE=        X11
> .endif
this would solve all problems, no?
Comment 17 Tijl Coosemans freebsd_committer freebsd_triage 2016-03-11 12:04:13 UTC
Fixed in ports r410825.