Skip to contentSkip to conversation

package/imagemagick: add prompt for host variant

PATCH New yann.morin at orange.com 3 participants 5 messages Feb 19, 2019 – Jun 23, 2019 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 2/3 package/imagemagick: add prompt for host variant

From: "Yann E. MORIN" <[email protected]>

Sometimes, it is required to call imagemagick from a posr-build script or the likes, so we have to allow the user to enable the host variant for imagemagick.

Update the linux package to select the host variant now.

---
 linux/Config.in                    |  1 +
 package/Config.in.host             |  1 +
 package/imagemagick/Config.in.host | 13 +++++++++++++
 3 files changed, 15 insertions(+)
 create mode 100644 package/imagemagick/Config.in.host
linux/Config.in +1 -0
index 323ba38d72..8466332dfe 100644
@@ -2,6 +2,7 @@ menu "Kernel"
 
 config BR2_LINUX_KERNEL
 	bool "Linux Kernel"
+	select BR2_PACKAGE_HOST_IMAGEMAGICK if BR2_LINUX_KERNEL_CUSTOM_LOGO_PATH != ""
 	help
 	  Enable this option if you want to build a Linux kernel for
 	  your embedded device
package/Config.in.host +1 -0
index b4c501a33b..48f4f7e61d 100644
@@ -27,6 +27,7 @@ menu "Host utilities"
 	source "package/go-bootstrap/Config.in.host"
 	source "package/google-breakpad/Config.in.host"
 	source "package/gptfdisk/Config.in.host"
+	source "package/imagemagick/Config.in.host"
 	source "package/imx-mkimage/Config.in.host"
 	source "package/imx-usb-loader/Config.in.host"
 	source "package/jq/Config.in.host"
package/imagemagick/Config.in.host new file +13 -0
new file mode 100644
index 0000000000..b6d2a379f8
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_HOST_IMAGEMAGICK
+	bool "host-imagemagick"
+	help
+	  ImageMagick(R) is a software suite to create, edit, and
+	  compose bitmap images. It can read, convert and write images
+	  in a variety of formats (about 100) including DPX, EXR, GIF,
+	  JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, and TIFF.
+	  Use ImageMagick to translate, flip, mirror, rotate, scale,
+	  shear and transform images, adjust image colors, apply various
+	  special effects, or draw text, lines, polygons, ellipses and
+	  B?zier curves.
+
+	  http://www.imagemagick.org/
Signature · 15 lines
2.17.1


_________________________________________________________________________________________________________________________

Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.
#2 lore raw

PATCH 2/3 package/imagemagick: add prompt for host variant

Hello,

linux/Config.in menu "Kernel" · line 5

Quoted 9 lines · On Tue, 19 Feb 2019 14:15:29 +0100 <[email protected]> wrote:
linux/Config.in +1 -0
index 323ba38d72..8466332dfe 100644
@@ -2,6 +2,7 @@ menu "Kernel"
 
 config BR2_LINUX_KERNEL
 	bool "Linux Kernel"
+	select BR2_PACKAGE_HOST_IMAGEMAGICK if BR2_LINUX_KERNEL_CUSTOM_LOGO_PATH != ""

We don't really consistently select the option of host packages. For example, pkgconf has a host option, and we clearly don't select from all the packages that have a dependency on host-pkgconf.

But well, it doesn't hurt to do so, especially in this case where there's only one location which selects host-imagemagick.

linux/Config.in menu "Kernel" · line 6

Quoted 1 line
linux/Config.in +1 -0
+	bool "host-imagemagick"

We use "host foo" as the prompt for host packages and not "host-foo", so I tweaked this.

Applied, thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH 3/3 package/imagemagick: add optional SVG support to host variant

In reply to a message not in the archive

From: "Yann E. MORIN" <[email protected]>

SVG can be regarded as the "source code" for assets, like logos or other graphical elements.

However, SVG needs to be rendered, which requires an XML parser and an SVG "parser/rendered". As such, it has various runtime impacts, like bad performance or security. As such, SVG are often pre-rendered to the required sizes/depths/resolutions into other format, such as PNG, at build time.

While rsvg-convert (from host-librsvg) would allow the rendering, it does not allow more complex tasks taht ImageMagick allows for:
compositing more than one image, 2D transforamtions (rotation, skew...).

Yet, SVG support in ImageMagick relies on librsvg, which adds quite a feq dependencies, and thus has a noticeable impact on the build time.

Add an option to allow concerned users to enable/disable SVG suppot in ImageMagick.

Enabling SVG support relies on librsvg, which in turns relies on a few additional packages that ImageMagick can also optionally use. So, autoamtically enable the corresponding support as well.

