Patchwork imagemagick: fix Magick[++|Core|Wand]-config

login
register
mail settings
Submitter Stefan Fröberg
Date Jan. 3, 2013, 10:09 p.m.
Message ID <1357250947-23296-5-git-send-email-stefan.froberg@petroprogram.com>
Download mbox | patch
Permalink /patch/209324/
State Changes Requested
Headers show

Comments

Stefan Fröberg - Jan. 3, 2013, 10:09 p.m.
Signed-off-by: Stefan Fröberg <stefan.froberg@petroprogram.com>
---
 package/imagemagick/imagemagick.mk |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
Peter Korsgaard - Jan. 4, 2013, 9:45 p.m.
>>>>> "Stefan" == Stefan Fröberg <stefan.froberg@petroprogram.com> writes:

 Stefan> Signed-off-by: Stefan Fröberg <stefan.froberg@petroprogram.com>
 Stefan> ---
 Stefan>  package/imagemagick/imagemagick.mk |   19 +++++++++++++++++++
 Stefan>  1 files changed, 19 insertions(+), 0 deletions(-)

 Stefan> diff --git a/package/imagemagick/imagemagick.mk b/package/imagemagick/imagemagick.mk
 Stefan> index 0476ace..00aa81f 100644
 Stefan> --- a/package/imagemagick/imagemagick.mk
 Stefan> +++ b/package/imagemagick/imagemagick.mk
 Stefan> @@ -119,6 +119,25 @@ define IMAGEMAGICK_REMOVE_CONFIG_SCRIPTS
 Stefan>  		     Magick MagickCore MagickWand Wand Magick++))
 Stefan>  endef
 
 Stefan> +define IMAGEMAGICK_STAGING_IMAGEMAGICK_CONFIG_FIXUP
 Stefan> +	$(SED) "s,^prefix=.*,prefix=\'$(STAGING_DIR)/usr\',g" $(STAGING_DIR)/usr/bin/Magick-config
 Stefan> +	$(SED) "s,^exec_prefix=.*,exec_prefix=\'$(STAGING_DIR)/usr\',g" $(STAGING_DIR)/usr/bin/Magick-config


It's nicer to change the file with a single sed (-e) invocation, instead
of two.

 Stefan> +
 Stefan> +	$(SED) "s,^prefix=.*,prefix=\'$(STAGING_DIR)/usr\',g" $(STAGING_DIR)/usr/bin/Magick++-config

Some of these files only gets installed if certainly packages /
toolchain configurations are enabled, so the build fails with errors
like:

/bin/sed: can't read /home/peko/source/buildroot/test/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/bin/Magick++-config: No such file or directory

So you need to check if the files exist first.

Patch

diff --git a/package/imagemagick/imagemagick.mk b/package/imagemagick/imagemagick.mk
index 0476ace..00aa81f 100644
--- a/package/imagemagick/imagemagick.mk
+++ b/package/imagemagick/imagemagick.mk
@@ -119,6 +119,25 @@  define IMAGEMAGICK_REMOVE_CONFIG_SCRIPTS
 		     Magick MagickCore MagickWand Wand Magick++))
 endef
 
+define IMAGEMAGICK_STAGING_IMAGEMAGICK_CONFIG_FIXUP
+	$(SED) "s,^prefix=.*,prefix=\'$(STAGING_DIR)/usr\',g" $(STAGING_DIR)/usr/bin/Magick-config
+	$(SED) "s,^exec_prefix=.*,exec_prefix=\'$(STAGING_DIR)/usr\',g" $(STAGING_DIR)/usr/bin/Magick-config
+
+	$(SED) "s,^prefix=.*,prefix=\'$(STAGING_DIR)/usr\',g" $(STAGING_DIR)/usr/bin/Magick++-config
+	$(SED) "s,^exec_prefix=.*,exec_prefix=\'$(STAGING_DIR)/usr\',g" $(STAGING_DIR)/usr/bin/Magick++-config
+
+	$(SED) "s,^prefix=.*,prefix=\'$(STAGING_DIR)/usr\',g" $(STAGING_DIR)/usr/bin/MagickCore-config
+	$(SED) "s,^exec_prefix=.*,exec_prefix=\'$(STAGING_DIR)/usr\',g" $(STAGING_DIR)/usr/bin/MagickCore-config
+
+	$(SED) "s,^prefix=.*,prefix=\'$(STAGING_DIR)/usr\',g" $(STAGING_DIR)/usr/bin/MagickWand-config
+	$(SED) "s,^exec_prefix=.*,exec_prefix=\'$(STAGING_DIR)/usr\',g" $(STAGING_DIR)/usr/bin/MagickWand-config
+
+	$(SED) "s,^prefix=.*,prefix=\'$(STAGING_DIR)/usr\',g" $(STAGING_DIR)/usr/bin/Wand-config
+	$(SED) "s,^exec_prefix=.*,exec_prefix=\'$(STAGING_DIR)/usr\',g" $(STAGING_DIR)/usr/bin/Wand-config
+endef
+
+IMAGEMAGICK_POST_INSTALL_STAGING_HOOKS += IMAGEMAGICK_STAGING_IMAGEMAGICK_CONFIG_FIXUP
+
 ifneq ($(BR2_HAVE_DEVFILES),y)
 IMAGEMAGICK_POST_INSTALL_TARGET_HOOKS += IMAGEMAGICK_REMOVE_CONFIG_SCRIPTS
 endif