#!/bin/bash fetch_source() { autoclone } # () for subshell, so no need to clean up env build() ( local SRCDIR #local DSTDIR="${MODULE_BUILD_DIR}" TODO # This is messy for now. We build both libs and install to the actual system root # instead of MODULE_BUILD_DIR, because the sysroot wrapper magic would only look # in TARGET_BUILD_DIR where we only copy things after this mltk module finished. # Solving this might require splitting this up into three separate mltk modules, # but eh... export PKG_CONFIG_PATH="${TARGET_BUILD_DIR}/usr/lib/x86_64-linux-gnu/pkgconfig:${TARGET_BUILD_DIR}/usr/lib64/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib64/pkgconfig" # create custom pkg-config program to patch paths from pkg-build config files in our build directory cat > "${MODULE_BUILD_DIR}/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 "${MODULE_BUILD_DIR}/pkg-config" # Part 1: spice-protocol SRCDIR="${MODULE_WORK_DIR}/src/spice-protocol" cde "${SRCDIR}" meson setup \ --prefix=/usr \ build || perror "meson for spice-protocol failed" ninja -C build install || perror "ninja spice-protocol failed" # Part 2: spice-gtk SRCDIR="${MODULE_WORK_DIR}/src/spice-gtk" cde "${SRCDIR}" echo -e '#!/bin/sh\nprintf "%s" "0.36"' > "build-aux/git-version-gen" meson setup --prefix=/usr \ build \ -Dwayland-protocols=enabled \ -Dbuiltin-mjpeg=false \ -Dopus=enabled \ -Dgtk=enabled || perror "meson for spice-gtk failed" ninja -C build install || perror "ninja for spice-gtk failed" # Part 3: 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 SRCDIR="${MODULE_WORK_DIR}/src/virt-viewer" cde "${SRCDIR}" PATH="${MODULE_BUILD_DIR}:${PATH}" meson setup \ --prefix="/usr" \ --sysconfdir="/etc" \ --localstatedir="/var" \ build \ -Dovirt=disabled \ -Dspice=enabled \ -Dvnc=enabled \ -Dlibvirt=enabled || perror "'meson' for virt-viewer failed." ninja -v -C build || perror "'ninja' for virt-viewer failed." ninja -v -C build install || perror "'ninja install' failed." ) post_copy() { : }