Bug 194284

Summary: [PATCH] security/p5-GD-SecurityImage: handle OPTIONS_UNSET=X11
Product: Ports & Packages Reporter: Frank Wall <freebsd>
Component: Individual Port(s)Assignee: freebsd-perl (Nobody) <perl>
Status: Closed FIXED    
Severity: Affects Only Me CC: florian.heigl, freebsd, pi
Priority: --- Flags: freebsd: maintainer-feedback? (perl)
Version: Latest   
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
patch security/p5-GD-SecurityImage
none
updated patch
none
revised patch none

Description Frank Wall 2014-10-10 13:40:30 UTC
Created attachment 148164 [details]
patch security/p5-GD-SecurityImage

Attached patch adds a check to use the -nox11 version of ImageMagick if OPTIONS_UNSET=X11 is set.
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2014-10-10 13:40:30 UTC
Auto-assigned to maintainer perl@FreeBSD.org
Comment 2 florian.heigl 2014-12-22 01:58:59 UTC
Also ran into this with poudriere...

The patch works, could it please get reviewed / submitted?
Comment 3 Frank Wall 2014-12-22 15:20:52 UTC
Created attachment 150852 [details]
updated patch
Comment 4 Frank Wall 2014-12-22 15:22:09 UTC
As pointed out in a similar bug report (#194283) my original patch was incomplete. I've submitted a new patch.
Comment 5 Mathieu Arnold freebsd_committer freebsd_triage 2014-12-22 15:25:31 UTC
(In reply to Frank Wall from comment #4)
> As pointed out in a similar bug report (#194283) my original patch was
> incomplete. I've submitted a new patch.

It will not work.  Options helpers must be defined before bsd.port.options.mk is included.

You should do something along the lines of:

.if ${PORT_OPTIONS:MIMAGEMAGICK}
.if ${PORT_OPTIONS:MX11}
BUILD_DEPENDS+= ${LOCALBASE}/bin/convert:${PORTSDIR}/graphics/ImageMagick
RUN_DEPENDS+=   ${LOCALBASE}/bin/convert:${PORTSDIR}/graphics/ImageMagick
.else
BUILD_DEPENDS+= ${LOCALBASE}/bin/convert:${PORTSDIR}/graphics/ImageMagick-nox11
RUN_DEPENDS+=   ${LOCALBASE}/bin/convert:${PORTSDIR}/graphics/ImageMagick-nox11
.endif
.endif
Comment 6 Frank Wall 2014-12-22 15:39:36 UTC
Created attachment 150853 [details]
revised patch
Comment 7 Frank Wall 2014-12-22 15:41:36 UTC
(In reply to Mathieu Arnold from comment #5)
> It will not work.  Options helpers must be defined before
> bsd.port.options.mk is included.

Of course, thanks.
Comment 8 Kurt Jaeger freebsd_committer freebsd_triage 2014-12-22 16:32:07 UTC
X11 depends on IMAGEMAGICK being set, right ? There is no use in X11
being set and IMAGEMAGICK not ?
Comment 9 Frank Wall 2014-12-22 16:37:28 UTC
(In reply to Kurt Jaeger from comment #8)
> X11 depends on IMAGEMAGICK being set, right ? There is no use in X11
> being set and IMAGEMAGICK not ?

Exactly.
Comment 10 commit-hook freebsd_committer freebsd_triage 2014-12-22 16:54:04 UTC
A commit references this bug:

Author: pi
Date: Mon Dec 22 16:53:58 UTC 2014
New revision: 375246
URL: https://svnweb.freebsd.org/changeset/ports/375246

Log:
  security/p5-GD-SecurityImage: knob to allow correct DEPENDS for IMAGEMAGICK

  Allow to select X11 with IMAGEMAGICK (manually).

  PR:		194284
  Submitted by:	Frank WAll <fw@moov.de>

Changes:
  head/security/p5-GD-SecurityImage/Makefile
Comment 11 Kurt Jaeger freebsd_committer freebsd_triage 2014-12-22 16:57:50 UTC
While the patch works (and is committed now), there is a general issue still
unresolved:

- the ports options scheme should have a knob that conditionally sets
  one option in relation to some other knob
- even better would be if a knob of one port (here: the X11 knob of the
  ImageMagick port) could be inherited in some other port (here: p5-GD-SecurityImage)
Comment 12 Mathieu Arnold freebsd_committer freebsd_triage 2014-12-22 17:21:48 UTC
(In reply to Kurt Jaeger from comment #11)
> While the patch works (and is committed now), there is a general issue still
> unresolved:
> 
> - the ports options scheme should have a knob that conditionally sets
>   one option in relation to some other knob
> - even better would be if a knob of one port (here: the X11 knob of the
>   ImageMagick port) could be inherited in some other port (here:
> p5-GD-SecurityImage)

Patches to Mk/bsd.options.mk *are* welcome :-)