Skip to contentSkip to conversation

webp: switch recipe to cmake buildsystem

RFC PATCH Markus Volk 3 participants 5 messages Jan 9, 2024 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Tested this to be working with just oe-core layers (poky and nodistro) with glibc and musl for x86_64, aarch64 rpi and qemuarm. Still this is quite invasive and one can have strong opinions about cmake, so i marked it RFC

Quoted 91 lines · Markus Volk

Besides the improvements that cmake offers compared to autotools, the advantage would be that cmake config files get created. This is useful so that other projects can find webp using cmake.

Remove EXTRA_OECONF settings because all of them are set like this by default.

CMakeLists.txt doesn't provide an option for selecting neon but from what I have tested it gets selected properly.

Downside is that there is no way to deactivate gif,jpeg,tiff,png or opengl. The libraries are used whenever they are pulled into the sysroot.

Signed-off-by Markus Volk <[email protected] <mailto:[email protected]>>
---
 meta/recipes-multimedia/webp/libwebp_1.3.2.bb | 35 
+++++--------------
 1 file changed, 9 insertions(+), 26 deletions(-)
meta/recipes-multimedia/webp/libwebp_1.3.2.bb +0 -0
index 63b0fd9a6c..c6a4b97884 100644
@@ -18,40 +18,23 @@ SRC_URI[sha256sum] = 

"2a499607df669e40258e53d0ade8035ba4ec0175244869d1025d460562

UPSTREAM_CHECK_URI =
"<http://downloads.webmproject.org/releases/webp/index.html>"

meta/recipes-multimedia/webp/libwebp_1.3.2.bb +1 -10
-EXTRA_OECONF = " \
-    --disable-wic \
-    --enable-libwebpmux \
-    --enable-libwebpdemux \
-    --enable-threading \
-"
+EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON"
 
-# Do not trust configure to determine if neon is available.
-#
-EXTRA_OECONF_ARM = " \
-    ${@bb.utils.contains 

<mailto:${@bb.utils.contains>("TUNE_FEATURES","neon","--enable-neon","--disable-neon",d)} \
-"

meta/recipes-multimedia/webp/libwebp_1.3.2.bb +0 -8
-EXTRA_OECONF:append:arm = " ${EXTRA_OECONF_ARM}"
-EXTRA_OECONF:append:armeb = " ${EXTRA_OECONF_ARM}"
-
-inherit autotools lib_package
-
-PACKAGECONFIG ??= ""
-
-# libwebpdecoder is a subset of libwebp, don't build it unless 

requested
-PACKAGECONFIG[decoder] = "--enable-libwebpdecoder,--disable-libwebpdecoder"

meta/recipes-multimedia/webp/libwebp_1.3.2.bb +7 -6
+inherit cmake lib_package
 
+PACKAGECONFIG ?= ""
 # Apply for examples programs: cwebp and dwebp
-PACKAGECONFIG[gif] = "--enable-gif,--disable-gif,giflib"
-PACKAGECONFIG[jpeg] = "--enable-jpeg,--disable-jpeg,jpeg"
-PACKAGECONFIG[png] = "--enable-png,--disable-png,,libpng"
-PACKAGECONFIG[tiff] = "--enable-tiff,--disable-tiff,tiff"
-
+PACKAGECONFIG[gif] = ",,giflib"
+PACKAGECONFIG[jpeg] = ",,jpeg"
+PACKAGECONFIG[png] = ",,libpng"
+PACKAGECONFIG[tiff] = ",,tiff"
 # Apply only for example program vwebp
-PACKAGECONFIG[gl] = "--enable-gl,--disable-gl,mesa-glut"
+PACKAGECONFIG[opengl] = ",,mesa-glut"
 
 PACKAGES =+ "${PN}-gif2webp"
 
 DESCRIPTION:${PN}-gif2webp = "Simple tool to convert animated GIFs 

to WebP"
FILES:${PN}-gif2webp = "${bindir}/gif2webp"

+FILES:${PN} += "${datadir}"
BBCLASSEXTEND += "native nativesdk"
--
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#193456): <https://lists.openembedded.org/g/openembedded-core/message/193456>
Mute This Topic: <https://lists.openembedded.org/mt/103619059/3618223>
Group Owner: [email protected] <mailto:[email protected]>
Unsubscribe: <https://lists.openembedded.org/g/openembedded-core/unsub> [[email protected] <mailto:[email protected]>]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw

