Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #build-deps gnutls-dev pkgconf
- #apt install libp11-kit-dev libnetcf-dev libnl-3-dev libnl-route3-dev libxml2-dev libdbus1-dev libsasl2-dev libssh-dev libudev-dev libpciaccess-dev libyajl-dev open-iscsi libdevmapper-dev libparted-dev zfsutils-linux
- name: virtpackage # you probably want to 'snapcraft register <name>'
- version: '0.1' # just for humans, typically '1.2+git' or '1.3.2'
- summary: QEmu + LibVirt + Virt-Manager
- description: |
- A package containing QEmu + LibVirt + Virt-Managers
- base: core18
- grade: devel # must be 'stable' to release into candidate/stable channels
- confinement: devmode # use 'strict' once you have the right plugs and slots
- parts:
- bash:
- source: https://ftp.gnu.org/gnu/bash/bash-5.0.tar.gz
- plugin: autotools
- gmplib:
- source: https://gmplib.org/download/gmp/gmp-6.1.2.tar.xz
- plugin: autotools
- stage:
- - -share/info/dir
- nettle:
- source: https://ftp.gnu.org/gnu/nettle/nettle-3.5.1.tar.gz
- after: [gmplib]
- plugin: autotools
- # configflags:
- # - --libdir=/usr/lib
- gnutls:
- source: https://www.gnupg.org/ftp/gcrypt/gnutls/v3.6/gnutls-3.6.8.tar.xz
- plugin: autotools
- after: [gmplib, nettle]
- build-packages: [pkgconf]
- configflags:
- - --with-included-libtasn1
- - --with-included-unistring
- stage:
- - -share/info/dir
- qemu:
- source: https://download.qemu.org/qemu-4.0.0.tar.xz
- plugin: autotools
- build-packages: [libglib2.0-dev,libpulse-dev,libfdt-dev,libpixman-1-dev,zlib1g-dev,python3,libspice-protocol-dev,libspice-server-dev]
- stage-packages: [libglib2.0-0,libpulse0,libfdt1,libpixman-1-0,zlib1g,python3,libspice-server1]
- after: [gnutls]
- configflags:
- - --target-list=x86_64-softmmu
- - --audio-drv-list=pa
- - --enable-kvm
- - --enable-vnc
- - --enable-vhost-kernel
- - --enable-vhost-user
- - --enable-vhost-vsock
- - --enable-vhost-scsi
- - --enable-spice
- - --python=/usr/bin/python3
- libvirt:
- source: https://libvirt.org/sources/libvirt-5.4.0.tar.xz
- plugin: autotools
- after: [qemu]
- build-packages: [parted, xsltproc,libxml2-utils,pkgconf,libp11-kit-dev,libnetcf-dev,libnl-3-dev,libnl-route-3-dev,libxml2-dev,libdbus-1-dev,libsasl2-dev,libssh-dev,libudev-dev,libpciaccess-dev,libyajl-dev,open-iscsi,libdevmapper-dev,libparted-dev,zfsutils-linux]
- stage-packages: [iptables,dmidecode,netcf,libpulse0,dnsmasq-base,parted, xsltproc,libxml2-utils,pkgconf,libp11-kit0,libnetcf1,libnl-3-200,libnl-route-3-200,libxml2,libdbus-1-3,libsasl2-2,libssh-4,libudev1,libpciaccess0,libyajl2,open-iscsi,libdevmapper1.02.1,libparted,zfsutils-linux]
- build-environment: #need to override configure script detected binary paths as it stuffs them in config.h and embeds in program macros, build env has these in /root/parts...
- - ac_cv_path_DNSMASQ: /usr/sbin/dnsmasq
- - ac_cv_path_PARTED=: /sbin/parted
- - ac_cv_path_ZFS: /sbin/zfs
- - ac_cv_path_ZPOOL: /sbin/zpool
- - ac_cv_path_DMIDECODE: /usr/sbin/dmidecode
- - ac_cv_path_IPTABLES: /sbin/iptables
- configflags:
- - --sharedstatedir=/var/snap/virtpackage/common/libvirt/com
- - --localstatedir=/var/snap/virtpackage/common/libvirt/var
- - --datarootdir=/var/snap/virtpackage/common/libvirt/share
- - --prefix=/usr #works around configmake.h build issue
- - --disable-silent-rules
- - --disable-rpath
- - --with-qemu
- - --with-qemu-user=libvirt-qemu
- - --with-qemu-group=kvm
- - --without-openvz
- - --without-avahi #disable multicast dns discovery of libvirt hosts
- - --with-sasl
- - --with-yajl
- - --with-ssh
- - --with-dbus
- - --with-polkit #used for socket access for libvirt clients
- - --with-udev
- - --with-storage-fs
- - --with-storage-dir
- - --with-storage-lvm
- - --with-storage-iscsi
- - --with-storage-disk
- - --without-storage-sheepdog
- - --without-storage-rbd
- - --without-storage-gluster
- - --with-storage-zfs
- - --with-init-script=systemd
- - --without-numactl
- - --without-numad
- - --without-selinux
- - --without-apparmor
- - --without-phyp
- - --without-esx
- - --with-macvtap
- - --with-network
- - --without-netcf #doesnt seem to work with snap
- - --without-xen
- - --without-lxc
- - --without-audit
- - --without-vbox
- - --without-libxl
- - --without-dtrace
- - --without-firewalld
- - --without-hal
- - --without-attr
- - --with-nss-plugin
- - --without-wireshark-dissector
- # libvirt-python:
- # source: https://libvirt.org/sources/python/libvirt-python-5.4.0.tar.gz
- # plugin: python
- # python-version: python3
- # after: [libvirt]
- # build-packages: [libgirepository1.0-dev,python3-pip,python3-venv, python3-python-utils,python3-setuptools,python3-distutils-extra,python3-wheel,libgtk-3-dev,python3-gi,gir1.2-gtk-vnc-2.0,gir1.2-spiceclientgtk-3.0,libosinfo-1.0-dev,gir1.2-vte-2.91,python3-libxml2,python3-requests]
- # stage-packages: [libgirepository1.0-dev,python3-pip,python3-venv, python3-python-utils,python3-setuptools,python3-distutils-extra,python3-wheel,libgtk-3-dev,python3-gi,gir1.2-gtk-vnc-2.0,gir1.2-spiceclientgtk-3.0,libosinfo-1.0-dev,gir1.2-vte-2.91,python3-libxml2,python3-requests]
- # virtmanager:
- # source: https://virt-manager.org/download/sources/virt-manager/virt-manager-2.2.0.tar.gz
- # plugin: python
- # python-version: python3
- # after: [libvirt-python]
- layout:
- /usr/lib/libvirt:
- bind: $SNAP/usr/lib/libvirt
- /usr/sbin:
- bind: $SNAP/usr/sbin
- /sbin:
- bind: $SNAP/sbin
- apps:
- libvirtd:
- command: usr/sbin/libvirtd
- virsh:
- command: usr/bin/virsh
- bash:
- command: bin/bash
- environment:
- LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/lib/x86_64-linux-gnu/pulseaudio
- #ludicrous, the build environment and runtime environment differ, libvirt hard compiles in paths discovered in their configure script
- #mount and bind as a workaround for build
- mkdir -p /var/snap/virtpackage/common
- mount -o bind /root/prime/var/snap/virtpackage/common/ /var/snap/virtpackage/common
- PKG_CONFIG_PATH=/root/stage/usr/lib/pkgconfig /root/parts/python-venv/bin/python setup.py install
- umount /root/prime/var/snap/virtpackage/common/
- /root/parts/python-venv/bin/python -m pip install wheel
- /root/parts/python-venv/bin/python -m pip install pgi
- /root/parts/python-venv/bin/python -m pip install PyGObject
- /root/parts/python-venv/bin/python -m pip install lxml
- /root/parts/python-venv/bin/python -m pip install libxml2-python3
- /root/parts/python-venv/bin/python -m pip install requests
- PKG_CONFIG_PATH=/root/stage/usr/lib/pkgconfig LD_LIBRARY_PATH=/root/stage/usr/lib/:root/stage/lib/ /root/parts/python-venv/bin/python setup.py configure --prefix=/root/parts/virtmanager/install
- PKG_CONFIG_PATH=/root/stage/usr/lib/pkgconfig LD_LIBRARY_PATH=/root/stage/usr/lib/:root/stage/lib/ /root/parts/python-venv/bin/python setup.py install
- cp -ar /root/parts/virtmanager/install /root/stage
- cp -ar /root/parts/virtmanager/install /root/prime
- mkdir -p /root/stage/opt
- mkdir -p /root/prime/opt
- cp -ar /root/parts/python-venv /root/stage/opt
- cp -ar /root/parts/python-venv /root/prime/opt
Add Comment
Please, Sign In to add comment