Bug 274634 - graphics/ImageMagick7: nox11 flavor pulls X11 dependencies
Summary: graphics/ImageMagick7: nox11 flavor pulls X11 dependencies
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-desktop (Team)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-21 18:15 UTC by Andrew
Modified: 2026-04-10 19:29 UTC (History)
5 users (show)

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


Attachments
Exclude X11-related options in nox11 flavor (284 bytes, patch)
2023-10-21 18:15 UTC, Andrew
no flags Details | Diff
configure output (29.47 KB, text/plain)
2023-11-08 10:43 UTC, Andrew
no flags Details
ImageMagick7 Makefile (9.62 KB, text/plain)
2023-11-09 19:41 UTC, Andrew
no flags Details
ImageMagick7 showconfig (1.64 KB, text/plain)
2023-11-09 19:43 UTC, Andrew
no flags Details
Makefile with ffmpeg-nox11 support (559 bytes, patch)
2026-04-08 09:43 UTC, Andrew
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew 2023-10-21 18:15:18 UTC
Created attachment 245786 [details]
Exclude X11-related options in nox11 flavor

The latest version of this port builds a lot of X11 dependencies even with its nox11 flavor. The problem was fixed in #239156, and this patch applies the same fix.
Comment 1 Henrik Hudson 2023-11-06 21:47:39 UTC
I could be reading it wrong, but the current port doesn't even include PANGO, RAQM or SVG unless the x11 flavor is defined. They're not in the default list of defined options nor are they enabled.

That being said, my ImageMagick7@nox11 poudriere build started pulling in X11 dependencies, so there is something going on.
Comment 2 Henrik Hudson 2023-11-06 22:26:36 UTC
For me at least disabling the HEIF support stopped pulling in X11. Looking at the libheif options the defaults definitely cascade to a lot of ports that have X requirements, but I didn't look super close. 

I would think removing HEIF from the main OPTIONS_DEFINE and OPTIONS_DEFAULTS and adding it to the x11 section and the 2 additional OPTIONS_DEFINE and OPTIONS_DEFAULTS would be good.
Comment 3 Andrew 2023-11-08 10:43:07 UTC
Created attachment 246193 [details]
configure output

