diff mbox series

[RFC] RFC: import libxmlb and appstream from meta-oe

Message ID 20230908130407.2676-1-f_l_k@t-online.de
State New
Headers show
Series [RFC] RFC: import libxmlb and appstream from meta-oe | expand

Commit Message

Markus Volk Sept. 8, 2023, 1:04 p.m. UTC
The upcoming libadwaita update will have a required dependency on appstream,
so these will be required in oe-core.

In order to be able to use snowball for appstream by default, also libstemmer
would need to be moved.

Signed-off-by: Markus Volk <f_l_k@t-online.de>
---
 meta/conf/distro/include/maintainers.inc      |  2 +
 .../appstream/0001-fix-crosscompile.patch     | 43 +++++++++++++++
 .../appstream/appstream_0.16.3.bb             | 52 +++++++++++++++++++
 .../recipes-support/libxmlb/libxmlb/run-ptest |  3 ++
 .../recipes-support/libxmlb/libxmlb_0.3.14.bb | 24 +++++++++
 5 files changed, 124 insertions(+)
 create mode 100644 meta/recipes-support/appstream/appstream/0001-fix-crosscompile.patch
 create mode 100644 meta/recipes-support/appstream/appstream_0.16.3.bb
 create mode 100644 meta/recipes-support/libxmlb/libxmlb/run-ptest
 create mode 100644 meta/recipes-support/libxmlb/libxmlb_0.3.14.bb

Comments

Alexander Kanavin Sept. 8, 2023, 1:43 p.m. UTC | #1
Is it super hard to patch epiphany so that libadwaita is optional?

Alex