---
 package/imagemagick/Config.in.host | 13 +++++++++++++
 package/imagemagick/imagemagick.mk | 28 +++++++++++++++++++++++-----
 2 files changed, 36 insertions(+), 5 deletions(-)
package/imagemagick/Config.in.host +13 -0
index b6d2a379f8..bcb7e0d703 100644
@@ -11,3 +11,16 @@ config BR2_PACKAGE_HOST_IMAGEMAGICK
 	  B?zier curves.
 
 	  http://www.imagemagick.org/
+
+if BR2_PACKAGE_HOST_IMAGEMAGICK
+
+config BR2_PACKAGE_HOST_IMAGEMAGICK_SVG
+	bool "SVG support"
+	help
+	  Say 'y' here is you need ImageMagick tools (like convert)
+	  to support SVG.
+
+	  This is not enabled by default, as it brings quite a few
+	  extra dependencies, and thus extra build time.
+
+endif
package/imagemagick/imagemagick.mk +23 -5
index 7678980582..0fbf479523 100644
@@ -160,15 +160,10 @@ HOST_IMAGEMAGICK_CONF_OPTS = \
 	--without-x \
 	--without-bzlib \
 	--without-fftw \
-	--without-fontconfig \
-	--without-freetype \
 	--without-lcms \
 	--without-lzma \
-	--without-pango \
-	--without-rsvg \
 	--without-tiff \
 	--without-webp \
-	--without-xml \
 	--with-jpeg \
 	--with-png \
 	--with-zlib
@@ -179,5 +174,28 @@ HOST_IMAGEMAGICK_DEPENDENCIES = \
 	host-pkgconf \
 	host-zlib
 
+ifeq ($(BR2_PACKAGE_HOST_IMAGEMAGICK_SVG),y)
+HOST_IMAGEMAGICK_DEPENDENCIES += \
+	host-fontconfig \
+	host-freetype \
+	host-librsvg \
+	host-libxml2 \
+	host-pango
+HOST_IMAGEMAGICK_CONF_ENV += ac_cv_path_xml2_config=$(HOST_DIR)/bin/xml2-config
+HOST_IMAGEMAGICK_CONF_OPTS += \
+	--with-fontconfig \
+	--with-freetype \
+	--with-pango \
+	--with-rsvg \
+	--with-xml
+else
+HOST_IMAGEMAGICK_CONF_OPTS += \
+	--without-fontconfig \
+	--without-freetype \
+	--without-pango \
+	--without-rsvg \
+	--without-xml
+endif
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
Signature · 15 lines
2.17.1


_________________________________________________________________________________________________________________________

Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.
#4 lore raw

PATCH 3/3 package/imagemagick: add optional SVG support to host variant

Quoted 25 lines · On Tue, 19 Feb 2019 14:15:30 +0100 <[email protected]> wrote:

From: "Yann E. MORIN" <[email protected]>

SVG can be regarded as the "source code" for assets, like logos or other graphical elements.

However, SVG needs to be rendered, which requires an XML parser and an SVG "parser/rendered". As such, it has various runtime impacts, like bad performance or security. As such, SVG are often pre-rendered to the required sizes/depths/resolutions into other format, such as PNG, at build time.

While rsvg-convert (from host-librsvg) would allow the rendering, it does not allow more complex tasks taht ImageMagick allows for:
compositing more than one image, 2D transforamtions (rotation, skew...).

Yet, SVG support in ImageMagick relies on librsvg, which adds quite a feq dependencies, and thus has a noticeable impact on the build time.

Add an option to allow concerned users to enable/disable SVG suppot in ImageMagick.

Enabling SVG support relies on librsvg, which in turns relies on a few additional packages that ImageMagick can also optionally use. So, autoamtically enable the corresponding support as well.

Quoted 5 lines
---
 package/imagemagick/Config.in.host | 13 +++++++++++++
 package/imagemagick/imagemagick.mk | 28 +++++++++++++++++++++++-----
 2 files changed, 36 insertions(+), 5 deletions(-)

Applied to master after fixing the various typos in the commit log, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#5 lore raw

PATCH 3/3 package/imagemagick: add optional SVG support to host variant

Thomas, All,

On 2019-06-23 18:01 +0200, Thomas Petazzoni spake thusly:

Quoted 5 lines
Quoted 3 lines · On Tue, 19 Feb 2019 14:15:30 +0100 <[email protected]> wrote:

From: "Yann E. MORIN" <[email protected]>
SVG can be regarded as the "source code" for assets, like logos or other graphical elements.

[--SNIP--]

Quoted 2 lines

Applied to master after fixing the various typos in the commit log, thanks.

It looks like my alter-ego has the same love for typoes as I do. ;-)

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'