1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-18 08:02:48 +00:00

emulators/qemu: Add tools FLAVOR

This commit is contained in:
Muhammad Moinur Rahman 2021-12-11 21:18:49 -06:00
parent e438f2b02f
commit 42780ffaee
3 changed files with 116 additions and 22 deletions

View File

@ -2,37 +2,46 @@
PORTNAME= qemu
PORTVERSION= 6.1.0
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= emulators
MASTER_SITES= https://download.qemu.org/
DIST_SUBDIR= qemu/${PORTVERSION}
MAINTAINER?= bofh@FreeBSD.org
COMMENT?= QEMU CPU Emulator
MAINTAINER= bofh@FreeBSD.org
COMMENT= QEMU CPU Emulator
LICENSE= GPLv2
BUILD_DEPENDS= bash:shells/bash
LIB_DEPENDS?= libepoxy.so:graphics/libepoxy \
.if ${FLAVOR:U} != tools
LIB_DEPENDS= libepoxy.so:graphics/libepoxy \
libfdt.so:sysutils/dtc \
libfontconfig.so:x11-fonts/fontconfig \
libfreetype.so:print/freetype2 \
libnettle.so:security/nettle \
libpcre2-8.so:devel/pcre2 \
libzstd.so:archivers/zstd
.endif
FLAVORS= default nox11
default_CONFLICTS_INSTALL= qemu5* qemu42 qemu-devel
FLAVORS= default nox11 tools
FLAVOR?= ${FLAVORS:[1]}
default_CONFLICTS_INSTALL= qemu5* qemu42 qemu-devel qemu-nox11 qemu-tools qemu-utils
nox11_PKGNAMESUFFIX= -nox11
nox11_CONFLICTS_INSTALL= qemu5* qemu42 qemu-devel
nox11_CONFLICTS_INSTALL= qemu5* qemu42 qemu-devel qemu
nox11_COMMENT= (without X11)
tools_PKGNAMESUFFIX= -tools
tools_COMMENT= (tools only)
tools_CONFLICTS_INSTALL= qemu5* qemu42 qemu-devel qemu-nox11 qemu qemu-utils
tools_DESCR= ${.CURDIR}/pkg-descr-tools
tools_PLIST= ${.CURDIR}/pkg-plist-tools
.if !defined(PKGNAMESUFFIX) || (${PKGNAMESUFFIX} != "-utils" && ${PKGNAMESUFFIX} != "-guest-agent")
ONLY_FOR_ARCHS= amd64 powerpc powerpc64 powerpc64 powerpc64le
USES= bison compiler:c11 cpe gmake gnome iconv:wchar_t ninja perl5 \
pkgconfig python:build tar:xz xorg
USE_GNOME= cairo glib20 libxml2
USES= cpe gmake gnome ninja perl5 pkgconfig python:build tar:xz
USE_GNOME= glib20
USE_PERL5= build
.if (empty(FLAVOR) || ${FLAVOR:U} == nox11) && (${FLAVOR:U} != tools || ${PKGNAMESUFFIX} != "-guest-agent")
ONLY_FOR_ARCHS= amd64 powerpc powerpc64 powerpc64 powerpc64le
USES+= bison compiler:c11 iconv:wchar_t xorg
USE_GNOME= cairo libxml2
USE_PYTHON= distutils noflavors
USE_XORG= pixman
.endif
@ -42,11 +51,17 @@ HAS_CONFIGURE= yes
OPTIONS_SINGLE= NCURSES
OPTIONS_SINGLE_NCURSES= NCURSES_DEFAULT NCURSES_BASE NCURSES_PORT
OPTIONS_DEFINE= SAMBA X11 GTK3 OPENGL GNUTLS SASL JPEG PNG CURL VDE \
CDROM_DMA USBREDIR X86_TARGETS STATIC_LINK DOCS ISCSI CAPSTONE DEBUG
CDROM_DMA USBREDIR X86_TARGETS STATIC_LINK DOCS ISCSI CAPSTONE DEBUG \
STRIP
OPTIONS_DEFAULT=X11 GTK3 OPENGL GNUTLS SASL JPEG PNG CDROM_DMA CURL NCURSES_DEFAULT VDE
.if ${FLAVOR:U} == nox11
OPTIONS_EXCLUDE:= GTK3 X11
.endif
.if ${FLAVOR:U} == tools
OPTIONS_EXCLUDE:= SAMBA X11 GTK3 OPENGL GNUTLS SASL JPEG PNG CURL VDE \
CDROM_DMA USBREDIR X86_TARGETS STATIC_LINK ISCSI CAPSTONE DEBUG \
NCURSES_DEFAULT NCURSES_BASE NCURSES_PORT NCURSES
.endif
OPTIONS_SUB= yes
CAPSTONE_DESC= Disassembly framework support
CDROM_DMA_DESC= IDE CDROM DMA
@ -97,6 +112,7 @@ SASL_LIB_DEPENDS= libsasl2.so:security/cyrus-sasl2
STATIC_LINK_CONFIGURE_ON= --static
STATIC_LINK_PREVENTS= GTK3 X11
STATIC_LINK_PREVENTS_MSG= X11 ui cannot be built static
STRIP_CONFIGURE_OFF= --disable-strip
USBREDIR_BUILD_DEPENDS= usbredir>=0.6:net/usbredir
USBREDIR_CONFIGURE_OFF= --disable-usb-redir
USBREDIR_RUN_DEPENDS= usbredir>=0.6:net/usbredir
@ -105,31 +121,49 @@ VDE_LIB_DEPENDS= libvdeplug.so:net/vde2
X11_CONFIGURE_ENABLE= sdl
X11_USE= SDL=sdl2 XORG=x11,xext GNOME=gdkpixbuf2
X11_USES= sdl
.if !defined(PKGNAMESUFFIX) || (${PKGNAMESUFFIX} != "-utils" && ${PKGNAMESUFFIX} != "-guest-agent")
.if (empty(FLAVOR) || ${FLAVOR:U} == nox11) && (${FLAVOR:U} != tools || ${PKGNAMESUFFIX} != "-guest-agent")
X86_TARGETS_USE_OFF= XORG=pixman,x11
X86_TARGETS_USES_OFF= xorg
X86_TARGETS_CONFIGURE_ON= --target-list='i386-softmmu i386-bsd-user x86_64-softmmu x86_64-bsd-user'
.endif
PORTDOCS?= .buildinfo _static/* about/* devel/* docs genindex.html \
PORTDOCS= .buildinfo _static/* about/* devel/* docs genindex.html \
index.html interop/* objects.inv search.html searchindex.js \
specs/* system/* tools/* user/*
WITHOUT_CPU_CFLAGS=yes #to avoid problems with register allocation
CFLAGS:= ${CFLAGS:C/-fno-tree-vrp//}
CONFIGURE_ARGS?=--localstatedir=/var --extra-ldflags=-L/usr/lib \
CONFIGURE_ARGS+=--localstatedir=/var --extra-ldflags=-L/usr/lib \
--extra-ldflags=-L${LOCALBASE}/lib \
--prefix=${PREFIX} --cc=${CC} --enable-netmap --disable-kvm \
--prefix=${PREFIX} --cc=${CC} --disable-kvm \
--disable-linux-user --disable-linux-aio --disable-xen \
--python=${PYTHON_CMD} --enable-fdt=system \
--python=${PYTHON_CMD} \
--extra-cflags=-I${WRKSRC}\ -I${LOCALBASE}/include\ -DPREFIX=\\\"\"${PREFIX}\\\"\"
.if ${FLAVOR:U} != tools
CONFIGURE_ARGS+=--enable-netmap --enable-fdt=system
.endif
.if ${FLAVOR:U} == tools
CONFIGURE_ARGS+=--disable-netmap --disable-system \
--disable-user --disable-guest-agent \
--disable-nettle --disable-gcrypt \
--disable-curses --disable-vnc \
--disable-virtfs --disable-brlapi \
--disable-fdt --disable-rdma \
--disable-cap-ng --disable-attr \
--disable-vhost-net --disable-spice \
--disable-rbd --disable-libnfs \
--disable-smartcard --disable-libusb \
--disable-lzo --disable-snappy \
--disable-bzip2 --disable-seccomp \
--disable-coroutine-pool --disable-glusterfs \
--disable-tpm --disable-numa \
--disable-blobs --enable-tools
.endif
.include <bsd.port.options.mk>
.if !defined(STRIP) || ${STRIP} == ""
CONFIGURE_ARGS+=--disable-strip
.endif
.if (empty(FLAVOR) || ${FLAVOR:U} == nox11) && (${FLAVOR:U} != tools || ${PKGNAMESUFFIX} != "-guest-agent")
.if ${ARCH} == "amd64"
MAKE_ARGS+= ARCH=x86_64
.endif
@ -149,6 +183,7 @@ CONFIGURE_ARGS+= --sparc_cpu=v9
.endif
PLIST_SUB+= LINUXBOOT_DMA=""
.endif
post-patch-CDROM_DMA-off:
@${REINPLACE_CMD} -e '/USE_DMA_CDROM/d' ${WRKSRC}/include/hw/ide/internal.h
@ -161,9 +196,11 @@ do-install:
.if !target(post-install)
post-install:
.if ${FLAVOR:U} != tools
${INSTALL_SCRIPT} ${FILESDIR}/qemu-ifup.sample ${STAGEDIR}${PREFIX}/etc
${INSTALL_SCRIPT} ${FILESDIR}/qemu-ifdown.sample ${STAGEDIR}${PREFIX}/etc
@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/qemu-*
.endif
post-install-DOCS-on:
@(cd ${WRKSRC} && ${COPYTREE_SHARE} docs ${STAGEDIR}${DOCSDIR}/)

View File

@ -0,0 +1,7 @@
Miscellaneous tools that can be used without the rest of QEMU
* qemu-img: QEMU disk image utility
* qemu-io: QEMU disk exerciser
* qemu-nbd: QEMU disk network block device server
WWW: http://wiki.qemu.org/Main_Page

View File

@ -0,0 +1,50 @@
bin/qemu-edid
bin/qemu-img
bin/qemu-io
bin/qemu-nbd
bin/qemu-storage-daemon
include/qemu-plugin.h
%%PORTDOCS%%man/man1/qemu.1.gz
%%PORTDOCS%%man/man1/qemu-img.1.gz
%%PORTDOCS%%man/man7/qemu-block-drivers.7.gz
%%PORTDOCS%%man/man7/qemu-cpu-models.7.gz
%%PORTDOCS%%man/man8/qemu-nbd.8.gz
%%PORTDOCS%%man/man8/qemu-pr-helper.8.gz
%%PORTDOCS%%man/man7/qemu-qmp-ref.7.gz
%%PORTDOCS%%man/man1/qemu-storage-daemon.1.gz
%%PORTDOCS%%man/man7/qemu-storage-daemon-qmp-ref.7.gz
%%DATADIR%%/keymaps/ar
%%DATADIR%%/keymaps/bepo
%%DATADIR%%/keymaps/cz
%%DATADIR%%/keymaps/da
%%DATADIR%%/keymaps/de
%%DATADIR%%/keymaps/de-ch
%%DATADIR%%/keymaps/en-gb
%%DATADIR%%/keymaps/en-us
%%DATADIR%%/keymaps/es
%%DATADIR%%/keymaps/et
%%DATADIR%%/keymaps/fi
%%DATADIR%%/keymaps/fo
%%DATADIR%%/keymaps/fr
%%DATADIR%%/keymaps/fr-be
%%DATADIR%%/keymaps/fr-ca
%%DATADIR%%/keymaps/fr-ch
%%DATADIR%%/keymaps/hr
%%DATADIR%%/keymaps/hu
%%DATADIR%%/keymaps/is
%%DATADIR%%/keymaps/it
%%DATADIR%%/keymaps/ja
%%DATADIR%%/keymaps/lt
%%DATADIR%%/keymaps/lv
%%DATADIR%%/keymaps/mk
%%DATADIR%%/keymaps/nl
%%DATADIR%%/keymaps/no
%%DATADIR%%/keymaps/pl
%%DATADIR%%/keymaps/pt
%%DATADIR%%/keymaps/pt-br
%%DATADIR%%/keymaps/ru
%%DATADIR%%/keymaps/sl
%%DATADIR%%/keymaps/sv
%%DATADIR%%/keymaps/th
%%DATADIR%%/keymaps/tr
%%DATADIR%%/trace-events-all