Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImageMagick formula does not install X11 delegate support #49082

Closed
2 of 4 tasks
tlk opened this issue Jan 16, 2020 · 6 comments
Closed
2 of 4 tasks

ImageMagick formula does not install X11 delegate support #49082

tlk opened this issue Jan 16, 2020 · 6 comments
Labels
outdated PR was locked due to age

Comments

@tlk
Copy link
Contributor

tlk commented Jan 16, 2020

  • ran brew update and can still reproduce the problem?
  • ran brew doctor, fixed all issues and can still reproduce the problem?
  • ran brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?
  • if brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?

What you were trying to do

Installing imagemagick with X11 support.

What happened

X11 is not supported. Please see relevant output below.

What you expected to happen

Imagemagick should be installed with X11 support when XQuartz is installed. The wizard window should show up to confirm that X11 support works.

Alternatively, the imagemagick formula could give hints on how to proceed in order to install imagemagick with X11 support. This would be helpful as there are many obsolete search results referring to the --with-x11 option. Would a PR for this be desired/accepted?

Step-by-step reproduction instructions

$ brew cask install xquartz
$ brew install imagemagick
$ display wizard: > /dev/null
display: delegate library support not built-in '' (X11) @ error/display.c/DisplayImageCommand/1877.
$

Related

@SMillerDev
Copy link
Member

X11 support on macOS is pretty terrible, the best/only way to have X11 support in imagick through brew is to maintain your own tap.

tlk added a commit to tlk/homebrew-imagemagick-x11 that referenced this issue Jan 16, 2020
@tlk
Copy link
Contributor Author

tlk commented Jan 16, 2020

Thanks! I have experimented with making a tap & formula. It is very likely that I missed something but this seems to work on Catalina:

# Install
brew cask install xquartz
brew tap tlk/imagemagick-x11
brew install tlk/imagemagick-x11/imagemagick

# Start X11
open /Applications/Utilities/XQuartz.app

# Show the ImageMagick wizard in a window
display wizard:

@fxcoudert
Copy link
Member

Can imagemagick support building with X11 such that: if X11 is present at runtime, it will be used, but if not present it will proceed without it?

@tlk
Copy link
Contributor Author

tlk commented Jan 20, 2020

That would be practical.

However, building ImageMagick with X11 support and then running it without X11 fails:

$ display wizard:
$ echo $?
0
$ brew cask uninstall xquartz
$ display wizard:
dyld: Library not loaded: /opt/X11/lib/libXext.6.dylib
  Referenced from: /usr/local/bin/display
  Reason: image not found
Abort trap: 6
$

Peeking at the source code it appears that X11 specific code is included at build-time.

Example from MagickCore/magick.c

#if defined(MAGICKCORE_X11_DELEGATE)
  (void) XComponentGenesis();
#endif

Perhaps the MAGICKCORE_X11_DELEGATE macro could be adjusted to include a runtime-check for X11 support.

@fxcoudert
Copy link
Member

Then the best way forward is to maintain the X11-version in a tap.

@tlk
Copy link
Contributor Author

tlk commented Jan 24, 2020

Ok, thanks. I just realized that the display command is not the best way to test if ImageMagick is functional without X, as one cannot expect that particular command to work without X.

For the sake of completeness here are the results of using the convert command with and without XQuartz installed:

$ convert wizard: wizard.png
$ file wizard.png
wizard.png: PNG image data, 480 x 640, 8-bit colormap, non-interlaced
$ brew cask uninstall xquartz
==> Uninstalling Cask xquartz
==> Removing launchctl service org.macosforge.xquartz.startx
==> Removing launchctl service org.macosforge.xquartz.privileged_startx
==> Uninstalling packages:
org.macosforge.xquartz.pkg
==> Removing files:
/opt/X11
/private/etc/manpaths.d/40-XQuartz
/private/etc/paths.d/40-XQuartz
==> Purging files for version 2.7.11 of Cask xquartz
$ convert wizard: wizard2.png
dyld: Library not loaded: /opt/X11/lib/libXext.6.dylib
  Referenced from: /usr/local/bin/convert
  Reason: image not found
Abort trap: 6
$

Same conclusion as before: building ImageMagick with X11 support and then running it without X11 fails.

@lock lock bot added the outdated PR was locked due to age label Feb 23, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Feb 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

No branches or pull requests

3 participants