Whatever strong opinions one has about cmake, opinions about autotools are stronger still. It's not super controversial to say, we would rather switch away from it whenever possible, and so have many other upstream projects. Everyone but GNU, basically.

So I'm all for your patch, and loss of image format options shouln't matter, as I can't imagine why one would want to cherry-pick them.

Alex

Quoted 19 lines · Markus Volk

Tested this to be working with just oe-core layers (poky and nodistro) with glibc and musl for x86_64, aarch64 rpi and qemuarm. Still this is quite invasive and one can have strong opinions about cmake, so i marked it RFC

On Tue, Jan 9 2024 at 02:28:26 PM +01:00:00, Markus Volk <[email protected]> wrote:

Besides the improvements that cmake offers compared to autotools, the advantage would be that cmake config files get created. This is useful so that other projects can find webp using cmake. Remove EXTRA_OECONF settings because all of them are set like this by default. CMakeLists.txt doesn't provide an option for selecting neon but from what I have tested it gets selected properly. Downside is that there is no way to deactivate gif,jpeg,tiff,png or opengl. The libraries are used whenever they are pulled into the sysroot. Signed-off-by: Markus Volk <[email protected]> --- meta/recipes-multimedia/webp/libwebp_1.3.2.bb | 35 +++++-------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/meta/recipes-multimedia/webp/libwebp_1.3.2.bb b/meta/recipes-multimedia/webp/libwebp_1.3.2.bb index 63b0fd9a6c..c6a4b97884 100644 --- a/meta/recipes-multimedia/webp/libwebp_1.3.2.bb +++ b/meta/recipes-multimedia/webp/libwebp_1.3.2.bb @@ -18,40 +18,23 @@ SRC_URI[sha256sum] = "2a499607df669e40258e53d0ade8035ba4ec0175244869d1025d460562 UPSTREAM_CHECK_URI = "http://downloads.webmproject.org/releases/webp/index.html" -EXTRA_OECONF = " \ - --disable-wic \ - --enable-libwebpmux \ - --enable-libwebpdemux \ - --enable-threading \ -" +EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON" -# Do not trust configure to determine if neon is available. -# -EXTRA_OECONF_ARM = " \ - ${@bb.utils.contains("TUNE_FEATURES","neon","--enable-neon","--disable-neon",d)} \ -" -EXTRA_OECONF:append:arm = " ${EXTRA_OECONF_ARM}" -EXTRA_OECONF:append:armeb = " ${EXTRA_OECONF_ARM}" - -inherit autotools lib_package - -PACKAGECONFIG ??= "" - -# libwebpdecoder is a subset of libwebp, don't build it unless requested -PACKAGECONFIG[decoder] = "--enable-libwebpdecoder,--disable-libwebpdecoder" +inherit cmake lib_package +PACKAGECONFIG ?= "" # Apply for examples programs: cwebp and dwebp -PACKAGECONFIG[gif] = "--enable-gif,--disable-gif,giflib" -PACKAGECONFIG[jpeg] = "--enable-jpeg,--disable-jpeg,jpeg" -PACKAGECONFIG[png] = "--enable-png,--disable-png,,libpng" -PACKAGECONFIG[tiff] = "--enable-tiff,--disable-tiff,tiff" - +PACKAGECONFIG[gif] = ",,giflib" +PACKAGECONFIG[jpeg] = ",,jpeg" +PACKAGECONFIG[png] = ",,libpng" +PACKAGECONFIG[tiff] = ",,tiff" # Apply only for example program vwebp -PACKAGECONFIG[gl] = "--enable-gl,--disable-gl,mesa-glut" +PACKAGECONFIG[opengl] = ",,mesa-glut" PACKAGES =+ "${PN}-gif2webp" DESCRIPTION:${PN}-gif2webp = "Simple tool to convert animated GIFs to WebP" FILES:${PN}-gif2webp = "${bindir}/gif2webp" +FILES:${PN} += "${datadir}" BBCLASSEXTEND += "native nativesdk" --
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#193457): https://lists.openembedded.org/g/openembedded-core/message/193457
Mute This Topic: https://lists.openembedded.org/mt/103619059/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw
In reply to Markus Volk

Is upstream also switching to use cmake as primary build system ?

Quoted 62 lines · Markus Volk

Tested this to be working with just oe-core layers (poky and nodistro) with glibc and musl for x86_64, aarch64 rpi and qemuarm.
Still this is quite invasive and one can have strong opinions about cmake, so i marked it RFC

On Tue, Jan 9 2024 at 02:28:26 PM +01:00:00, Markus Volk < [email protected]> wrote:

Besides the improvements that cmake offers compared to autotools, the advantage would be that cmake config files get created. This is useful so that other projects can find webp using cmake. Remove EXTRA_OECONF settings because all of them are set like this by default. CMakeLists.txt doesn't provide an option for selecting neon but from what I have tested it gets selected properly. Downside is that there is no way to deactivate gif,jpeg,tiff,png or opengl. The libraries are used whenever they are pulled into the sysroot. Signed-off-by: Markus Volk <[email protected]> --- meta/recipes-multimedia/webp/libwebp_1.3.2.bb | 35 +++++-------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/meta/recipes-multimedia/webp/libwebp_1.3.2.bb b/meta/recipes-multimedia/webp/libwebp_1.3.2.bb index 63b0fd9a6c..c6a4b97884 100644 --- a/meta/recipes-multimedia/webp/ libwebp_1.3.2.bb +++ b/meta/recipes-multimedia/webp/libwebp_1.3.2.bb @@ -18,40 +18,23 @@ SRC_URI[sha256sum] = "2a499607df669e40258e53d0ade8035ba4ec0175244869d1025d460562 UPSTREAM_CHECK_URI = "
http://downloads.webmproject.org/releases/webp/index.html" -EXTRA_OECONF = " \ - --disable-wic \ - --enable-libwebpmux \ - --enable-libwebpdemux \ - --enable-threading \ -" +EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON" -# Do not trust configure to determine if neon is available. -# -EXTRA_OECONF_ARM = " \ - ${@bb.utils.contains("TUNE_FEATURES","neon","--enable-neon","--disable-neon",d)} \ -" -EXTRA_OECONF:append:arm = " ${EXTRA_OECONF_ARM}" -EXTRA_OECONF:append:armeb = " ${EXTRA_OECONF_ARM}" - -inherit autotools lib_package - -PACKAGECONFIG ??= "" - -# libwebpdecoder is a subset of libwebp, don't build it unless requested -PACKAGECONFIG[decoder] = "--enable-libwebpdecoder,--disable-libwebpdecoder" +inherit cmake lib_package +PACKAGECONFIG ?= "" # Apply for examples programs: cwebp and dwebp -PACKAGECONFIG[gif] = "--enable-gif,--disable-gif,giflib"

(quoted diff) +2 -3
-PACKAGECONFIG[jpeg] = "--enable-jpeg,--disable-jpeg,jpeg"
-PACKAGECONFIG[png] = "--enable-png,--disable-png,,libpng"
-PACKAGECONFIG[tiff] = "--enable-tiff,--disable-tiff,tiff" -
+PACKAGECONFIG[gif] = ",,giflib" +PACKAGECONFIG[jpeg] = ",,jpeg"
+PACKAGECONFIG[png] = ",,libpng" +PACKAGECONFIG[tiff] = ",,tiff" # Apply

only for example program vwebp -PACKAGECONFIG[gl] = "--enable-gl,--disable-gl,mesa-glut" +PACKAGECONFIG[opengl] = ",,mesa-glut" PACKAGES =+ "${PN}-gif2webp" DESCRIPTION:${PN}-gif2webp = "Simple tool to convert animated GIFs to WebP" FILES:${PN}-gif2webp = "${bindir}/gif2webp" +FILES:${PN} += "${datadir}" BBCLASSEXTEND += "native nativesdk" --
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#193457):
https://lists.openembedded.org/g/openembedded-core/message/193457
Mute This Topic: https://lists.openembedded.org/mt/103619059/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#4 lore raw
Quoted 1 line · Khem Raj

Is upstream also switching to use cmake as primary build system ?

If you are speaking of chromeOS, I bet they use cmake

I had a look at what linux distributions do. Archlinux and Fedora use the cmake build system and also Debian provides the cmake config files in sid
<https://packages.debian.org/sid/alpha/libwebp-dev/filelist>

#5 lore raw
Quoted 10 lines · Markus Volk

On Tue, Jan 9 2024 at 08:38:32 AM -08:00:00, Khem Raj <[email protected]> wrote:

Is upstream also switching to use cmake as primary build system ?

If you are speaking of chromeOS, I bet they use cmake

I had a look at what linux distributions do. Archlinux and Fedora use the cmake build system and also Debian provides the cmake config files in sid
https://packages.debian.org/sid/alpha/libwebp-dev/filelist

OK that should be good enough reason for us to see that we can use cmake too.