From 61cec3e210f58e0c6d05cde1012d0cf6ea072795 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Wed, 10 Jul 2024 03:45:58 +0000 Subject: [PATCH] libvirt: update to v10.5.0 and convert to git Rather than waiting for release tarballs for the main libvirt release, we can just use the git repository directory and avoid patch backporting for CVEs, etc. As part of this change, we adjust to git, refresh our meson build patch, and add a new meson patch for the tests. We also split out LIBVIRT_VERSION, so that nested builds can use it to locate tarballs. Signed-off-by: Bruce Ashfield --- recipes-extended/libvirt/libvirt-python.inc | 8 ++-- ...r-abs_top_builddir-to-avoid-QA-warni.patch | 31 +++++++++++++++ ...meson-clear-absolute-directory-paths.patch | 38 +++++++++++++++++++ .../{libvirt_10.0.0.bb => libvirt_git.bb} | 15 ++++++-- 4 files changed, 84 insertions(+), 8 deletions(-) create mode 100644 recipes-extended/libvirt/libvirt/0001-meson.build-clear-abs_top_builddir-to-avoid-QA-warni.patch create mode 100644 recipes-extended/libvirt/libvirt/0001-tests-meson-clear-absolute-directory-paths.patch rename recipes-extended/libvirt/{libvirt_10.0.0.bb => libvirt_git.bb} (96%) diff --git a/recipes-extended/libvirt/libvirt-python.inc b/recipes-extended/libvirt/libvirt-python.inc index 40c362d6..471d33d6 100644 --- a/recipes-extended/libvirt/libvirt-python.inc +++ b/recipes-extended/libvirt/libvirt-python.inc @@ -18,9 +18,9 @@ FILES:${PN}-python = "${bindir}/* ${libdir}/* ${libdir}/${PYTHON_DIR}/*" # Currently the libvirt-python debug libraries contain buildpaths INSANE_SKIP:${PN}-dbg += "buildpaths" -SRC_URI += "http://libvirt.org/sources/python/${BPN}-python-${PV}.tar.gz;name=libvirt_python;subdir=${BP}" +SRC_URI += "http://libvirt.org/sources/python/${BPN}-python-${LIBVIRT_VERSION}.tar.gz;name=libvirt_python;subdir=${BP}" -SRC_URI[libvirt_python.sha256sum] = "a82588f0e7db53eda7b7dbcbc448b0ec43e00a8c77cac69644495299b410c20d" +SRC_URI[libvirt_python.sha256sum] = "785023500f58d3e8e829af98647d43eee97e517aacc9d9e7ded43594ea52d032" export LIBVIRT_API_PATH = "${S}/docs/libvirt-api.xml" export LIBVIRT_CFLAGS = "-I${S}/include" @@ -46,7 +46,7 @@ do_compile:append() { # the syroot staged pkgconfig entries. So we clear the sysroot # for just this portion. export PKG_CONFIG_SYSROOT_DIR= - cd ${S}/${BPN}-python-${PV} && \ + cd ${UNPACKDIR}/${BP}/${BPN}-python-${LIBVIRT_VERSION} && \ ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py build cd - fi @@ -58,7 +58,7 @@ do_install:append() { # the syroot staged pkgconfig entries. So we clear the sysroot # for just this portion. export PKG_CONFIG_SYSROOT_DIR= - cd ${S}/${BPN}-python-${PV} && \ + cd ${UNPACKDIR}/${BP}/${BPN}-python-${LIBVIRT_VERSION} && \ ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py install \ --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${LIBVIRT_INSTALL_ARGS} cd - diff --git a/recipes-extended/libvirt/libvirt/0001-meson.build-clear-abs_top_builddir-to-avoid-QA-warni.patch b/recipes-extended/libvirt/libvirt/0001-meson.build-clear-abs_top_builddir-to-avoid-QA-warni.patch new file mode 100644 index 00000000..04db24d0 --- /dev/null +++ b/recipes-extended/libvirt/libvirt/0001-meson.build-clear-abs_top_builddir-to-avoid-QA-warni.patch @@ -0,0 +1,31 @@ +From d06f0795cfd097c373c7b9824ce59f17c9194520 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield +Date: Tue, 9 Jul 2024 21:23:47 +0000 +Subject: [PATCH] meson.build: clear abs_top_builddir to avoid QA warnings + +If we don't clear the absolute directories from the build, +we'll get QA warnings on packaging. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Bruce Ashfield +--- + src/meson.build | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/src/meson.build b/src/meson.build +index 8cce42c7ad..dc7a81c980 100644 +--- a/src/meson.build ++++ b/src/meson.build +@@ -3,8 +3,6 @@ src_inc_dir = include_directories('.') + src_dep = declare_dependency( + compile_args: [ + '-DIN_LIBVIRT', +- '-Dabs_top_builddir="@0@"'.format(meson.project_build_root()), +- '-Dabs_top_srcdir="@0@"'.format(meson.project_source_root()), + ] + coverage_flags + win32_flags, + dependencies: [ + glib_dep, +-- +2.39.2 + diff --git a/recipes-extended/libvirt/libvirt/0001-tests-meson-clear-absolute-directory-paths.patch b/recipes-extended/libvirt/libvirt/0001-tests-meson-clear-absolute-directory-paths.patch new file mode 100644 index 00000000..4cbe4913 --- /dev/null +++ b/recipes-extended/libvirt/libvirt/0001-tests-meson-clear-absolute-directory-paths.patch @@ -0,0 +1,38 @@ +From 05ef0d41895a355601333b5caa413754272fce03 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield +Date: Tue, 9 Jul 2024 23:06:39 +0000 +Subject: [PATCH] tests/meson: clear absolute directory paths + +Ensure that the abs_* directory definitions are cleared, so +they'll be consistent with the top level definitions and so +we won't hav QA warnings due to tmpdir references in the +resulting binaries. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Bruce Ashfield +--- + tests/meson.build | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/tests/meson.build b/tests/meson.build +index 2f1eda1f95..6fa8308385 100644 +--- a/tests/meson.build ++++ b/tests/meson.build +@@ -1,9 +1,9 @@ + tests_dep = declare_dependency( + compile_args: [ +- '-Dabs_builddir="@0@"'.format(meson.current_build_dir()), +- '-Dabs_top_builddir="@0@"'.format(meson.project_build_root()), +- '-Dabs_srcdir="@0@"'.format(meson.current_source_dir()), +- '-Dabs_top_srcdir="@0@"'.format(meson.project_source_root()), ++ '-Dabs_builddir="@0@"'.format(' '), ++ '-Dabs_top_builddir="@0@"'.format(' '), ++ '-Dabs_srcdir="@0@"'.format(' '), ++ '-Dabs_top_srcdir="@0@"'.format(' '), + ] + coverage_flags + cc_flags_relaxed_frame_limit, + dependencies: [ + apparmor_dep, +-- +2.39.2 + diff --git a/recipes-extended/libvirt/libvirt_10.0.0.bb b/recipes-extended/libvirt/libvirt_git.bb similarity index 96% rename from recipes-extended/libvirt/libvirt_10.0.0.bb rename to recipes-extended/libvirt/libvirt_git.bb index 8e54406a..20203ec2 100644 --- a/recipes-extended/libvirt/libvirt_10.0.0.bb +++ b/recipes-extended/libvirt/libvirt_git.bb @@ -24,7 +24,12 @@ RDEPENDS:libvirt-libvirtd:append:aarch64 = " dmidecode" #connman blocks the 53 port and libvirtd can't start its DNS service RCONFLICTS:${PN}_libvirtd = "connman" -SRC_URI = "http://libvirt.org/sources/${BP}.tar.xz;name=libvirt \ +SRCREV_libvirt = "0d3e962d47470165b28f742704385acefd70327e" + +LIBVIRT_VERSION = "10.5.0" +PV = "v${LIBVIRT_VERSION}+git" + +SRC_URI = "gitsm://github.com/libvirt/libvirt.git;name=libvirt;protocol=https;branch=master \ file://libvirtd.sh \ file://libvirtd.conf \ file://dnsmasq.conf \ @@ -32,9 +37,11 @@ SRC_URI = "http://libvirt.org/sources/${BP}.tar.xz;name=libvirt \ file://gnutls-helper.py;subdir=${BP} \ file://0001-prevent-gendispatch.pl-generating-build-path-in-code.patch \ file://0001-messon.build-remove-build-path-information-to-avoid-.patch \ + file://0001-meson.build-clear-abs_top_builddir-to-avoid-QA-warni.patch \ + file://0001-tests-meson-clear-absolute-directory-paths.patch \ " -SRC_URI[libvirt.sha256sum] = "8ba2e72ec8bdd2418554a1474c42c35704c30174b7611eaf9a16544b71bcf00a" +S = "${WORKDIR}/git" inherit meson gettext update-rc.d pkgconfig systemd useradd perlnative USERADD_PACKAGES = "${PN}" @@ -286,14 +293,14 @@ do_install:append() { if ${@bb.utils.contains('PACKAGECONFIG','gnutls','true','false',d)}; then # Generate sample keys and certificates. - ${S}/gnutls-helper.py -y + ${UNPACKDIR}/${BP}/gnutls-helper.py -y # Deploy all sample keys and certificates of CA, server and client # to target so that libvirtd is able to boot successfully and local # connection via 127.0.0.1 is available out of box. install -d ${D}/etc/pki/CA install -d ${D}/etc/pki/libvirt/private - install -m 0755 ${S}/gnutls-helper.py ${D}/${bindir} + install -m 0755 ${UNPACKDIR}/${BP}/gnutls-helper.py ${D}/${bindir} install -m 0644 cakey.pem ${D}/${sysconfdir}/pki/libvirt/private/cakey.pem install -m 0644 cacert.pem ${D}/${sysconfdir}/pki/CA/cacert.pem install -m 0644 serverkey.pem ${D}/${sysconfdir}/pki/libvirt/private/serverkey.pem