From 6a76ec8ae3610246f5b60700743501de2bb6a3a9 Mon Sep 17 00:00:00 2001 From: Alexey Pavlov Date: Sat, 9 Jan 2021 14:04:14 +0300 Subject: [PATCH] libvirt: Update to 7.0.0-rc1 --- mingw-w64-libvirt/002-search-path.patch | 13 + mingw-w64-libvirt/PKGBUILD | 122 +++++---- .../meson-drop-path-for-python.patch | 255 ++++++++++++++++++ .../msys-rpcgen-as-portable.patch | 11 + 4 files changed, 351 insertions(+), 50 deletions(-) create mode 100644 mingw-w64-libvirt/002-search-path.patch create mode 100644 mingw-w64-libvirt/meson-drop-path-for-python.patch create mode 100644 mingw-w64-libvirt/msys-rpcgen-as-portable.patch diff --git a/mingw-w64-libvirt/002-search-path.patch b/mingw-w64-libvirt/002-search-path.patch new file mode 100644 index 0000000000..5eefb403a1 --- /dev/null +++ b/mingw-w64-libvirt/002-search-path.patch @@ -0,0 +1,13 @@ +--- libvirt-6.8.0/meson.build.orig 2020-10-28 08:57:56.034093500 +0300 ++++ libvirt-6.8.0/meson.build 2020-10-28 08:58:56.830038500 +0300 +@@ -881,9 +881,7 @@ + # Where we look for daemons and admin binaries during configure + + libvirt_sbin_path = [ +- '/sbin', +- '/usr/sbin', +- '/usr/local/sbin', ++ @@SEARCH_PATH@@ + ] + + diff --git a/mingw-w64-libvirt/PKGBUILD b/mingw-w64-libvirt/PKGBUILD index c6b5076720..64a7dc712d 100644 --- a/mingw-w64-libvirt/PKGBUILD +++ b/mingw-w64-libvirt/PKGBUILD @@ -2,74 +2,96 @@ _realname=libvirt pkgbase=mingw-w64-${_realname} -pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" -pkgver=5.9.0 +pkgname=${MINGW_PACKAGE_PREFIX}-${_realname} +_pkgdev=7.0.0-rc1 +pkgver=${_pkgdev//-/} pkgrel=1 pkgdesc="Windows libvirt virtualization library (mingw-w64)" arch=('any') -url="https://libvirt.org" +url=https://libvirt.org license=('LGPL2') -depends=("${MINGW_PACKAGE_PREFIX}-curl" - "${MINGW_PACKAGE_PREFIX}-gnutls" - "${MINGW_PACKAGE_PREFIX}-gettext" - "${MINGW_PACKAGE_PREFIX}-libgcrypt" - "${MINGW_PACKAGE_PREFIX}-libgpg-error" - "${MINGW_PACKAGE_PREFIX}-libxml2" - "${MINGW_PACKAGE_PREFIX}-portablexdr") -makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" - "${MINGW_PACKAGE_PREFIX}-pkg-config" - "${MINGW_PACKAGE_PREFIX}-python3") +depends=(${MINGW_PACKAGE_PREFIX}-curl + ${MINGW_PACKAGE_PREFIX}-gnutls + ${MINGW_PACKAGE_PREFIX}-gettext + ${MINGW_PACKAGE_PREFIX}-libgcrypt + ${MINGW_PACKAGE_PREFIX}-libgpg-error + ${MINGW_PACKAGE_PREFIX}-libxml2 + ${MINGW_PACKAGE_PREFIX}-portablexdr) +makedepends=(${MINGW_PACKAGE_PREFIX}-gcc + ${MINGW_PACKAGE_PREFIX}-meson + ${MINGW_PACKAGE_PREFIX}-ninja + ${MINGW_PACKAGE_PREFIX}-pkg-config + ${MINGW_PACKAGE_PREFIX}-python + ${MINGW_PACKAGE_PREFIX}-python-docutils + ${MINGW_PACKAGE_PREFIX}-python-flake8 + rpcsvc-proto + perl) options=('strip' 'staticlibs') -source=(https://libvirt.org/sources/${_realname}-${pkgver}.tar.xz - 001-fix-not-supported-authenticate-method.patch) -sha256sums=('3496d2e1d988185de013b2a9d2e8824458afd85aa7cd050283a59b3d78978939' - '4635fd04e596879186b74ef9ddbacf64f6058e32bfd8d8376e1b7fa7838f679b') +source=(https://libvirt.org/sources/${_realname}-${_pkgdev}.tar.xz + 001-fix-not-supported-authenticate-method.patch + 002-search-path.patch + msys-rpcgen-as-portable.patch + meson-drop-path-for-python.patch) +sha256sums=('b1f0acae93b4dea6b7b68e8ac79caba95d4b3cd9ac857dbc54d0548e3513802d' + '4635fd04e596879186b74ef9ddbacf64f6058e32bfd8d8376e1b7fa7838f679b' + '38ced91a3a7f569ecaa4d738c1fe530604bf96ed26458559be398e30a2fa1829' + '54eb6af16a1d001eab81dbc4352ff82a2349242d9f9f3f87eb45f75e8fc8a08d' + 'fda18a489451cee114a6f02fd561afe8731e1a30cf70b754bcca6434176859ad') +noextract=(${_realname}-${_pkgdev}.tar.xz) prepare() { - cd ${_realname}-${pkgver} + [[ -d ${srcdir}/${_realname}-${_pkgdev%-*} ]] && rm -rf ${srcdir}/${_realname}-${_pkgdev%-*} + MSYS=winsymlinks:native tar -xJf ${srcdir}/${_realname}-${_pkgdev}.tar.xz -C ${srcdir} || true + + cd ${_realname}-${_pkgdev%-*} patch -p1 -i ${srcdir}/001-fix-not-supported-authenticate-method.patch + patch -p1 -i ${srcdir}/002-search-path.patch + patch -p1 -i ${srcdir}/msys-rpcgen-as-portable.patch + + patch -p1 -R -i ${srcdir}/meson-drop-path-for-python.patch + + local _PRE_WIN="$(cygpath -m ${MINGW_PREFIX})" + sed -e "s|@@SEARCH_PATH@@|\'${_PRE_WIN}/bin,\'|g" -i meson.build } build() { [[ -d ${srcdir}/build-${MINGW_CHOST} ]] && rm -rf ${srcdir}/build-${MINGW_CHOST} - mkdir -p "${srcdir}/build-${MINGW_CHOST}" && cd "${srcdir}/build-${MINGW_CHOST}" + mkdir -p ${srcdir}/build-${MINGW_CHOST} && cd ${srcdir}/build-${MINGW_CHOST} - CPPFLAGS+=" -D_WIN32_WINNT=0x0501" + #CPPFLAGS+= -D_WIN32_WINNT=0x0501 # https://github.com/msys2/MINGW-packages-dev/pull/6 LDFLAGS+=" -fstack-protector" - PYTHON="${MINGW_PREFIX}/bin/python3" \ - ../${_realname}-${pkgver}/configure \ - --enable-shared \ - --enable-static \ - --prefix=${MINGW_PREFIX} \ - --build=${MINGW_CHOST} \ - --host=${MINGW_CHOST} \ - --target=${MINGW_CHOST} \ - --without-xen \ - --without-qemu \ - --without-openvz \ - --without-lxc \ - --without-vbox \ - --without-xenapi \ - --without-sasl \ - --without-avahi \ - --without-polkit \ - --without-libvirtd \ - --without-uml \ - --without-phyp \ - --without-esx \ - --without-hyperv \ - --without-vmware \ - --without-parallels \ - --without-netcf \ - --without-audit \ - --without-dtrace \ - --enable-expensive-tests - make + PYTHON=${MINGW_PREFIX}/bin/python.exe \ + MSYS2_ARG_CONV_EXCL="--prefix=" \ + ${MINGW_PREFIX}/bin/meson \ + --prefix="${MINGW_PREFIX}" \ + --buildtype=plain \ + -Drpath=disabled \ + -Ddriver_qemu=disabled \ + -Ddriver_openvz=disabled \ + -Ddriver_lxc=disabled \ + -Ddriver_vbox=disabled \ + -Ddriver_libvirtd=disabled \ + -Ddriver_esx=disabled \ + -Ddriver_hyperv=disabled \ + -Ddriver_vmware=disabled \ + -Dsasl=disabled \ + -Dpolkit=disabled \ + -Dnetcf=disabled \ + -Daudit=disabled \ + -Ddtrace=disabled \ + -Dtests=disabled \ + -Dexpensive_tests=disabled \ + ../${_realname}-${_pkgdev%-*} + + ninja } package() { cd ${srcdir}/build-${MINGW_CHOST} - make DESTDIR="${pkgdir}" install + DESTDIR="${pkgdir}" ninja install + + install -Dm644 ${srcdir}/${_realname}-${_pkgdev%-*}/COPYING "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING" + install -Dm644 ${srcdir}/${_realname}-${_pkgdev%-*}/COPYING.LESSER "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING.LESSER" } diff --git a/mingw-w64-libvirt/meson-drop-path-for-python.patch b/mingw-w64-libvirt/meson-drop-path-for-python.patch new file mode 100644 index 0000000000..085b8dd3fb --- /dev/null +++ b/mingw-w64-libvirt/meson-drop-path-for-python.patch @@ -0,0 +1,255 @@ +When using .path() for an argument to a python script meson will not +setup dependancies on the file. This means that changes to the generator +script will not trigger a rebiuld + +Signed-off-by: Daniel P. Berrangé +--- + docs/manpages/meson.build | 4 ++-- + docs/meson.build | 8 ++++---- + src/access/meson.build | 2 +- + src/admin/meson.build | 4 ++-- + src/esx/meson.build | 4 ++-- + src/hyperv/meson.build | 2 +- + src/meson.build | 16 ++++++++-------- + src/qemu/meson.build | 2 +- + src/util/meson.build | 4 ++-- + 9 files changed, 23 insertions(+), 23 deletions(-) + +diff --git a/docs/manpages/meson.build b/docs/manpages/meson.build +index ecc517e80e..7156c10cc6 100644 +--- a/docs/manpages/meson.build ++++ b/docs/manpages/meson.build +@@ -32,7 +32,7 @@ foreach name : keycode_list + input: keymap_src_file, + output: 'virkeycode- 0@.rst'.format(name), + command: [ +- meson_python_prog, python3_prog.path(), keymap_gen_prog.path(), 'code-docs', ++ meson_python_prog, python3_prog, keymap_gen_prog, 'code-docs', + '--lang', 'rst', + '--title', 'virkeycode- 0@'.format(name), + '--subtitle', 'Key code values for @0@'.format(name), +@@ -53,7 +53,7 @@ foreach name : keyname_list + input: keymap_src_file, + output: 'virkeyname- 0@.rst'.format(name), + command: [ +- meson_python_prog, python3_prog.path(), keymap_gen_prog.path(), 'name-docs', ++ meson_python_prog, python3_prog, keymap_gen_prog, 'name-docs', + '--lang', 'rst', + '--title', 'virkeyname- 0@'.format(name), + '--subtitle', 'Key name values for @0@'.format(name), +diff --git a/docs/meson.build b/docs/meson.build +index a915d6252a..28914f76f9 100644 +--- a/docs/meson.build ++++ b/docs/meson.build +@@ -140,7 +140,7 @@ aclperms_gen = custom_target( + input: access_perm_h, + output: 'aclperms.htmlinc', + command: [ +- meson_python_prog, python3_prog.path(), genaclperms_prog.path(), '@INPUT@', ++ meson_python_prog, python3_prog, genaclperms_prog, '@INPUT@', + ], + capture: true, + ) +@@ -163,7 +163,7 @@ docs_api_generated = custom_target( + 'libvirt-admin-api.xml', + ], + command: [ +- meson_python_prog, python3_prog.path(), apibuild_prog.path(), ++ meson_python_prog, python3_prog, apibuild_prog, + meson.current_source_dir(), + meson.current_build_dir(), + ], +@@ -233,8 +233,8 @@ hvsupport_html_in = custom_target( + output: 'hvsupport.html.in', + command: [ + meson_python_prog, +- python3_prog.path(), +- hvsupport_prog.path(), ++ python3_prog, ++ hvsupport_prog, + meson.source_root(), + meson.build_root(), + ], +diff --git a/src/access/meson.build b/src/access/meson.build +index 1cffdae21a..36aff6fd88 100644 +--- a/src/access/meson.build ++++ b/src/access/meson.build +@@ -82,7 +82,7 @@ if conf.has('WITH_POLKIT') + 'org.libvirt.api.policy', + input: access_perm_h, + output: 'org.libvirt.api.policy', +- command: [ meson_python_prog, python3_prog.path(), genpolkit_prog.path(), '@INPUT@' ], ++ command: [ meson_python_prog, python3_prog, genpolkit_prog, '@INPUT@' ], + capture: true, + install: true, + install_dir: datadir / 'polkit-1' / 'actions', +diff --git a/src/admin/meson.build b/src/admin/meson.build +index e97974231f..f787c6665b 100644 +--- a/src/admin/meson.build ++++ b/src/admin/meson.build +@@ -68,7 +68,7 @@ libvirt_admin_syms = custom_target( + ], + output: 'libvirt_admin.syms', + command: [ +- meson_python_prog, python3_prog.path(), meson_gen_sym_prog.path(), ++ meson_python_prog, python3_prog, meson_gen_sym_prog, + '@OUTPUT@', 'LIBVIRT_ADMIN_PRIVATE_' + meson.project_version(), '@INPUT@', + ], + ) +@@ -79,7 +79,7 @@ if host_machine.system() == 'windows' + input: libvirt_admin_syms, + output: 'libvirt_admin.def', + command: [ +- meson_python_prog, python3_prog.path(), meson_gen_def_prog.path(), ++ meson_python_prog, python3_prog, meson_gen_def_prog, + '@INPUT@', '@OUTPUT@', + ], + ) +diff --git a/src/esx/meson.build b/src/esx/meson.build +index 2a7fcd54c9..5861e90afa 100644 +--- a/src/esx/meson.build ++++ b/src/esx/meson.build +@@ -25,7 +25,7 @@ esx_gen_headers = custom_target( + 'esx_vi_types.generated.typeenum', + ], + command: [ +- meson_python_prog, python3_prog.path(), esx_vi_generator_prog.path(), ++ meson_python_prog, python3_prog, esx_vi_generator_prog, + meson.source_root() / 'src', + meson.build_root() / 'src', + 'header', +@@ -46,7 +46,7 @@ esx_gen_sources = custom_target( + 'esx_vi_types.generated.typetostring', + ], + command: [ +- meson_python_prog, python3_prog.path(), esx_vi_generator_prog.path(), ++ meson_python_prog, python3_prog, esx_vi_generator_prog, + meson.source_root() / 'src', + meson.build_root() / 'src', + 'source', +diff --git a/src/hyperv/meson.build b/src/hyperv/meson.build +index 84fcedce38..1020e3d6b0 100644 +--- a/src/hyperv/meson.build ++++ b/src/hyperv/meson.build +@@ -16,7 +16,7 @@ hyperv_gen_sources = custom_target( + 'hyperv_wmi_classes.generated.typedef', + ], + command: [ +- meson_python_prog, python3_prog.path(), hyperv_wmi_generator_prog.path(), ++ meson_python_prog, python3_prog, hyperv_wmi_generator_prog, + meson.source_root() / 'src', + meson.build_root() / 'src', + ], +diff --git a/src/meson.build b/src/meson.build +index 72dad0ab45..7c478219d6 100644 +--- a/src/meson.build ++++ b/src/meson.build +@@ -75,7 +75,7 @@ if conf.has('WITH_DTRACE_PROBES') + input: infile, + output: out_stp, + command: [ +- meson_python_prog, python3_prog.path(), dtrace2systemtap_prog.path(), ++ meson_python_prog, python3_prog, dtrace2systemtap_prog, + bindir, sbindir, libdir, '@INPUT@' + ], + capture: true, +@@ -356,7 +356,7 @@ libvirt_syms = custom_target( + input: [ public_sym_file ] + used_sym_files + generated_sym_files, + output: 'libvirt.syms', + command: [ +- meson_python_prog, python3_prog.path(), meson_gen_sym_prog.path(), ++ meson_python_prog, python3_prog, meson_gen_sym_prog, + '@OUTPUT@', 'LIBVIRT_PRIVATE_' + meson.project_version(), '@INPUT@', + ], + ) +@@ -367,7 +367,7 @@ if host_machine.system() == 'windows' + input: libvirt_syms, + output: 'libvirt.def', + command: [ +- meson_python_prog, python3_prog.path(), meson_gen_def_prog.path(), ++ meson_python_prog, python3_prog, meson_gen_def_prog, + '@INPUT@', '@OUTPUT@', + ], + ) +@@ -417,7 +417,7 @@ if host_machine.system() == 'windows' + input: libvirt_qemu_syms, + output: 'libvirt_qemu.def', + command: [ +- meson_python_prog, python3_prog.path(), meson_gen_def_prog.path(), ++ meson_python_prog, python3_prog, meson_gen_def_prog, + '@INPUT@', '@OUTPUT@', + ], + ) +@@ -471,7 +471,7 @@ if host_machine.system() == 'windows' + input: libvirt_lxc_syms, + output: 'libvirt_lxc.def', + command: [ +- meson_python_prog, python3_prog.path(), meson_gen_def_prog.path(), ++ meson_python_prog, python3_prog, meson_gen_def_prog, + '@INPUT@', '@OUTPUT@', + ], + ) +@@ -686,7 +686,7 @@ foreach data : virt_test_aug_files + input: [ data['conf'], data['aug'] ], + output: data['name'], + command: [ +- meson_python_prog, python3_prog.path(), augeas_gentest_prog.path(), ++ meson_python_prog, python3_prog, augeas_gentest_prog, + '@INPUT@', + ], + capture: true, +@@ -762,7 +762,7 @@ foreach data : virt_daemon_confs + input: [ conf_out, test_aug_tmp ], + output: test_aug_out, + command: [ +- meson_python_prog, python3_prog.path(), augeas_gentest_prog.path(), ++ meson_python_prog, python3_prog, augeas_gentest_prog, + '@INPUT@', + ], + capture: true, +@@ -884,7 +884,7 @@ if conf.has('WITH_DTRACE_PROBES') + input: rpc_probe_files, + output: 'libvirt_functions.stp', + command: [ +- meson_python_prog, python3_prog.path(), gensystemtap_prog.path(), ++ meson_python_prog, python3_prog, gensystemtap_prog, + '@INPUT@', + ], + capture: true, +diff --git a/src/qemu/meson.build b/src/qemu/meson.build +index 4e599d1e69..90640b03c6 100644 +--- a/src/qemu/meson.build ++++ b/src/qemu/meson.build +@@ -71,7 +71,7 @@ if conf.has('WITH_DTRACE_PROBES') + input: infile, + output: out_stp, + command: [ +- meson_python_prog, python3_prog.path(), dtrace2systemtap_prog.path(), ++ meson_python_prog, python3_prog, dtrace2systemtap_prog, + bindir, sbindir, libdir, '@INPUT@', + ], + capture: true, +diff --git a/src/util/meson.build b/src/util/meson.build +index 3b711b1dc2..395e70fd38 100644 +--- a/src/util/meson.build ++++ b/src/util/meson.build +@@ -144,7 +144,7 @@ foreach name : keycode_list + input: keymap_src_file, + output: 'virkeycodetable_ 0@.h'.format(name), + command: [ +- meson_python_prog, python3_prog.path(), keymap_gen_prog.path(), 'code-table', ++ meson_python_prog, python3_prog, keymap_gen_prog, 'code-table', + '--lang', 'stdc', + '--varname', 'virKeyCodeTable_ 0@'.format(name), + '@INPUT@', name, +@@ -159,7 +159,7 @@ foreach name : keyname_list + input: keymap_src_file, + output: 'virkeynametable_ 0@.h'.format(name), + command: [ +- meson_python_prog, python3_prog.path(), keymap_gen_prog.path(), 'name-table', ++ meson_python_prog, python3_prog, keymap_gen_prog, 'name-table', + '--lang', 'stdc', + '--varname', 'virKeyNameTable_ 0@'.format(name), + '@INPUT@', name, +-- +2.28.0 diff --git a/mingw-w64-libvirt/msys-rpcgen-as-portable.patch b/mingw-w64-libvirt/msys-rpcgen-as-portable.patch new file mode 100644 index 0000000000..98406a8009 --- /dev/null +++ b/mingw-w64-libvirt/msys-rpcgen-as-portable.patch @@ -0,0 +1,11 @@ +--- libvirt-7.0.0/src/rpc/genprotocol.pl.orig 2021-01-09 13:04:12.963609000 +0300 ++++ libvirt-7.0.0/src/rpc/genprotocol.pl 2021-01-09 13:04:26.081292200 +0300 +@@ -57,6 +57,8 @@ + # We only want to fixup the GLibc rpcgen output + # So just print data unchanged, if non-Linux + unless ($fixup) { ++ # Fix VPATH builds ++ s,#include ".*/([^/]+)protocol\.h",#include "${1}protocol.h",; + print TARGET; + next; + }