Closed mmattel closed 3 years ago
--build-dir should do the trick.
hmmm,
--prefix="$BUILD_DIR"
from https://imagemagick.org/script/resources.php
$PREFIX/etc/ImageMagick-7
The environmental variable $PREFIX is the default install path (e.g. /usr/local)
It does not read to me as configuration path though... (install <> configuration)
And in the script you do a VERIFY_INSTALLATION=$("$BUILD_DIR/bin/magick"
means $BUILD_DIR
cant be the config directory...
Just wondering: Is there a specific reason, why you want to have it installed elsewhere?
Misunderstanding, it is not about installing it at a different location but setting the config directory. At Ubuntu with imagick version 6, the config directory is /etc/ImageMagic-6,means the base directory is / and not /usr/local.
I don't think, that you can set the configuration directory exclusively. It depends on the install path (which is /usr/local
by default). Setting it to /
would install the configuration in /etc
, but install the binaries in /bin
.
I think I found the solution, you may need to add an additional option with a default. Looking into the configure script and with the help of an answered question in the ImageMagic repo, here are my findings:
the configure scripts suggest the configure option "--sysconfdir=DIR"
Taking a look to the ImageMagic configure file:
at line 4751 eval "eval SYSCONF_DIR=$sysconfdir"
at line 33127 CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
Which is exactly the path of the configuration files ImageMagic is looking at when you use it, see my comments above. Again, it is not about a different installation, but a defined configuration location.
The default option when not defined should be "/etc" and the option must therefore always be handed over to the configure script, which then defaults to /etc and creates /etc/ImageMagic-7. Without setting the option and hand it over to the configure script, it will be set to $BUILD_DIR which creates /usr/local/etc/ImageMagick-7/
Note, install location and config location can be set independently, see the configure script.
(Pls note, that I have made some text changes in the comment above to reflect my test below.)
I gave the thing a try to see if it fixes the issue. For this I changed your imei.sh script to:
cd "ImageMagick-$IMAGEMAGICK_VER" &&
./configure \
--prefix="$BUILD_DIR" \
--sysconfdir="/etc" \
and run sudo ./imei.sh --no-sig-verify --force
Here is the result running:
magick identify -list configure | grep CONFIGURE_PATH
before: CONFIGURE_PATH /usr/local/etc/ImageMagick-7/
after: CONFIGURE_PATH /etc/ImageMagick-7/
:white_check_mark:
The ImageMagick-7 folder with the default config files has been created as expected :white_check_mark:
whereis magick
before: /usr/local/bin/magick
:white_check_mark:
after: /usr/local/bin/magick
:white_check_mark:
Hopefully this convinces you to add this additional script parameter which defaults to /etc 😄
Great 👍 Thanks a lot!
@SoftCreatR is it possible to define the
CONFIGURE_PATH
in the build process as parameter?convert -list configure | grep "ImageMagick-6"
Default with the U18.04/20.04, this is
/etc/ImageMagick-6/
But when running a build with your script, you get/usr/local/etc/ImageMagick-7/
It would be great if this could be defined