(In reply to Henrik Hudson from comment #2)
Thanks Henrik, I just tried again: I did a "rmconfig" and disabled the HEIF option, but that didn't prevent the X11 dependencies. I'm compiling on FreeBSD releng/12.4, following Ports branch 2023Q4 (commit d9fea2b9cb23).

I also attached the output of the "configure" step. Here you can read that, for example, PANGO is still listed as dependency (I do not know why).
Comment 4 Henrik Hudson 2023-11-08 16:59:46 UTC
What config options do you have set? What's your Makefile?
Comment 5 Andrew 2023-11-09 19:41:58 UTC
Created attachment 246219 [details]
ImageMagick7 Makefile

(In reply to Henrik Hudson from comment #4)
Here is the Makefile (not modified by the patch)
Comment 6 Andrew 2023-11-09 19:43:30 UTC
Created attachment 246220 [details]
ImageMagick7 showconfig

(In reply to Henrik Hudson from comment #4)
And here are the port's options I selected. Thank for your help.
Comment 7 Andrew 2024-10-16 16:59:59 UTC
The same problem persist for me with 2024Q4 on releng/13.4. I still need the proposed patch to avoid adding the following list of unnecessary Ports.

New packages to be INSTALLED:
        cairo: 1.17.4_2,3
        fribidi: 1.0.15
        graphite2: 1.3.14
        harfbuzz: 10.0.1
        libXau: 1.0.11
        libXdmcp: 1.1.5
        libdatrie: 0.2.13_2
        libraqm: 0.10.1
        libthai: 0.1.29_1
        libxcb: 1.17.0
        pango: 1.52.2_1                                                                   
        pixman: 0.42.2                                                                    
        xorgproto: 2024.1
Comment 8 Alexander Vereeken freebsd_triage 2024-10-28 20:40:41 UTC
Dear Andrew,

the patch keyword is deprecated.

Your patch is visible to the community though the patch flag that is set for your patch file.

Thank you.
Comment 10 Poul-Henning Kamp freebsd_committer freebsd_triage 2026-04-05 06:31:44 UTC
Is the problem simply that the -nox11 variant still pulls ffmpeg, rather than ffmpeg-nox11 ?
Comment 11 Andrew 2026-04-08 08:32:59 UTC
(In reply to Poul-Henning Kamp from comment #10)
I just built the nox11 flavor from the 2026Q1 branch on releng/14.4 with default options and it didn't bring any X11 related port anymore, thus I think it's OK to close this PR.didn't bring any X11 related port anymore, thus I think it's OK to close this PR.
Comment 12 Poul-Henning Kamp freebsd_committer freebsd_triage 2026-04-08 09:08:47 UTC
That's not what I see:

  root@fbsd:~ # freebsd-version
  15.0-RELEASE-p5
  root@fbsd:~ # pkg install ImageMagick7-nox11
  [...]
  The following 147 package(s) will be affected (of 0 checked):
 
  New packages to be INSTALLED:
          ImageMagick7-nox11: 7.1.2.16 [FreeBSD-ports]
          [...]
          ffmpeg: 8.1,1 [FreeBSD-ports]
          [...]
          libX11: 1.8.13,1 [FreeBSD-ports]
          libXScrnSaver: 1.2.4_1 [FreeBSD-ports]
          libXau: 1.0.12 [FreeBSD-ports]
          libXcursor: 1.2.3 [FreeBSD-ports]
          libXdamage: 1.1.6 [FreeBSD-ports]
          libXdmcp: 1.1.5 [FreeBSD-ports]
          libXext: 1.3.6,1 [FreeBSD-ports]
          libXfixes: 6.0.1 [FreeBSD-ports]
          libXft: 2.3.8 [FreeBSD-ports]
          libXi: 1.8.2,1 [FreeBSD-ports]
          libXrandr: 1.5.4 [FreeBSD-ports]
          libXrender: 0.9.12 [FreeBSD-ports]
          libXt: 1.3.0,1 [FreeBSD-ports]
          libXv: 1.0.13,1 [FreeBSD-ports]
          libXxf86vm: 1.1.6 [FreeBSD-ports]
          [...]
          xorgproto: 2024.1 [FreeBSD-ports]
          [...]
 
I am pretty sure that ffmpeg is the culprit, I think it should be ffmpeg-nox11
Comment 13 Andrew 2026-04-08 09:43:31 UTC
Created attachment 269491 [details]
Makefile with ffmpeg-nox11 support

(In reply to Poul-Henning Kamp from comment #12)
You're right but, since the FFMPEG option is not listed in OPTIONS_DEFAULT, I do not know why the package in the official FreeBSD repository has those dependencies. In fact in my custom built repo does not make you install them:

# freebsd-version
14.4-RELEASE-p1
# pkg install -r myrepo -n ImageMagick7-nox11 | grep -E 'lib|Number'
	giflib: 5.2.2 [myrepo]
	glib: 2.84.4,2 [myrepo]
	libdeflate: 1.25 [myrepo]
	libffi: 3.5.1 [myrepo]
	libfontenc: 1.1.8 [myrepo]
	libgd: 2.3.3_13,1 [myrepo]
	libheif: 1.19.8_6 [myrepo]
	libidn: 1.43 [myrepo]
	libinotify: 20240724_3 [myrepo]
	libjxl: 0.11.1_2 [myrepo]
	liblqr-1: 0.4.2 [myrepo]
	libltdl: 2.5.4 [myrepo]
	libpaper: 1.1.28_1 [myrepo]
	libraw: 0.21.5 [myrepo]
	libwmf-nox11: 0.2.13_2 [myrepo]
	libxml2: 2.14.6 [myrepo]
	libzip: 1.11.4 [myrepo]
Number of packages to be installed: 52

However the attached patch should fix the problem.
Comment 14 commit-hook freebsd_committer freebsd_triage 2026-04-10 19:29:34 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3f200d1cfd37b63cd5f20d1a74cecc4221f855be

commit 3f200d1cfd37b63cd5f20d1a74cecc4221f855be
Author:     Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2026-04-10 19:26:45 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2026-04-10 19:28:48 +0000

    graphics/ImageMagick7: Depend on ffmpeg-nox11 if FLAVOR==nox11

    PR:             274634

 graphics/ImageMagick7/Makefile | 5 +++++
 1 file changed, 5 insertions(+)