On Fri, 8 Sept 2023 at 15:05, Markus Volk <f_l_k@t-online.de> wrote:
>
> The upcoming libadwaita update will have a required dependency on appstream,
> so these will be required in oe-core.
>
> In order to be able to use snowball for appstream by default, also libstemmer
> would need to be moved.
>
> Signed-off-by: Markus Volk <f_l_k@t-online.de>
> ---
>  meta/conf/distro/include/maintainers.inc      |  2 +
>  .../appstream/0001-fix-crosscompile.patch     | 43 +++++++++++++++
>  .../appstream/appstream_0.16.3.bb             | 52 +++++++++++++++++++
>  .../recipes-support/libxmlb/libxmlb/run-ptest |  3 ++
>  .../recipes-support/libxmlb/libxmlb_0.3.14.bb | 24 +++++++++
>  5 files changed, 124 insertions(+)
>  create mode 100644 meta/recipes-support/appstream/appstream/0001-fix-crosscompile.patch
>  create mode 100644 meta/recipes-support/appstream/appstream_0.16.3.bb
>  create mode 100644 meta/recipes-support/libxmlb/libxmlb/run-ptest
>  create mode 100644 meta/recipes-support/libxmlb/libxmlb_0.3.14.bb
>
> diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc
> index 3619588ae6..18977fd671 100644
> --- a/meta/conf/distro/include/maintainers.inc
> +++ b/meta/conf/distro/include/maintainers.inc
> @@ -40,6 +40,7 @@ RECIPE_MAINTAINER:pn-alsa-ucm-conf = "Michael Opdenacker <michael.opdenacker@boo
>  RECIPE_MAINTAINER:pn-alsa-utils = "Michael Opdenacker <michael.opdenacker@bootlin.com>"
>  RECIPE_MAINTAINER:pn-apr = "Hongxu Jia <hongxu.jia@windriver.com>"
>  RECIPE_MAINTAINER:pn-apr-util = "Hongxu Jia <hongxu.jia@windriver.com>"
> +RECIPE_MAINTAINER:pn-appstream = "Markus Volk <f_l_k@t-online.de>"
>  RECIPE_MAINTAINER:pn-apt = "Unassigned <unassigned@yoctoproject.org>"
>  RECIPE_MAINTAINER:pn-argp-standalone = "Khem Raj <raj.khem@gmail.com>"
>  RECIPE_MAINTAINER:pn-asciidoc = "Yi Zhao <yi.zhao@windriver.com>"
> @@ -447,6 +448,7 @@ RECIPE_MAINTAINER:pn-libxml-sax-base-perl = "Tim Orling <tim.orling@konsulko.com
>  RECIPE_MAINTAINER:pn-libxml-sax-perl = "Tim Orling <tim.orling@konsulko.com>"
>  RECIPE_MAINTAINER:pn-libxml-simple-perl = "Tim Orling <tim.orling@konsulko.com>"
>  RECIPE_MAINTAINER:pn-libxml2 = "Hongxu Jia <hongxu.jia@windriver.com>"
> +RECIPE_MAINTAINER:pn-libxmlb = "Markus Volk <f_l_k@t-online.de>"
>  RECIPE_MAINTAINER:pn-libxmu = "Unassigned <unassigned@yoctoproject.org>"
>  RECIPE_MAINTAINER:pn-libxpm = "Unassigned <unassigned@yoctoproject.org>"
>  RECIPE_MAINTAINER:pn-libxrandr = "Unassigned <unassigned@yoctoproject.org>"
> diff --git a/meta/recipes-support/appstream/appstream/0001-fix-crosscompile.patch b/meta/recipes-support/appstream/appstream/0001-fix-crosscompile.patch
> new file mode 100644
> index 0000000000..fe8dcff910
> --- /dev/null
> +++ b/meta/recipes-support/appstream/appstream/0001-fix-crosscompile.patch
> @@ -0,0 +1,43 @@
> +From 6ab00a4279823829a9b82dc9e4d055da4de88c6e Mon Sep 17 00:00:00 2001
> +From: Markus Volk <f_l_k@t-online.de>
> +Date: Mon, 12 Dec 2022 15:42:42 +0100
> +Subject: [PATCH] fix crosscompile
> +
> +Signed-off-by: Markus Volk <f_l_k@t-online.de>
> +
> +Upstream-Status: Inappropriate [oe-specific]
> +---
> + data/meson.build  | 2 +-
> + meson.build       | 2 +-
> + tools/meson.build | 9 +++++++++
> + 3 files changed, 11 insertions(+), 2 deletions(-)
> +
> +diff --git a/data/meson.build b/data/meson.build
> +index aea0cb25..1a085fc9 100644
> +--- a/data/meson.build
> ++++ b/data/meson.build
> +@@ -14,7 +14,7 @@ install_data('its/metainfo.loc',
> + metainfo_with_relinfo = custom_target('gen-output',
> +     input : ['../NEWS', 'org.freedesktop.appstream.cli.metainfo.xml'],
> +     output : ['nol10n_withrelinfo_org.freedesktop.appstream.cli.metainfo.xml'],
> +-    command : [ascli_exe, 'news-to-metainfo', '--limit=6', '@INPUT0@', '@INPUT1@', '@OUTPUT@']
> ++    command : ['appstreamcli', 'news-to-metainfo', '--limit=6', '@INPUT0@', '@INPUT1@', '@OUTPUT@']
> + )
> +
> + metainfo_i18n = i18n.itstool_join(
> +diff --git a/meson.build b/meson.build
> +index fd0e3373..2f273ada 100644
> +--- a/meson.build
> ++++ b/meson.build
> +@@ -124,7 +124,7 @@ if get_option ('gir')
> +     dependency('gobject-introspection-1.0', version: '>=1.56')
> + endif
> +
> +-stemmer_inc_dirs = include_directories(['/usr/include'])
> ++stemmer_inc_dirs = include_directories([''])
> + if get_option('stemming')
> +     stemmer_lib = cc.find_library('stemmer', required: true)
> +     if not cc.has_header('libstemmer.h')
> +--
> +2.34.1
> +
> diff --git a/meta/recipes-support/appstream/appstream_0.16.3.bb b/meta/recipes-support/appstream/appstream_0.16.3.bb
> new file mode 100644
> index 0000000000..52d23732af
> --- /dev/null
> +++ b/meta/recipes-support/appstream/appstream_0.16.3.bb
> @@ -0,0 +1,52 @@
> +SUMMARY = "AppStream is a collaborative effort for making machine-readable software metadata easily available."
> +HOMEPAGE = "https://github.com/ximion/appstream"
> +LICENSE = "LGPL-2.1-only"
> +LIC_FILES_CHKSUM = "file://COPYING;md5=435ed639f84d4585d93824e7da3d85da"
> +
> +DEPENDS = " \
> +    appstream-native \
> +    curl-native \
> +    curl \
> +    docbook-xml-dtd4-native \
> +    gperf-native \
> +    glib-2.0 \
> +    libyaml \
> +    libxml2 \
> +    libxmlb \
> +    libxslt-native \
> +    itstool-native \
> +    docbook-xsl-stylesheets-native \
> +    python3-pygments-native \
> +"
> +
> +inherit meson gobject-introspection gettext gtk-doc pkgconfig vala
> +
> +GIR_MESON_OPTION = "gir"
> +GTKDOC_MESON_OPTION = "apidocs"
> +
> +SRC_URI = "https://www.freedesktop.org/software/appstream/releases/AppStream-${PV}.tar.xz"
> +SRC_URI:append:class-target = " file://0001-fix-crosscompile.patch"
> +SRC_URI[sha256sum] = "081c917646e94d7221c9e4aae54dacda95a27c607fa93cd8e6344a2b318b98b1"
> +
> +S = "${WORKDIR}/AppStream-${PV}"
> +
> +PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
> +
> +PACKAGECONFIG[systemd] = "-Dsystemd=true,-Dsystemd=false,systemd"
> +PACKAGECONFIG[stemming] = "-Dstemming=true,-Dstemming=false,libstemmer"
> +
> +FILES:${PN} += "${datadir}"
> +
> +EXTRA_OEMESON:class-target += " \
> +       --cross-file=${WORKDIR}/meson-${PN}.cross \
> +       ${@bb.utils.contains('GI_DATA_ENABLED', 'True', '-Dvapi=true', '-Dvapi=false', d)} \
> +"
> +
> +do_write_config:append:class-target() {
> +    cat >${WORKDIR}/meson-${PN}.cross <<EOF
> +[binaries]
> +appstreamcli = '${STAGING_BINDIR_NATIVE}/appstreamcli'
> +EOF
> +}
> +
> +BBCLASSEXTEND = "native"
> diff --git a/meta/recipes-support/libxmlb/libxmlb/run-ptest b/meta/recipes-support/libxmlb/libxmlb/run-ptest
> new file mode 100644
> index 0000000000..6d0bb95d3a
> --- /dev/null
> +++ b/meta/recipes-support/libxmlb/libxmlb/run-ptest
> @@ -0,0 +1,3 @@
> +#! /bin/sh
> +
> +gnome-desktop-testing-runner libxmlb
> diff --git a/meta/recipes-support/libxmlb/libxmlb_0.3.14.bb b/meta/recipes-support/libxmlb/libxmlb_0.3.14.bb
> new file mode 100644
> index 0000000000..90f8844051
> --- /dev/null
> +++ b/meta/recipes-support/libxmlb/libxmlb_0.3.14.bb
> @@ -0,0 +1,24 @@
> +SUMMARY = "A library to help create and query binary XML blobs"
> +LICENSE = "LGPL-2.1-only"
> +LIC_FILES_CHKSUM = "file://LICENSE;md5=1803fa9c2c3ce8cb06b4861d75310742"
> +
> +SRC_URI = "git://github.com/hughsie/libxmlb.git;branch=main;protocol=https \
> +           file://run-ptest \
> +           "
> +SRCREV = "aa577b276adc66564f5777f9a522ca3bf0bfa65e"
> +S = "${WORKDIR}/git"
> +
> +DEPENDS = "glib-2.0 xz zstd"
> +
> +inherit gobject-introspection gtk-doc meson ptest-gnome lib_package pkgconfig
> +
> +PACKAGECONFIG ??= "\
> +    ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)} \
> +"
> +PACKAGECONFIG[tests] = "-Dtests=true,-Dtests=false"
> +
> +GTKDOC_MESON_OPTION = "gtkdoc"
> +
> +FILES:${PN}-bin += "${libexecdir}"
> +
> +BBCLASSEXTEND = "native"
> --
> 2.41.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#187417): https://lists.openembedded.org/g/openembedded-core/message/187417
> Mute This Topic: https://lists.openembedded.org/mt/101235781/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Alexander Kanavin Sept. 8, 2023, 1:45 p.m. UTC | #2
0001-fix-crosscompile.patch needs to be split in two, both parts
properly described and submitted upstream.

Alex

On Fri, 8 Sept 2023 at 15:43, Alexander Kanavin <alex.kanavin@gmail.com> wrote:
>
> Is it super hard to patch epiphany so that libadwaita is optional?
>
> Alex
>
> On Fri, 8 Sept 2023 at 15:05, Markus Volk <f_l_k@t-online.de> wrote:
> >
> > The upcoming libadwaita update will have a required dependency on appstream,
> > so these will be required in oe-core.
> >
> > In order to be able to use snowball for appstream by default, also libstemmer
> > would need to be moved.
> >
> > Signed-off-by: Markus Volk <f_l_k@t-online.de>
> > ---
> >  meta/conf/distro/include/maintainers.inc      |  2 +
> >  .../appstream/0001-fix-crosscompile.patch     | 43 +++++++++++++++
> >  .../appstream/appstream_0.16.3.bb             | 52 +++++++++++++++++++
> >  .../recipes-support/libxmlb/libxmlb/run-ptest |  3 ++
> >  .../recipes-support/libxmlb/libxmlb_0.3.14.bb | 24 +++++++++
> >  5 files changed, 124 insertions(+)
> >  create mode 100644 meta/recipes-support/appstream/appstream/0001-fix-crosscompile.patch
> >  create mode 100644 meta/recipes-support/appstream/appstream_0.16.3.bb
> >  create mode 100644 meta/recipes-support/libxmlb/libxmlb/run-ptest
> >  create mode 100644 meta/recipes-support/libxmlb/libxmlb_0.3.14.bb
> >
> > diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc
> > index 3619588ae6..18977fd671 100644
> > --- a/meta/conf/distro/include/maintainers.inc
> > +++ b/meta/conf/distro/include/maintainers.inc
> > @@ -40,6 +40,7 @@ RECIPE_MAINTAINER:pn-alsa-ucm-conf = "Michael Opdenacker <michael.opdenacker@boo
> >  RECIPE_MAINTAINER:pn-alsa-utils = "Michael Opdenacker <michael.opdenacker@bootlin.com>"
> >  RECIPE_MAINTAINER:pn-apr = "Hongxu Jia <hongxu.jia@windriver.com>"
> >  RECIPE_MAINTAINER:pn-apr-util = "Hongxu Jia <hongxu.jia@windriver.com>"
> > +RECIPE_MAINTAINER:pn-appstream = "Markus Volk <f_l_k@t-online.de>"
> >  RECIPE_MAINTAINER:pn-apt = "Unassigned <unassigned@yoctoproject.org>"
> >  RECIPE_MAINTAINER:pn-argp-standalone = "Khem Raj <raj.khem@gmail.com>"
> >  RECIPE_MAINTAINER:pn-asciidoc = "Yi Zhao <yi.zhao@windriver.com>"
> > @@ -447,6 +448,7 @@ RECIPE_MAINTAINER:pn-libxml-sax-base-perl = "Tim Orling <tim.orling@konsulko.com
> >  RECIPE_MAINTAINER:pn-libxml-sax-perl = "Tim Orling <tim.orling@konsulko.com>"
> >  RECIPE_MAINTAINER:pn-libxml-simple-perl = "Tim Orling <tim.orling@konsulko.com>"
> >  RECIPE_MAINTAINER:pn-libxml2 = "Hongxu Jia <hongxu.jia@windriver.com>"
> > +RECIPE_MAINTAINER:pn-libxmlb = "Markus Volk <f_l_k@t-online.de>"
> >  RECIPE_MAINTAINER:pn-libxmu = "Unassigned <unassigned@yoctoproject.org>"
> >  RECIPE_MAINTAINER:pn-libxpm = "Unassigned <unassigned@yoctoproject.org>"
> >  RECIPE_MAINTAINER:pn-libxrandr = "Unassigned <unassigned@yoctoproject.org>"
> > diff --git a/meta/recipes-support/appstream/appstream/0001-fix-crosscompile.patch b/meta/recipes-support/appstream/appstream/0001-fix-crosscompile.patch
> > new file mode 100644
> > index 0000000000..fe8dcff910
> > --- /dev/null
> > +++ b/meta/recipes-support/appstream/appstream/0001-fix-crosscompile.patch
> > @@ -0,0 +1,43 @@
> > +From 6ab00a4279823829a9b82dc9e4d055da4de88c6e Mon Sep 17 00:00:00 2001
> > +From: Markus Volk <f_l_k@t-online.de>
> > +Date: Mon, 12 Dec 2022 15:42:42 +0100
> > +Subject: [PATCH] fix crosscompile
> > +
> > +Signed-off-by: Markus Volk <f_l_k@t-online.de>
> > +
> > +Upstream-Status: Inappropriate [oe-specific]
> > +---
> > + data/meson.build  | 2 +-
> > + meson.build       | 2 +-
> > + tools/meson.build | 9 +++++++++
> > + 3 files changed, 11 insertions(+), 2 deletions(-)
> > +
> > +diff --git a/data/meson.build b/data/meson.build
> > +index aea0cb25..1a085fc9 100644
> > +--- a/data/meson.build
> > ++++ b/data/meson.build
> > +@@ -14,7 +14,7 @@ install_data('its/metainfo.loc',
> > + metainfo_with_relinfo = custom_target('gen-output',
> > +     input : ['../NEWS', 'org.freedesktop.appstream.cli.metainfo.xml'],
> > +     output : ['nol10n_withrelinfo_org.freedesktop.appstream.cli.metainfo.xml'],
> > +-    command : [ascli_exe, 'news-to-metainfo', '--limit=6', '@INPUT0@', '@INPUT1@', '@OUTPUT@']
> > ++    command : ['appstreamcli', 'news-to-metainfo', '--limit=6', '@INPUT0@', '@INPUT1@', '@OUTPUT@']
> > + )
> > +
> > + metainfo_i18n = i18n.itstool_join(
> > +diff --git a/meson.build b/meson.build
> > +index fd0e3373..2f273ada 100644
> > +--- a/meson.build
> > ++++ b/meson.build
> > +@@ -124,7 +124,7 @@ if get_option ('gir')
> > +     dependency('gobject-introspection-1.0', version: '>=1.56')
> > + endif
> > +
> > +-stemmer_inc_dirs = include_directories(['/usr/include'])
> > ++stemmer_inc_dirs = include_directories([''])
> > + if get_option('stemming')
> > +     stemmer_lib = cc.find_library('stemmer', required: true)
> > +     if not cc.has_header('libstemmer.h')
> > +--
> > +2.34.1
> > +
> > diff --git a/meta/recipes-support/appstream/appstream_0.16.3.bb b/meta/recipes-support/appstream/appstream_0.16.3.bb
> > new file mode 100644
> > index 0000000000..52d23732af
> > --- /dev/null
> > +++ b/meta/recipes-support/appstream/appstream_0.16.3.bb
> > @@ -0,0 +1,52 @@
> > +SUMMARY = "AppStream is a collaborative effort for making machine-readable software metadata easily available."
> > +HOMEPAGE = "https://github.com/ximion/appstream"
> > +LICENSE = "LGPL-2.1-only"
> > +LIC_FILES_CHKSUM = "file://COPYING;md5=435ed639f84d4585d93824e7da3d85da"
> > +
> > +DEPENDS = " \
> > +    appstream-native \
> > +    curl-native \
> > +    curl \
> > +    docbook-xml-dtd4-native \
> > +    gperf-native \
> > +    glib-2.0 \
> > +    libyaml \
> > +    libxml2 \
> > +    libxmlb \
> > +    libxslt-native \
> > +    itstool-native \
> > +    docbook-xsl-stylesheets-native \
> > +    python3-pygments-native \
> > +"
> > +
> > +inherit meson gobject-introspection gettext gtk-doc pkgconfig vala
> > +
> > +GIR_MESON_OPTION = "gir"
> > +GTKDOC_MESON_OPTION = "apidocs"
> > +
> > +SRC_URI = "https://www.freedesktop.org/software/appstream/releases/AppStream-${PV}.tar.xz"
> > +SRC_URI:append:class-target = " file://0001-fix-crosscompile.patch"
> > +SRC_URI[sha256sum] = "081c917646e94d7221c9e4aae54dacda95a27c607fa93cd8e6344a2b318b98b1"
> > +
> > +S = "${WORKDIR}/AppStream-${PV}"
> > +
> > +PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
> > +
> > +PACKAGECONFIG[systemd] = "-Dsystemd=true,-Dsystemd=false,systemd"
> > +PACKAGECONFIG[stemming] = "-Dstemming=true,-Dstemming=false,libstemmer"
> > +
> > +FILES:${PN} += "${datadir}"
> > +
> > +EXTRA_OEMESON:class-target += " \
> > +       --cross-file=${WORKDIR}/meson-${PN}.cross \
> > +       ${@bb.utils.contains('GI_DATA_ENABLED', 'True', '-Dvapi=true', '-Dvapi=false', d)} \
> > +"
> > +
> > +do_write_config:append:class-target() {
> > +    cat >${WORKDIR}/meson-${PN}.cross <<EOF
> > +[binaries]
> > +appstreamcli = '${STAGING_BINDIR_NATIVE}/appstreamcli'
> > +EOF
> > +}
> > +
> > +BBCLASSEXTEND = "native"
> > diff --git a/meta/recipes-support/libxmlb/libxmlb/run-ptest b/meta/recipes-support/libxmlb/libxmlb/run-ptest
> > new file mode 100644
> > index 0000000000..6d0bb95d3a
> > --- /dev/null
> > +++ b/meta/recipes-support/libxmlb/libxmlb/run-ptest
> > @@ -0,0 +1,3 @@
> > +#! /bin/sh
> > +
> > +gnome-desktop-testing-runner libxmlb
> > diff --git a/meta/recipes-support/libxmlb/libxmlb_0.3.14.bb b/meta/recipes-support/libxmlb/libxmlb_0.3.14.bb
> > new file mode 100644
> > index 0000000000..90f8844051
> > --- /dev/null
> > +++ b/meta/recipes-support/libxmlb/libxmlb_0.3.14.bb
> > @@ -0,0 +1,24 @@
> > +SUMMARY = "A library to help create and query binary XML blobs"
> > +LICENSE = "LGPL-2.1-only"
> > +LIC_FILES_CHKSUM = "file://LICENSE;md5=1803fa9c2c3ce8cb06b4861d75310742"
> > +
> > +SRC_URI = "git://github.com/hughsie/libxmlb.git;branch=main;protocol=https \
> > +           file://run-ptest \
> > +           "
> > +SRCREV = "aa577b276adc66564f5777f9a522ca3bf0bfa65e"
> > +S = "${WORKDIR}/git"
> > +
> > +DEPENDS = "glib-2.0 xz zstd"
> > +
> > +inherit gobject-introspection gtk-doc meson ptest-gnome lib_package pkgconfig
> > +
> > +PACKAGECONFIG ??= "\
> > +    ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)} \
> > +"
> > +PACKAGECONFIG[tests] = "-Dtests=true,-Dtests=false"
> > +
> > +GTKDOC_MESON_OPTION = "gtkdoc"
> > +
> > +FILES:${PN}-bin += "${libexecdir}"
> > +
> > +BBCLASSEXTEND = "native"
> > --
> > 2.41.0
> >
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#187417): https://lists.openembedded.org/g/openembedded-core/message/187417
> > Mute This Topic: https://lists.openembedded.org/mt/101235781/1686489
> > Group Owner: openembedded-core+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
Markus Volk Sept. 8, 2023, 2:21 p.m. UTC | #3
On Fri, Sep 8 2023 at 03:43:49 PM +02:00:00, Alexander Kanavin 
<alex.kanavin@gmail.com> wrote:
> Is it super hard to patch epiphany so that libadwaita is optional?

I don't think that this is possible with gtk4

I'm fine with splitting the patch if needed, but I believe that both of 
the changes are inappropriate for upstream use.

The patch renames ascli_exe command to appstreamcli so that it differs 
from the one that is used for the target binary.

This only works, because we define appstreamcli from a meson.cross file:

do_write_config:append:class-target() {
    cat >${WORKDIR}/meson-${PN}.cross <<EOF
[binaries]
appstreamcli = '${STAGING_BINDIR_NATIVE}/appstreamcli'
EOF
}

This won't work upstream like this.

I also think, the second change would break build for a lot of people 
because the hardcoded include path surely is there for a reason,
even though it breaks the yocto build.
.
Probably the reason is that the buildsystem of snowball is bitrotten 
and also has no pkgconfig support.
Markus Volk Sept. 8, 2023, 2:49 p.m. UTC | #4
On Fri, Sep 8 2023 at 03:45:34 PM +02:00:00, Alexander Kanavin 
<alex.kanavin@gmail.com> wrote:
> 0001-fix-crosscompile.patch needs to be split in two, both parts
> properly described and submitted upstream.

The good news is, that the first issue seems to be fixed with the 
latest appstream update.

I'll send an update
diff mbox series

Patch

diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc
index 3619588ae6..18977fd671 100644
--- a/meta/conf/distro/include/maintainers.inc
+++ b/meta/conf/distro/include/maintainers.inc
@@ -40,6 +40,7 @@  RECIPE_MAINTAINER:pn-alsa-ucm-conf = "Michael Opdenacker <michael.opdenacker@boo
 RECIPE_MAINTAINER:pn-alsa-utils = "Michael Opdenacker <michael.opdenacker@bootlin.com>"
 RECIPE_MAINTAINER:pn-apr = "Hongxu Jia <hongxu.jia@windriver.com>"
 RECIPE_MAINTAINER:pn-apr-util = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER:pn-appstream = "Markus Volk <f_l_k@t-online.de>"
 RECIPE_MAINTAINER:pn-apt = "Unassigned <unassigned@yoctoproject.org>"
 RECIPE_MAINTAINER:pn-argp-standalone = "Khem Raj <raj.khem@gmail.com>"
 RECIPE_MAINTAINER:pn-asciidoc = "Yi Zhao <yi.zhao@windriver.com>"
@@ -447,6 +448,7 @@  RECIPE_MAINTAINER:pn-libxml-sax-base-perl = "Tim Orling <tim.orling@konsulko.com
 RECIPE_MAINTAINER:pn-libxml-sax-perl = "Tim Orling <tim.orling@konsulko.com>"
 RECIPE_MAINTAINER:pn-libxml-simple-perl = "Tim Orling <tim.orling@konsulko.com>"
 RECIPE_MAINTAINER:pn-libxml2 = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER:pn-libxmlb = "Markus Volk <f_l_k@t-online.de>"
 RECIPE_MAINTAINER:pn-libxmu = "Unassigned <unassigned@yoctoproject.org>"
 RECIPE_MAINTAINER:pn-libxpm = "Unassigned <unassigned@yoctoproject.org>"
 RECIPE_MAINTAINER:pn-libxrandr = "Unassigned <unassigned@yoctoproject.org>"
diff --git a/meta/recipes-support/appstream/appstream/0001-fix-crosscompile.patch b/meta/recipes-support/appstream/appstream/0001-fix-crosscompile.patch
new file mode 100644
index 0000000000..fe8dcff910
--- /dev/null
+++ b/meta/recipes-support/appstream/appstream/0001-fix-crosscompile.patch
@@ -0,0 +1,43 @@ 
+From 6ab00a4279823829a9b82dc9e4d055da4de88c6e Mon Sep 17 00:00:00 2001
+From: Markus Volk <f_l_k@t-online.de>
+Date: Mon, 12 Dec 2022 15:42:42 +0100
+Subject: [PATCH] fix crosscompile
+
+Signed-off-by: Markus Volk <f_l_k@t-online.de>
+
+Upstream-Status: Inappropriate [oe-specific]
+---
+ data/meson.build  | 2 +-
+ meson.build       | 2 +-
+ tools/meson.build | 9 +++++++++
+ 3 files changed, 11 insertions(+), 2 deletions(-)
+
+diff --git a/data/meson.build b/data/meson.build
+index aea0cb25..1a085fc9 100644
+--- a/data/meson.build
++++ b/data/meson.build
+@@ -14,7 +14,7 @@ install_data('its/metainfo.loc',
+ metainfo_with_relinfo = custom_target('gen-output',
+     input : ['../NEWS', 'org.freedesktop.appstream.cli.metainfo.xml'],
+     output : ['nol10n_withrelinfo_org.freedesktop.appstream.cli.metainfo.xml'],
+-    command : [ascli_exe, 'news-to-metainfo', '--limit=6', '@INPUT0@', '@INPUT1@', '@OUTPUT@']
++    command : ['appstreamcli', 'news-to-metainfo', '--limit=6', '@INPUT0@', '@INPUT1@', '@OUTPUT@']
+ )
+ 
+ metainfo_i18n = i18n.itstool_join(
+diff --git a/meson.build b/meson.build
+index fd0e3373..2f273ada 100644
+--- a/meson.build
++++ b/meson.build
+@@ -124,7 +124,7 @@ if get_option ('gir')
+     dependency('gobject-introspection-1.0', version: '>=1.56')
+ endif
+ 
+-stemmer_inc_dirs = include_directories(['/usr/include'])
++stemmer_inc_dirs = include_directories([''])
+ if get_option('stemming')
+     stemmer_lib = cc.find_library('stemmer', required: true)
+     if not cc.has_header('libstemmer.h')
+-- 
+2.34.1
+
diff --git a/meta/recipes-support/appstream/appstream_0.16.3.bb b/meta/recipes-support/appstream/appstream_0.16.3.bb
new file mode 100644
index 0000000000..52d23732af
--- /dev/null
+++ b/meta/recipes-support/appstream/appstream_0.16.3.bb
@@ -0,0 +1,52 @@ 
+SUMMARY = "AppStream is a collaborative effort for making machine-readable software metadata easily available."
+HOMEPAGE = "https://github.com/ximion/appstream"
+LICENSE = "LGPL-2.1-only"
+LIC_FILES_CHKSUM = "file://COPYING;md5=435ed639f84d4585d93824e7da3d85da"
+
+DEPENDS = " \
+    appstream-native \
+    curl-native \
+    curl \
+    docbook-xml-dtd4-native \
+    gperf-native \
+    glib-2.0 \
+    libyaml \
+    libxml2 \
+    libxmlb \
+    libxslt-native \
+    itstool-native \
+    docbook-xsl-stylesheets-native \
+    python3-pygments-native \
+"
+
+inherit meson gobject-introspection gettext gtk-doc pkgconfig vala
+
+GIR_MESON_OPTION = "gir"
+GTKDOC_MESON_OPTION = "apidocs"
+
+SRC_URI = "https://www.freedesktop.org/software/appstream/releases/AppStream-${PV}.tar.xz"
+SRC_URI:append:class-target = " file://0001-fix-crosscompile.patch"
+SRC_URI[sha256sum] = "081c917646e94d7221c9e4aae54dacda95a27c607fa93cd8e6344a2b318b98b1"
+
+S = "${WORKDIR}/AppStream-${PV}"
+
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
+
+PACKAGECONFIG[systemd] = "-Dsystemd=true,-Dsystemd=false,systemd"
+PACKAGECONFIG[stemming] = "-Dstemming=true,-Dstemming=false,libstemmer"
+
+FILES:${PN} += "${datadir}"
+
+EXTRA_OEMESON:class-target += " \
+	--cross-file=${WORKDIR}/meson-${PN}.cross \
+	${@bb.utils.contains('GI_DATA_ENABLED', 'True', '-Dvapi=true', '-Dvapi=false', d)} \
+"
+
+do_write_config:append:class-target() {
+    cat >${WORKDIR}/meson-${PN}.cross <<EOF
+[binaries]
+appstreamcli = '${STAGING_BINDIR_NATIVE}/appstreamcli'
+EOF
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-support/libxmlb/libxmlb/run-ptest b/meta/recipes-support/libxmlb/libxmlb/run-ptest
new file mode 100644
index 0000000000..6d0bb95d3a
--- /dev/null
+++ b/meta/recipes-support/libxmlb/libxmlb/run-ptest
@@ -0,0 +1,3 @@ 
+#! /bin/sh
+
+gnome-desktop-testing-runner libxmlb
diff --git a/meta/recipes-support/libxmlb/libxmlb_0.3.14.bb b/meta/recipes-support/libxmlb/libxmlb_0.3.14.bb
new file mode 100644
index 0000000000..90f8844051
--- /dev/null
+++ b/meta/recipes-support/libxmlb/libxmlb_0.3.14.bb
@@ -0,0 +1,24 @@ 
+SUMMARY = "A library to help create and query binary XML blobs"
+LICENSE = "LGPL-2.1-only"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=1803fa9c2c3ce8cb06b4861d75310742"
+
+SRC_URI = "git://github.com/hughsie/libxmlb.git;branch=main;protocol=https \
+           file://run-ptest \
+           "
+SRCREV = "aa577b276adc66564f5777f9a522ca3bf0bfa65e"
+S = "${WORKDIR}/git"
+
+DEPENDS = "glib-2.0 xz zstd"
+
+inherit gobject-introspection gtk-doc meson ptest-gnome lib_package pkgconfig
+
+PACKAGECONFIG ??= "\
+    ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)} \
+"
+PACKAGECONFIG[tests] = "-Dtests=true,-Dtests=false"
+
+GTKDOC_MESON_OPTION = "gtkdoc"
+
+FILES:${PN}-bin += "${libexecdir}"
+
+BBCLASSEXTEND = "native"