-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
template
118 lines (106 loc) · 3.69 KB
/
template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# Template file for 'libvirt'
pkgname=libvirt
version=10.5.0
revision=1
build_style=meson
configure_args="-Dqemu_user=libvirt -Dqemu_group=libvirt -Drunstatedir=/run
-Dpolkit=enabled"
hostmakedepends="automake dnsmasq docbook-xsl gettext gettext-devel iptables
libapparmor-devel libtool libxslt lvm2 parted perl pkg-config python3-docutils
rpcsvc-proto"
makedepends="readline-devel libcap-ng-devel attr-devel gnutls-devel
libsasl-devel libcurl-devel libpcap-devel libxml2-devel libparted-devel
device-mapper-devel eudev-libudev-devel libblkid-devel libpciaccess-devel
avahi-libs-devel polkit-devel yajl-devel jansson-devel python3-devel
libssh2-devel fuse-devel libtirpc-devel libapparmor-devel"
depends="iptables dnsmasq"
short_desc="Virtualization API for controlling virtualization engines"
maintainer="Orphaned <orphan@voidlinux.org>"
license="LGPL-2.1-or-later"
homepage="https://libvirt.org"
changelog="https://raw.githubusercontent.com/libvirt/libvirt/master/NEWS.rst"
distfiles="https://libvirt.org/sources/libvirt-${version}.tar.xz"
checksum=8e853a9c91c9029b9019cf5fdf2b5fea36d501d563e43254efc20e12c00557e8
# At least one test times out on CI but works locally
make_check=ci-skip
# FIX https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=701649
system_accounts="libvirt"
libvirt_groups="disk,kvm"
case "$XBPS_TARGET_MACHINE" in
i686*) makedepends+=" libnuma-devel" ;;
x86_64*) makedepends+=" libnuma-devel xen-devel" ;;
*) ;;
esac
case "$XBPS_TARGET_MACHINE" in
*-musl) ;;
*)
# LTO apparently causes the linker to confuse the glibc symbol
# xdr_int64_t with that provided by libtirpc, causing a crash.
# https://gitlab.com/libvirt/libvirt/-/issues/92
configure_args+=" -Db_lto=false"
;;
esac
conf_files="
/etc/libvirt/nwfilter/*.xml
/etc/libvirt/qemu/networks/*.xml
/etc/libvirt/*.conf"
make_dirs="
/var/lib/libvirt/uml 0755 root root
/var/lib/libvirt/qemu/nvram 0755 root root
/var/lib/libvirt/qemu/channel/target 0755 root root
/var/lib/libvirt/network 0755 root root
/var/lib/libvirt/lxc 0755 root root
/var/lib/libvirt/lockd/files 0755 root root
/var/lib/libvirt/libxl 0755 root root
/var/lib/libvirt/images 0755 root root
/var/lib/libvirt/filesystems 0755 root root
/var/lib/libvirt/dnsmasq 0755 root root
/var/lib/libvirt/boot 0755 root root
/var/cache/libvirt/qemu 0755 root root"
post_patch() {
# Upstream doesn't want to accept this patch from Alpine, but libvirt
# is broken on musl without it, so apply it only for musl
if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
patch -Np0 < ${FILESDIR}/musl-fork-nofree.patch
fi
}
pre_build() {
# racey custom targets; prevent parallelism issues
ninja -C build \
src/remote/lxc_protocol.h \
src/remote/qemu_protocol.h \
src/remote/remote_protocol.h \
src/util/virkeycodetable_linux.h \
src/util/virkeycodetable_osx.h \
src/util/virkeycodetable_win32.h \
src/util/virkeynametable_linux.h \
src/util/virkeynametable_osx.h \
src/util/virkeynametable_win32.h
}
post_install() {
local _services _srv
# runit services; libvirtd is for legacy use
_services="libvirt-generic libvirtd virtqemud virtvboxd virtxend
virtlxcd virtlockd virtlogd virtproxyd virtinterfaced virtnetworkd
virtnodedevd virtnwfilterd virtsecretd virtstoraged"
for _srv in $_services; do
vsv $_srv
done
# Remove unused stuff.
rm -rf ${DESTDIR}/etc/sysconfig
rm -rf ${DESTDIR}/var/log
# workaround for musl not providing an utmpx implementation
if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
echo "remember_owner = 0" >> ${DESTDIR}/etc/libvirt/qemu.conf
fi
}
libvirt-devel_package() {
depends="libvirt>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove usr/lib/pkgconfig
vmove "usr/lib/*.so"
vmove usr/share/doc
}
}