Lines 1-133
Link Here
|
1 |
# Created by: Juergen Lock <nox@jelal.kn-bremen.de> |
|
|
2 |
# $FreeBSD$ |
1 |
# $FreeBSD$ |
3 |
|
2 |
|
4 |
PORTNAME= qemu |
3 |
PORTNAME= qemu |
5 |
PORTVERSION= 2.11.50.g20191112 |
4 |
PORTVERSION= 3.1.0 |
6 |
CATEGORIES= emulators |
5 |
CATEGORIES= emulators |
7 |
PKGNAMESUFFIX?= -sbruno |
6 |
PKGNAMESUFFIX= -user-static-devel |
8 |
DIST_SUBDIR= qemu/${PORTVERSION} |
7 |
DIST_SUBDIR= qemu/${PORTVERSION} |
9 |
|
8 |
|
10 |
MAINTAINER= sbruno@FreeBSD.org |
9 |
MAINTAINER= emulation@FreeBSD.org |
11 |
COMMENT?= QEMU CPU Emulator - github bsd-user branch |
10 |
COMMENT= QEMU CPU Emulator (github bsd-user branch) |
12 |
|
11 |
|
13 |
LICENSE= GPLv2 |
12 |
LICENSE= GPLv2 |
|
|
13 |
LICENSE_FILE= ${WRKSRC}/COPYING |
14 |
|
15 |
ONLY_FOR_ARCHS= amd64 powerpc powerpc64 |
16 |
CONFLICTS_INSTALL= qemu-user-static-[0-9]* |
17 |
|
18 |
USES= bison compiler:c11 gmake perl5 pkgconfig python:2.7,build |
14 |
USE_GITHUB= yes |
19 |
USE_GITHUB= yes |
15 |
GH_TUPLE= seanbruno:qemu-bsd-user:b581800 \ |
20 |
GH_TUPLE= seanbruno:qemu-bsd-user:0337421f238 \ |
16 |
qemu:keycodemapdb:10739aa:keycodemapdb/ui/keycodemapdb |
21 |
qemu:keycodemapdb:10739aa:keycodemapdb/ui/keycodemapdb |
17 |
HAS_CONFIGURE= yes |
22 |
HAS_CONFIGURE= yes |
18 |
USES= bison compiler:c11 gmake perl5 pkgconfig python:2.7,build |
|
|
19 |
USE_PERL5= build |
23 |
USE_PERL5= build |
20 |
MAKE_ENV+= BSD_MAKE="${MAKE}" V=1 |
24 |
MAKE_ENV+= BSD_MAKE="${MAKE}" V=1 |
21 |
|
25 |
|
22 |
ONLY_FOR_ARCHS= amd64 powerpc powerpc64 # XXX someone wants to debug sparc64 hosts? |
|
|
23 |
BROKEN_i386= aarch64 system target is currently broken for i386 hosts, disable for now while dealing with upstream |
24 |
|
25 |
OPTIONS_DEFINE= SAMBA X11 GTK2 OPENGL GNUTLS SASL JPEG PNG CURL \ |
26 |
CDROM_DMA PCAP USBREDIR X86_TARGETS BSD_USER \ |
27 |
STATIC_LINK DOCS |
28 |
SAMBA_DESC= samba dependency (for -smb) |
29 |
GNUTLS_DESC= gnutls dependency (vnc encryption) |
30 |
SASL_DESC= cyrus-sasl dependency (vnc encryption) |
31 |
JPEG_DESC= jpeg dependency (vnc lossy compression) |
32 |
PNG_DESC= png dependency (vnc compression) |
33 |
CDROM_DMA_DESC= IDE CDROM DMA |
34 |
PCAP_DESC= pcap dependency (networking with bpf) |
35 |
USBREDIR_DESC= usb device network redirection (experimental!) |
36 |
X86_TARGETS_DESC= Don't build non-x86 system targets |
37 |
BSD_USER_DESC= Also build bsd-user targets (for testing) |
38 |
STATIC_LINK_DESC= Statically link the executables |
39 |
OPTIONS_DEFAULT=X11 GTK2 OPENGL GNUTLS SASL JPEG PNG CDROM_DMA CURL PCAP |
40 |
|
41 |
.if !defined(QEMU_USER_STATIC) |
42 |
CONFLICTS_INSTALL= qemu-[0-9]* qemu-devel-* |
43 |
.endif |
44 |
|
45 |
.if defined(QEMU_USER_STATIC) |
46 |
.if exists(/usr/sbin/binmiscctl) |
47 |
USE_RC_SUBR= qemu_user_static |
26 |
USE_RC_SUBR= qemu_user_static |
48 |
SUB_LIST= NAME=qemu_user_static |
27 |
SUB_LIST= NAME=qemu_user_static |
49 |
CONFIGURE_ARGS+= --disable-tools |
|
|
50 |
.endif |
51 |
.else |
52 |
# qemu-system-* targets require pixman to build, add an explicit dependency. |
53 |
USES+= xorg |
54 |
USE_XORG= pixman |
55 |
.endif |
56 |
|
28 |
|
57 |
# When static linking we have a build dependency on libglib-2.0.a, otherwise |
29 |
# When static linking we have a build dependency on libglib-2.0.a, otherwise |
58 |
# we use glib20 in the usual way (shared-lib runtime dependency). |
30 |
# we use glib20 in the usual way (shared-lib runtime dependency). |
59 |
.if defined(QEMU_USER_STATIC) |
|
|
60 |
BUILD_DEPENDS+= ${LOCALBASE}/lib/libglib-2.0.a:devel/glib20 |
31 |
BUILD_DEPENDS+= ${LOCALBASE}/lib/libglib-2.0.a:devel/glib20 |
61 |
.else |
|
|
62 |
USES+= gnome |
63 |
USE_GNOME+= glib20 |
64 |
BUILD_DEPENDS+= ${LOCALBASE}/lib/libfdt.so:sysutils/dtc |
65 |
.endif |
66 |
|
32 |
|
67 |
.include <bsd.port.options.mk> |
33 |
.include <bsd.port.pre.mk> |
68 |
|
34 |
|
69 |
CONFIGURE_ARGS+= --localstatedir=/var |
35 |
CONFIGURE_ARGS+= --localstatedir=/var |
70 |
CONFIGURE_ARGS+= --extra-ldflags=-L${LOCALBASE}/lib |
36 |
CONFIGURE_ARGS+= --extra-ldflags=-L${LOCALBASE}/lib |
71 |
CONFIGURE_ARGS+= --extra-cflags=-I${LOCALBASE}/include |
37 |
CONFIGURE_ARGS+= --extra-cflags=-I${LOCALBASE}/include |
72 |
CONFIGURE_ARGS+= --disable-libssh2 |
38 |
CONFIGURE_ARGS+= --disable-libssh2 |
73 |
PORTDOCS= docs qemu-doc.html |
|
|
74 |
|
39 |
|
75 |
.if defined(QEMU_USER_STATIC) |
40 |
QEMU_TARGETS= i386-bsd-user sparc-bsd-user arm-bsd-user mips-bsd-user mipsel-bsd-user ppc-bsd-user |
76 |
.if ${ARCH} != "amd64" |
41 |
.if ${ARCH} == "amd64" |
77 |
CONFIGURE_ARGS+= --target-list=i386-bsd-user,sparc-bsd-user,arm-bsd-user,mips-bsd-user,mipsel-bsd-user,ppc-bsd-user |
42 |
QEMU_TARGETS+= x86_64-bsd-user riscv64-bsd-user sparc64-bsd-user mips64-bsd-user mips64el-bsd-user ppc64-bsd-user aarch64-bsd-user |
|
|
43 |
PLIST_SUB+= 64BIT="" |
78 |
.else |
44 |
.else |
79 |
CONFIGURE_ARGS+= --target-list=i386-bsd-user,x86_64-bsd-user,sparc-bsd-user,sparc64-bsd-user,arm-bsd-user,mips-bsd-user,mipsel-bsd-user,mips64-bsd-user,mips64el-bsd-user,ppc-bsd-user,ppc64-bsd-user,aarch64-bsd-user |
45 |
PLIST_SUB+= 64BIT="@comment " |
80 |
.endif |
46 |
.endif |
81 |
.else |
47 |
CONFIGURE_ARGS+= --target-list=${QEMU_TARGETS:ts,} |
82 |
.if ${PORT_OPTIONS:MX86_TARGETS} |
|
|
83 |
.if ${PORT_OPTIONS:MBSD_USER} |
84 |
.if ${ARCH} != "amd64" |
85 |
CONFIGURE_ARGS+= --target-list=i386-softmmu,x86_64-softmmu,i386-bsd-user,sparc-bsd-user,arm-bsd-user,mips-bsd-user,mipsel-bsd-user,ppc-bsd-user |
86 |
.else |
87 |
CONFIGURE_ARGS+= --target-list=i386-softmmu,x86_64-softmmu,i386-bsd-user,x86_64-bsd-user,sparc-bsd-user,sparc64-bsd-user,arm-bsd-user,mips-bsd-user,mipsel-bsd-user,mips64-bsd-user,mips64el-bsd-user,ppc-bsd-user,ppc64-bsd-user,aarch64-bsd-user |
88 |
.endif |
89 |
.else |
90 |
CONFIGURE_ARGS+= --target-list=i386-softmmu,x86_64-softmmu |
91 |
.endif |
92 |
.else |
93 |
.if empty(PORT_OPTIONS:MBSD_USER) |
94 |
CONFIGURE_ARGS+= --disable-bsd-user |
95 |
.else |
96 |
.if ${ARCH} != "amd64" |
97 |
CONFIGURE_ARGS+= --target-list=i386-softmmu,x86_64-softmmu,aarch64-softmmu,alpha-softmmu,arm-softmmu,cris-softmmu,lm32-softmmu,m68k-softmmu,microblaze-softmmu,microblazeel-softmmu,mips-softmmu,mipsel-softmmu,mips64-softmmu,mips64el-softmmu,or32-softmmu,ppc-softmmu,ppcemb-softmmu,ppc64-softmmu,sh4-softmmu,sh4eb-softmmu,sparc-softmmu,sparc64-softmmu,s390x-softmmu,xtensa-softmmu,xtensaeb-softmmu,unicore32-softmmu,moxie-softmmu,i386-bsd-user,sparc-bsd-user,arm-bsd-user,mips-bsd-user,mipsel-bsd-user,ppc-bsd-user |
98 |
.endif |
99 |
.endif |
100 |
.endif |
101 |
.endif |
102 |
|
48 |
|
103 |
.if empty(PORT_OPTIONS:MBSD_USER) |
|
|
104 |
PLIST_SUB+= BSD_USER="@comment " |
105 |
.else |
106 |
PLIST_SUB+= BSD_USER="" |
107 |
.if ${ARCH} == "sparc64" |
108 |
IGNORE= bsd-user targets not tested on sparc64 |
109 |
.endif |
110 |
.endif |
111 |
.if empty(PORT_OPTIONS:MBSD_USER) || ${ARCH} != "amd64" |
112 |
PLIST_SUB+= BSD_USER64="@comment " |
113 |
.else |
114 |
PLIST_SUB+= BSD_USER64="" |
115 |
.endif |
116 |
|
117 |
.if ${PORT_OPTIONS:MX86_TARGETS} |
118 |
PLIST_SUB+= NONX86="@comment " |
119 |
.else |
120 |
PLIST_SUB+= NONX86="" |
121 |
.endif |
122 |
|
123 |
.if defined(QEMU_USER_STATIC) |
124 |
PLIST_SUB+= SOFTMMU="@comment " |
125 |
PLIST_SUB+= STATIC="-static" |
126 |
.else |
127 |
PLIST_SUB+= SOFTMMU="" |
128 |
PLIST_SUB+= STATIC="" |
129 |
.endif |
130 |
|
131 |
SSP_CFLAGS?= -fstack-protector # XXX -strong crashes qemu-user-static |
49 |
SSP_CFLAGS?= -fstack-protector # XXX -strong crashes qemu-user-static |
132 |
WITHOUT_CPU_CFLAGS=yes #to avoid problems with register allocation |
50 |
WITHOUT_CPU_CFLAGS=yes #to avoid problems with register allocation |
133 |
CFLAGS:= ${CFLAGS:C/-fno-tree-vrp//} |
51 |
CFLAGS:= ${CFLAGS:C/-fno-tree-vrp//} |
Lines 139-266
Link Here
|
139 |
--smbd=${LOCALBASE}/sbin/smbd \ |
57 |
--smbd=${LOCALBASE}/sbin/smbd \ |
140 |
--enable-debug \ |
58 |
--enable-debug \ |
141 |
--enable-debug-info \ |
59 |
--enable-debug-info \ |
|
|
60 |
--static \ |
61 |
--python=${PYTHON_CMD} \ |
62 |
--disable-sdl --disable-gtk --disable-vte --disable-gnutls --disable-vnc \ |
63 |
--disable-curl --disable-opengl --disable-usb-redir --disable-pcap \ |
64 |
--disable-docs --disable-tools --disable-system --disable-guest-agent \ |
142 |
--extra-cflags=-I${WRKSRC}\ -I${LOCALBASE}/include\ -DPREFIX=\\\"\"${PREFIX}\\\"\" |
65 |
--extra-cflags=-I${WRKSRC}\ -I${LOCALBASE}/include\ -DPREFIX=\\\"\"${PREFIX}\\\"\" |
143 |
|
66 |
|
144 |
.if empty(PORT_OPTIONS:MX11) |
67 |
QEMU_ARCH= ${ARCH:C/amd64/x86_64/:C/powerpc/ppc/} |
145 |
CONFIGURE_ARGS+= --disable-sdl |
68 |
MAKE_ARGS+= ARCH=${QEMU_ARCH} |
146 |
.else |
|
|
147 |
CONFIGURE_ARGS+= --enable-sdl |
148 |
USES+= sdl |
149 |
USE_SDL= sdl |
150 |
.endif |
151 |
|
69 |
|
152 |
.if empty(PORT_OPTIONS:MGTK2) |
|
|
153 |
CONFIGURE_ARGS+= --disable-gtk --disable-vte |
154 |
PLIST_SUB+= GTK2="@comment " |
155 |
.else |
156 |
USE_GNOME+= gtk20 vte |
157 |
USES+= gettext gnome |
158 |
PLIST_SUB+= GTK2="" |
159 |
.endif |
160 |
|
161 |
.if ${PORT_OPTIONS:MGNUTLS} |
162 |
LIB_DEPENDS+= libgnutls.so:security/gnutls |
163 |
CONFIGURE_ARGS+= --enable-gnutls |
164 |
.else |
165 |
CONFIGURE_ARGS+= --disable-gnutls |
166 |
.endif |
167 |
|
168 |
.if empty(PORT_OPTIONS:MSASL) |
169 |
CONFIGURE_ARGS+= --disable-vnc-sasl |
170 |
.else |
171 |
LIB_DEPENDS+= libsasl2.so:security/cyrus-sasl2 |
172 |
.endif |
173 |
|
174 |
.if empty(PORT_OPTIONS:MJPEG) |
175 |
CONFIGURE_ARGS+= --disable-vnc-jpeg |
176 |
.else |
177 |
USES+= jpeg |
178 |
.endif |
179 |
|
180 |
.if empty(PORT_OPTIONS:MPNG) |
181 |
CONFIGURE_ARGS+= --disable-vnc-png |
182 |
.else |
183 |
LIB_DEPENDS+= libpng.so:graphics/png |
184 |
.endif |
185 |
|
186 |
.if empty(PORT_OPTIONS:MCURL) |
187 |
CONFIGURE_ARGS+= --disable-curl |
188 |
.else |
189 |
LIB_DEPENDS+= libcurl.so:ftp/curl |
190 |
.endif |
191 |
|
192 |
.if empty(PORT_OPTIONS:MOPENGL) |
193 |
CONFIGURE_ARGS+= --disable-opengl |
194 |
.else |
195 |
USES+= gl |
196 |
USE_GL= glu |
197 |
.endif |
198 |
|
199 |
.if empty(PORT_OPTIONS:MUSBREDIR) |
200 |
CONFIGURE_ARGS+= --disable-usb-redir |
201 |
.else |
202 |
BUILD_DEPENDS+= usbredir>=0.6:net/usbredir |
203 |
RUN_DEPENDS+= usbredir>=0.6:net/usbredir |
204 |
.endif |
205 |
|
206 |
.if ${PORT_OPTIONS:MPCAP} |
207 |
CONFIGURE_ARGS+= --enable-pcap |
208 |
.else |
209 |
CONFIGURE_ARGS+= --disable-pcap |
210 |
.endif |
211 |
|
212 |
.if ${PORT_OPTIONS:MSTATIC_LINK} |
213 |
.if ${PORT_OPTIONS:MGTK2} || ${PORT_OPTIONS:MX11} |
214 |
IGNORE= the X11 ui cannot be built static |
215 |
.endif |
216 |
CONFIGURE_ARGS+= --static |
217 |
.endif |
218 |
|
219 |
.if ${PORT_OPTIONS:MSAMBA} |
220 |
USES+= samba:run # smbd |
221 |
.endif |
222 |
|
223 |
.if ${PORT_OPTIONS:MDOCS} |
224 |
BUILD_DEPENDS+= texi2html:textproc/texi2html |
225 |
USES+= makeinfo |
226 |
.else |
227 |
MAKE_ARGS+= NOPORTDOCS=1 |
228 |
.endif |
229 |
|
230 |
.if !defined(STRIP) || ${STRIP} == "" |
231 |
CONFIGURE_ARGS+=--disable-strip |
232 |
.endif |
233 |
|
234 |
.if ${ARCH} == "amd64" |
235 |
MAKE_ARGS+= ARCH=x86_64 |
236 |
.endif |
237 |
|
238 |
.if ${ARCH} == "powerpc" |
239 |
MAKE_ARGS+= ARCH=ppc |
240 |
.endif |
241 |
|
242 |
.if ${ARCH} == "powerpc64" |
243 |
MAKE_ARGS+= ARCH=ppc64 |
244 |
.endif |
245 |
|
246 |
.if ${ARCH} == "sparc64" |
247 |
CONFIGURE_ARGS+= --sparc_cpu=v9 |
248 |
.endif |
249 |
|
250 |
CONFIGURE_ARGS+= --python=${PYTHON_CMD} |
251 |
|
252 |
PLIST_SUB+= LINUXBOOT_DMA="" |
253 |
|
254 |
post-patch: |
70 |
post-patch: |
255 |
@${REINPLACE_CMD} -e '/libs_qga=/s|glib_libs|glib_libs -lintl|' ${WRKSRC}/configure |
|
|
256 |
|
257 |
.if empty(PORT_OPTIONS:MCDROM_DMA) |
258 |
@cd ${WRKSRC} && ${PATCH} --quiet < ${FILESDIR}/cdrom-dma-patch |
259 |
.endif |
260 |
@${REINPLACE_CMD} -E \ |
71 |
@${REINPLACE_CMD} -E \ |
261 |
-e "/^by Tibor .TS. S/s|Sch.*z.$$|Schuetz.|" \ |
|
|
262 |
${WRKSRC}/qemu-doc.texi |
263 |
@${REINPLACE_CMD} -E \ |
264 |
-e "s|^(CFLAGS=).*|\1${CFLAGS} -fno-strict-aliasing|" \ |
72 |
-e "s|^(CFLAGS=).*|\1${CFLAGS} -fno-strict-aliasing|" \ |
265 |
-e "s|^(LDFLAGS=).*|\1${LDFLAGS}|" \ |
73 |
-e "s|^(LDFLAGS=).*|\1${LDFLAGS}|" \ |
266 |
${WRKSRC}/Makefile.target |
74 |
${WRKSRC}/Makefile.target |
Lines 268-292
Link Here
|
268 |
-e "s|^(CFLAGS=).*|\1${CFLAGS} -fno-strict-aliasing -I.|" \ |
76 |
-e "s|^(CFLAGS=).*|\1${CFLAGS} -fno-strict-aliasing -I.|" \ |
269 |
-e "s|^(LDFLAGS=).*|\1${LDFLAGS}|" \ |
77 |
-e "s|^(LDFLAGS=).*|\1${LDFLAGS}|" \ |
270 |
${WRKSRC}/Makefile |
78 |
${WRKSRC}/Makefile |
271 |
@${REINPLACE_CMD} -E \ |
|
|
272 |
-e "1s|^(#! )/usr/bin/perl|\1${PERL}|" \ |
273 |
${WRKSRC}/scripts/texi2pod.pl |
274 |
|
79 |
|
275 |
# XXX need to disable usb host code on head while it's not ported to the |
|
|
276 |
# new usb stack yet |
277 |
post-configure: |
278 |
@${REINPLACE_CMD} -E \ |
279 |
-e "s|^(HOST_USB=)bsd|\1stub|" \ |
280 |
${WRKSRC}/config-host.mak |
281 |
|
282 |
.if !target(post-install) |
283 |
post-install: |
80 |
post-install: |
284 |
.if ${PORT_OPTIONS:MDOCS} |
81 |
@${MV} ${STAGEDIR}${PREFIX}/etc/rc.d ${WRKDIR} |
285 |
@(cd ${WRKSRC} && ${COPYTREE_SHARE} docs ${STAGEDIR}${DOCSDIR}/) |
82 |
@${RM} -r ${STAGEDIR}${PREFIX}/etc |
286 |
.endif |
83 |
@${MKDIR} ${STAGEDIR}${PREFIX}/etc |
287 |
${INSTALL_SCRIPT} ${FILESDIR}/qemu-ifup.sample ${STAGEDIR}${PREFIX}/etc |
84 |
@${MV} ${WRKDIR}/rc.d ${STAGEDIR}${PREFIX}/etc |
288 |
${INSTALL_SCRIPT} ${FILESDIR}/qemu-ifdown.sample ${STAGEDIR}${PREFIX}/etc |
85 |
@${RM} -r ${STAGEDIR}${PREFIX}/man |
|
|
86 |
@${RM} -r ${STAGEDIR}${DATADIR} |
289 |
@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/qemu-* |
87 |
@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/qemu-* |
290 |
.endif |
88 |
@(cd ${STAGEDIR}${PREFIX}/bin && \ |
|
|
89 |
for i in qemu-*; do ${MV} -i $$i $$i-static; done) |
291 |
|
90 |
|
292 |
.include <bsd.port.mk> |
91 |
.include <bsd.port.post.mk> |