summaryrefslogtreecommitdiffstats
path: root/core/modules
diff options
context:
space:
mode:
authorManuel Bentele2021-10-11 11:03:56 +0200
committerManuel Bentele2021-10-12 13:12:55 +0200
commit40b844b8e6cf297f53be987ad18eb40cf9ea336e (patch)
treed591c8ba10851bda98acc5562b0b85fb0505dadb /core/modules
parent[libvirt-python] Add new module to build python wrapper for libvirt (diff)
downloadmltk-40b844b8e6cf297f53be987ad18eb40cf9ea336e.tar.gz
mltk-40b844b8e6cf297f53be987ad18eb40cf9ea336e.tar.xz
mltk-40b844b8e6cf297f53be987ad18eb40cf9ea336e.zip
[virt-viewer] Add new module to build virt-viewer from source
Diffstat (limited to 'core/modules')
-rw-r--r--core/modules/libvirt-src/module.build9
-rw-r--r--core/modules/virt-viewer/module.build25
-rw-r--r--core/modules/virt-viewer/module.conf5
-rw-r--r--core/modules/virt-viewer/module.conf.ubuntu1
4 files changed, 37 insertions, 3 deletions
diff --git a/core/modules/libvirt-src/module.build b/core/modules/libvirt-src/module.build
index 05537489..4ccc4373 100644
--- a/core/modules/libvirt-src/module.build
+++ b/core/modules/libvirt-src/module.build
@@ -32,7 +32,7 @@ build() {
--localstatedir="/var" \
-Dsystem=true \
-Dtests=disabled \
- -Ddocs=disabled \
+ -Ddocs=enabled \
-Dwireshark_dissector=disabled \
-Dstorage_dir=enabled \
-Dstorage_disk=enabled \
@@ -51,10 +51,15 @@ build() {
rm "${DSTDIR}/etc/libvirt/qemu/networks/default.xml"
# delete installed test and documentation files
- rm -rf "${DSTDIR}/usr/include/libvirt"
rm -rf "${DSTDIR}/usr/share/augeas"
rm -rf "${DSTDIR}/usr/share/doc/libvirt"
+ # patch library directory in pkg-config files
+ sed -i 's/^libdir=.*$/libdir=\/usr\/lib\/x86_64-linux-gnu/g' "${DSTDIR}/usr/lib64/pkgconfig/libvirt.pc"
+ sed -i 's/^libdir=.*$/libdir=\/usr\/lib\/x86_64-linux-gnu/g' "${DSTDIR}/usr/lib64/pkgconfig/libvirt-admin.pc"
+ sed -i 's/^libdir=.*$/libdir=\/usr\/lib\/x86_64-linux-gnu/g' "${DSTDIR}/usr/lib64/pkgconfig/libvirt-lxc.pc"
+ sed -i 's/^libdir=.*$/libdir=\/usr\/lib\/x86_64-linux-gnu/g' "${DSTDIR}/usr/lib64/pkgconfig/libvirt-qemu.pc"
+
# delete empty run folder to prevent mltk from stopping
rm -rf "${DSTDIR}/var/run"
}
diff --git a/core/modules/virt-viewer/module.build b/core/modules/virt-viewer/module.build
index 9c5e89e2..e95d9adf 100644
--- a/core/modules/virt-viewer/module.build
+++ b/core/modules/virt-viewer/module.build
@@ -11,6 +11,29 @@ build() {
# install meson (>= 0.54.0) since packaged version is too old
pip3 install "meson>=0.54.0"
+ # set config paths for additional pkg-config files
+ export PKG_CONFIG_PATH="${TARGET_BUILD_DIR}/usr/lib/x86_64-linux-gnu/pkgconfig:${TARGET_BUILD_DIR}/usr/lib64/pkgconfig"
+ # set system root directory for prebuilt headers and libraries, e.g. libvirt-glib
+ export PKG_CONFIG_SYSROOT_DIR="${TARGET_BUILD_DIR}"
+ # enable output of all system include directories
+ export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1
+ # enable output of all system library directories
+ export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
+
+ # create custom pkg-config program to patch paths from pkg-build config files in our build directory
+ cat > "${SRCDIR}/pkg-config" <<-EOF
+ #!/bin/bash
+
+ # unset custom path to avoid call recursion of this custom pkg-config script
+ unset PATH
+
+ # call patched pkg-config wrapper from mltk bin directory
+ exec "${ROOT_DIR}/core/bin/pkg-config.sh" "\${@}"
+ EOF
+ chmod +x "${SRCDIR}/pkg-config"
+
+ # overwrite search path to inject custom pkg-config program
+ PATH="${SRCDIR}:${PATH}" \
meson build \
--prefix="/usr" \
--sysconfdir="/etc" \
@@ -21,6 +44,8 @@ build() {
-Dlibvirt=enabled || perror "'meson' failed."
ninja -v -C build || perror "'ninja' failed."
DESTDIR="${DSTDIR}" ninja -v -C build install || perror "'ninja install' failed."
+
+ rm "${SRCDIR}/pkg-config"
}
post_copy() {
diff --git a/core/modules/virt-viewer/module.conf b/core/modules/virt-viewer/module.conf
index 3dcabb13..98b2bba5 100644
--- a/core/modules/virt-viewer/module.conf
+++ b/core/modules/virt-viewer/module.conf
@@ -1,5 +1,10 @@
#!/bin/bash
+REQUIRED_MODULES="
+ libvirt-src
+ libvirt-glib
+"
+
REQUIRED_GIT="
https://gitlab.com/virt-viewer/virt-viewer.git||v10.0
"
diff --git a/core/modules/virt-viewer/module.conf.ubuntu b/core/modules/virt-viewer/module.conf.ubuntu
index ab1907e8..434612d4 100644
--- a/core/modules/virt-viewer/module.conf.ubuntu
+++ b/core/modules/virt-viewer/module.conf.ubuntu
@@ -5,7 +5,6 @@ REQUIRED_INSTALLED_PACKAGES="
python3-pip
ninja-build
debhelper
- libvirt-glib-1.0-dev
libgovirt-dev
libgtk-vnc-2.0-dev
libspice-client-gtk-3.0-dev