Skip to content

Ayushprtp/virsh-static

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#!/bin/bash
set -e

GREEN="\e[32m"
YELLOW="\e[33m"
RED="\e[31m"
RESET="\e[0m"

echo -e "${GREEN}▶ Starting static virsh build...${RESET}"

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
BUILD_DIR="$SCRIPT_DIR/deps"
INSTALL_DIR="$SCRIPT_DIR/virsh-static"
LIBVIRT_VERSION="10.0.0"
LIBVIRT_TARBALL="libvirt-${LIBVIRT_VERSION}.tar.xz"
LIBVIRT_URL="https://download.libvirt.org/${LIBVIRT_TARBALL}"

mkdir -p "$BUILD_DIR" "$INSTALL_DIR"
cd "$BUILD_DIR"

echo -e "${GREEN}▶ Installing build dependencies...${RESET}"
sudo apt-get update
sudo apt-get install -y \
  build-essential meson ninja-build \
  gettext xsltproc pkg-config \
  libtool autoconf automake \
  libreadline-dev libncurses-dev libxml2-dev libgnutls28-dev \
  libdevmapper-dev libpciaccess-dev libyajl-dev \
  libudev-dev libglib2.0-dev python3 python3-pip

if [ ! -f "$LIBVIRT_TARBALL" ]; then
  echo -e "${GREEN}▶ Downloading libvirt ${LIBVIRT_VERSION}...${RESET}"
  wget "$LIBVIRT_URL"
fi

rm -rf "libvirt-${LIBVIRT_VERSION}"
echo -e "${GREEN}▶ Extracting libvirt...${RESET}"
tar -xf "$LIBVIRT_TARBALL"
cd "libvirt-${LIBVIRT_VERSION}"

echo -e "${GREEN}▶ Configuring with Meson (libvirtd disabled)...${RESET}"
meson setup build \
  --prefix="$INSTALL_DIR" \
  -Ddefault_library=static \
  -Ddocs=disabled \
  -Dtests=disabled \
  -Ddriver_remote=disabled \
  -Ddriver_interface=disabled \
  -Ddriver_network=disabled || {
    echo -e "${RED}✖ Meson configuration failed. Check options.${RESET}"
    exit 1
  }

echo -e "${GREEN}▶ Building virsh...${RESET}"
ninja -C build

echo -e "${GREEN}▶ Installing to $INSTALL_DIR...${RESET}"
ninja -C build install

echo -e "${GREEN}✅ Static virsh installed at: $INSTALL_DIR/bin/virsh${RESET}"

About

Virsh Static 10.0.0

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors