emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Autodetect imagemagick on macOS + Homebrew


From: Charles A. Roelli
Subject: Re: Autodetect imagemagick on macOS + Homebrew
Date: Mon, 15 Jan 2018 20:42:41 +0100

> Date: Wed, 10 Jan 2018 21:37:50 +0000
> From: Alan Third <address@hidden>
> 
> When imagemagick 6 is installed on macOS using Homebrew it can be a
> bit of a faff to get Emacs built with it. The attached patch
> automatically adds it to PKG_CONFIG_PATH if Homebrew is detected.
> -- 
> Alan Third
> 
> >From d5d4fdf1478acb87dc046ec367e4f8ad1e095e76 Mon Sep 17 00:00:00 2001
> From: Alan Third <address@hidden>
> Date: Tue, 9 Jan 2018 23:47:56 +0000
> Subject: [PATCH] Allow configure to find Homebrew installed imagemagick
> 
> * configure.ac: Add the imagemagick pkgconfig dir to pkg-config's
> search path.
> ---
>  configure.ac | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index c574d7dd0d..32ade3e95c 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1269,10 +1269,10 @@ AC_DEFUN
>  
>  # Makeinfo on macOS is ancient, check whether there is a more recent
>  # version installed by Homebrew.
> -AC_CHECK_PROG(HAVE_BREW, [brew], [yes])
> -if test -n "$HAVE_BREW"; then
> +AC_CHECK_PROGS(BREW, [brew])
> +if test -n "$BREW"; then
>    AC_PATH_PROG([MAKEINFO], [makeinfo], [],
> -    [`brew --prefix texinfo 2>/dev/null`/bin$PATH_SEPARATOR$PATH])
> +    [`$BREW --prefix texinfo 2>/dev/null`/bin$PATH_SEPARATOR$PATH])
>  fi
>  
>  ## Require makeinfo >= 4.13 (last of the 4.x series) to build the manuals.
> @@ -2529,6 +2529,12 @@ AC_DEFUN
>  HAVE_IMAGEMAGICK=no
>  if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" || test 
> "${HAVE_W32}" = "yes"; then
>    if test "${with_imagemagick}" != "no"; then
> +    if test -n "$BREW"; then
> +      # Homebrew doesn't link ImageMagick 6 by default, so make sure
> +      # pkgconfig can find it.
> +      export PKG_CONFIG_PATH="$PKG_CONFIG_PATH$PATH_SEPARATOR`$BREW --prefix 
> address@hidden 2>/dev/null`/lib/pkgconfig"
> +    fi
> +
>      ## 6.3.5 is the earliest version known to work; see Bug#17339.
>      ## 6.8.2 makes Emacs crash; see Bug#13867.
>      ## 7 and later have not been ported to; See Bug#25967.
> -- 
> 2.14.3

Thanks for looking into this.  When I tried "brew" last time, I
remember running into a similar problem in this area.

That said, isn't this a problem that should be fixed in the package
manager?  Why does "brew" not place ImageMagick's pkg-config file
where they are usually stored?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]