All of lore.kernel.org
 help / color / mirror / Atom feed
* [scarthgap][PATCHv2] imagemagick: guard sed operations in do_install for optional files
@ 2025-06-02 11:51 Sana Kazi
  2025-06-03  8:27 ` [oe] " Gyorgy Sarvari
  0 siblings, 1 reply; 3+ messages in thread
From: Sana Kazi @ 2025-06-02 11:51 UTC (permalink / raw)
  To: openembedded-devel

When PACKAGECONFIG options like 'cxx' 'webp' and 'xml' are disabled,
certain files such as Magick++-config.im7, configure.xml, or
delegates.xml are not installed. Unconditionally running sed
on these files results in errors during do_install
Error:
sed: can't read .../image/usr/bin/Magick++-config.im7: No such file or directory

Signed-off-by: Nikhil R <nikhilr5@kpit.com>
Signed-off-by: Sana Kazi <sanakazi720@gmail.com>
---
 .../imagemagick/imagemagick_7.1.1.bb          | 23 ++++++++++++++-----
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/meta-oe/recipes-support/imagemagick/imagemagick_7.1.1.bb b/meta-oe/recipes-support/imagemagick/imagemagick_7.1.1.bb
index 5407c4e400..752fef303b 100644
--- a/meta-oe/recipes-support/imagemagick/imagemagick_7.1.1.bb
+++ b/meta-oe/recipes-support/imagemagick/imagemagick_7.1.1.bb
@@ -36,13 +36,24 @@ PACKAGECONFIG[x11] = "--with-x,--without-x,virtual/libx11 libxext libxt"
 PACKAGECONFIG[xml] = "--with-xml,--without-xml,libxml2"
 
 do_install:append:class-target() {
-    for file in MagickCore-config.im7 MagickWand-config.im7 Magick++-config.im7; do
-        sed -i 's,${STAGING_DIR_TARGET},,g' ${D}${bindir}/"$file"
+    for file in MagickCore-config.im7 MagickWand-config.im7; do
+        sed -i 's,${STAGING_DIR_TARGET},,g' "${D}${bindir}/$file"
     done
-    sed -i 's,${S},,g' ${D}${libdir}/ImageMagick-${BASE_PV}/config-Q16HDRI/configure.xml
-    sed -i 's,${B},,g' ${D}${libdir}/ImageMagick-${BASE_PV}/config-Q16HDRI/configure.xml
-    sed -i 's,${RECIPE_SYSROOT},,g' ${D}${libdir}/ImageMagick-${BASE_PV}/config-Q16HDRI/configure.xml
-    sed -i 's,${HOSTTOOLS_DIR},${bindir},g' ${D}${sysconfdir}/ImageMagick-7/delegates.xml
+
+    if ${@bb.utils.contains('PACKAGECONFIG', 'cxx', 'true', 'false', d)}; then
+        sed -i 's,${STAGING_DIR_TARGET},,g' "${D}${bindir}/Magick++-config.im7"
+    fi
+
+    if ${@bb.utils.contains('PACKAGECONFIG', 'xml', 'true', 'false', d)}; then
+        xml_config="${D}${libdir}/ImageMagick-${BASE_PV}/config-Q16HDRI/configure.xml"
+        sed -i 's,${S},,g' "$xml_config"
+        sed -i 's,${B},,g' "$xml_config"
+        sed -i 's,${RECIPE_SYSROOT},,g' "$xml_config"
+    fi
+
+    if ${@bb.utils.contains_any('PACKAGECONFIG', 'webp openjpeg', 'true', 'false', d)}; then
+        sed -i 's,${HOSTTOOLS_DIR},${bindir},g' "${D}${sysconfdir}/ImageMagick-7/delegates.xml"
+    fi
 }
 
 FILES:${PN} += "${libdir}/ImageMagick-${BASE_PV}/config-Q16* \
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [oe] [scarthgap][PATCHv2] imagemagick: guard sed operations in do_install for optional files
  2025-06-02 11:51 [scarthgap][PATCHv2] imagemagick: guard sed operations in do_install for optional files Sana Kazi
@ 2025-06-03  8:27 ` Gyorgy Sarvari
  2025-06-18  5:16   ` nikhil
  0 siblings, 1 reply; 3+ messages in thread
From: Gyorgy Sarvari @ 2025-06-03  8:27 UTC (permalink / raw)
  To: sanakazi720, openembedded-devel

At the first sight it looks like this would be useful for master branch
too - do you think you could send a patch for that also?

As a separate note, maybe checking if the files themselves exist
(instead of checking the pkgconfig values) would be more explicit -
though that's more like a random thought, and I don't have strong
feelings about this.

On 6/2/25 13:51, Sana Kazi via lists.openembedded.org wrote:
> When PACKAGECONFIG options like 'cxx' 'webp' and 'xml' are disabled,
> certain files such as Magick++-config.im7, configure.xml, or
> delegates.xml are not installed. Unconditionally running sed
> on these files results in errors during do_install
> Error:
> sed: can't read .../image/usr/bin/Magick++-config.im7: No such file or directory
>
> Signed-off-by: Nikhil R <nikhilr5@kpit.com>
> Signed-off-by: Sana Kazi <sanakazi720@gmail.com>
> ---
>  .../imagemagick/imagemagick_7.1.1.bb          | 23 ++++++++++++++-----
>  1 file changed, 17 insertions(+), 6 deletions(-)
>
> diff --git a/meta-oe/recipes-support/imagemagick/imagemagick_7.1.1.bb b/meta-oe/recipes-support/imagemagick/imagemagick_7.1.1.bb
> index 5407c4e400..752fef303b 100644
> --- a/meta-oe/recipes-support/imagemagick/imagemagick_7.1.1.bb
> +++ b/meta-oe/recipes-support/imagemagick/imagemagick_7.1.1.bb
> @@ -36,13 +36,24 @@ PACKAGECONFIG[x11] = "--with-x,--without-x,virtual/libx11 libxext libxt"
>  PACKAGECONFIG[xml] = "--with-xml,--without-xml,libxml2"
>  
>  do_install:append:class-target() {
> -    for file in MagickCore-config.im7 MagickWand-config.im7 Magick++-config.im7; do
> -        sed -i 's,${STAGING_DIR_TARGET},,g' ${D}${bindir}/"$file"
> +    for file in MagickCore-config.im7 MagickWand-config.im7; do
> +        sed -i 's,${STAGING_DIR_TARGET},,g' "${D}${bindir}/$file"
>      done
> -    sed -i 's,${S},,g' ${D}${libdir}/ImageMagick-${BASE_PV}/config-Q16HDRI/configure.xml
> -    sed -i 's,${B},,g' ${D}${libdir}/ImageMagick-${BASE_PV}/config-Q16HDRI/configure.xml
> -    sed -i 's,${RECIPE_SYSROOT},,g' ${D}${libdir}/ImageMagick-${BASE_PV}/config-Q16HDRI/configure.xml
> -    sed -i 's,${HOSTTOOLS_DIR},${bindir},g' ${D}${sysconfdir}/ImageMagick-7/delegates.xml
> +
> +    if ${@bb.utils.contains('PACKAGECONFIG', 'cxx', 'true', 'false', d)}; then
> +        sed -i 's,${STAGING_DIR_TARGET},,g' "${D}${bindir}/Magick++-config.im7"
> +    fi
> +
> +    if ${@bb.utils.contains('PACKAGECONFIG', 'xml', 'true', 'false', d)}; then
> +        xml_config="${D}${libdir}/ImageMagick-${BASE_PV}/config-Q16HDRI/configure.xml"
> +        sed -i 's,${S},,g' "$xml_config"
> +        sed -i 's,${B},,g' "$xml_config"
> +        sed -i 's,${RECIPE_SYSROOT},,g' "$xml_config"
> +    fi
> +
> +    if ${@bb.utils.contains_any('PACKAGECONFIG', 'webp openjpeg', 'true', 'false', d)}; then
> +        sed -i 's,${HOSTTOOLS_DIR},${bindir},g' "${D}${sysconfdir}/ImageMagick-7/delegates.xml"
> +    fi
>  }
>  
>  FILES:${PN} += "${libdir}/ImageMagick-${BASE_PV}/config-Q16* \
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#117705): https://lists.openembedded.org/g/openembedded-devel/message/117705
> Mute This Topic: https://lists.openembedded.org/mt/113426936/6084445
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [skandigraun@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [scarthgap][PATCHv2] imagemagick: guard sed operations in do_install for optional files
  2025-06-03  8:27 ` [oe] " Gyorgy Sarvari
@ 2025-06-18  5:16   ` nikhil
  0 siblings, 0 replies; 3+ messages in thread
From: nikhil @ 2025-06-18  5:16 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 74 bytes --]

can this be integrated now? as it is already integrated in master branch

[-- Attachment #2: Type: text/html, Size: 85 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-18  5:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-02 11:51 [scarthgap][PATCHv2] imagemagick: guard sed operations in do_install for optional files Sana Kazi
2025-06-03  8:27 ` [oe] " Gyorgy Sarvari
2025-06-18  5:16   ` nikhil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.