Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/virtualbox/
Date: Mon, 16 Jul 2018 09:46:38
Message-Id: 1531734386.267e77beaacd5e24733d9840a8680e3a47ffb04e.polynomial-c@gentoo
1 commit: 267e77beaacd5e24733d9840a8680e3a47ffb04e
2 Author: meierfra <meierfra <AT> users <DOT> noreply <DOT> github <DOT> com>
3 AuthorDate: Mon Jul 16 08:53:45 2018 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Mon Jul 16 09:46:26 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=267e77be
7
8 Install UnattendedTemplates with VirtualBox
9
10 also install the directory /usr/share/virtualbox/UnattendedTemplates/ with VirtualBox
11 Closes: https://github.com/gentoo/gentoo/pull/9246
12
13 .../virtualbox/virtualbox-5.2.14-r1.ebuild | 469 +++++++++++++++++++++
14 1 file changed, 469 insertions(+)
15
16 diff --git a/app-emulation/virtualbox/virtualbox-5.2.14-r1.ebuild b/app-emulation/virtualbox/virtualbox-5.2.14-r1.ebuild
17 new file mode 100644
18 index 00000000000..d907a7f0553
19 --- /dev/null
20 +++ b/app-emulation/virtualbox/virtualbox-5.2.14-r1.ebuild
21 @@ -0,0 +1,469 @@
22 +# Copyright 1999-2018 Gentoo Foundation
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=6
26 +
27 +PYTHON_COMPAT=( python2_7 )
28 +inherit flag-o-matic java-pkg-opt-2 linux-info multilib pax-utils python-single-r1 tmpfiles toolchain-funcs udev xdg-utils
29 +
30 +MY_PV="${PV/beta/BETA}"
31 +MY_PV="${MY_PV/rc/RC}"
32 +MY_P=VirtualBox-${MY_PV}
33 +
34 +DESCRIPTION="Family of powerful x86 virtualization products for enterprise and home use"
35 +HOMEPAGE="https://www.virtualbox.org/"
36 +SRC_URI="https://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.tar.bz2
37 + https://dev.gentoo.org/~polynomial-c/${PN}/patchsets/${PN}-5.2.12-patches-01.tar.xz"
38 +
39 +LICENSE="GPL-2"
40 +SLOT="0"
41 +KEYWORDS="~amd64 ~x86"
42 +IUSE="alsa debug doc headless java libressl lvm pam pax_kernel pulseaudio +opengl python +qt5 +sdk +udev vboxwebsrv vnc"
43 +
44 +RDEPEND="!app-emulation/virtualbox-bin
45 + ~app-emulation/virtualbox-modules-${PV}
46 + dev-libs/libIDL
47 + >=dev-libs/libxslt-1.1.19
48 + net-misc/curl
49 + dev-libs/libxml2
50 + media-libs/libpng:0=
51 + media-libs/libvpx:0=
52 + sys-libs/zlib
53 + !headless? (
54 + media-libs/libsdl:0[X,video]
55 + x11-libs/libX11
56 + x11-libs/libXcursor
57 + x11-libs/libXext
58 + x11-libs/libXmu
59 + x11-libs/libXt
60 + opengl? ( virtual/opengl media-libs/freeglut )
61 + qt5? (
62 + dev-qt/qtcore:5
63 + dev-qt/qtgui:5
64 + dev-qt/qtprintsupport:5
65 + dev-qt/qtwidgets:5
66 + dev-qt/qtx11extras:5
67 + opengl? ( dev-qt/qtopengl:5 )
68 + x11-libs/libXinerama
69 + )
70 + )
71 + libressl? ( dev-libs/libressl:= )
72 + !libressl? ( dev-libs/openssl:0= )
73 + lvm? ( sys-fs/lvm2 )
74 + udev? ( >=virtual/udev-171 )
75 + vnc? ( >=net-libs/libvncserver-0.9.9 )"
76 +DEPEND="${RDEPEND}
77 + >=dev-util/kbuild-0.1.9998.3127
78 + >=dev-lang/yasm-0.6.2
79 + sys-devel/bin86
80 + sys-libs/libcap
81 + sys-power/iasl
82 + virtual/pkgconfig
83 + alsa? ( >=media-libs/alsa-lib-1.0.13 )
84 + doc? (
85 + app-text/docbook-sgml-dtd:4.4
86 + dev-texlive/texlive-basic
87 + dev-texlive/texlive-latex
88 + dev-texlive/texlive-latexrecommended
89 + dev-texlive/texlive-latexextra
90 + dev-texlive/texlive-fontsrecommended
91 + dev-texlive/texlive-fontsextra
92 + )
93 + !headless? ( x11-libs/libXinerama )
94 + java? ( >=virtual/jdk-1.6 )
95 + pam? ( sys-libs/pam )
96 + pax_kernel? ( sys-apps/elfix )
97 + pulseaudio? ( media-sound/pulseaudio )
98 + qt5? ( dev-qt/linguist-tools:5 )
99 + vboxwebsrv? ( net-libs/gsoap[-gnutls(-)] )
100 + ${PYTHON_DEPS}"
101 +RDEPEND="${RDEPEND}
102 + java? ( >=virtual/jre-1.6 )"
103 +
104 +QA_TEXTRELS_x86="usr/lib/virtualbox-ose/VBoxGuestPropSvc.so
105 + usr/lib/virtualbox/VBoxSDL.so
106 + usr/lib/virtualbox/VBoxSharedFolders.so
107 + usr/lib/virtualbox/VBoxDD2.so
108 + usr/lib/virtualbox/VBoxOGLrenderspu.so
109 + usr/lib/virtualbox/VBoxPython.so
110 + usr/lib/virtualbox/VBoxDD.so
111 + usr/lib/virtualbox/VBoxDDU.so
112 + usr/lib/virtualbox/VBoxREM64.so
113 + usr/lib/virtualbox/VBoxSharedClipboard.so
114 + usr/lib/virtualbox/VBoxHeadless.so
115 + usr/lib/virtualbox/VBoxRT.so
116 + usr/lib/virtualbox/VBoxREM.so
117 + usr/lib/virtualbox/VBoxSettings.so
118 + usr/lib/virtualbox/VBoxKeyboard.so
119 + usr/lib/virtualbox/VBoxSharedCrOpenGL.so
120 + usr/lib/virtualbox/VBoxVMM.so
121 + usr/lib/virtualbox/VirtualBox.so
122 + usr/lib/virtualbox/VBoxOGLhosterrorspu.so
123 + usr/lib/virtualbox/components/VBoxC.so
124 + usr/lib/virtualbox/components/VBoxSVCM.so
125 + usr/lib/virtualbox/components/VBoxDDU.so
126 + usr/lib/virtualbox/components/VBoxRT.so
127 + usr/lib/virtualbox/components/VBoxREM.so
128 + usr/lib/virtualbox/components/VBoxVMM.so
129 + usr/lib/virtualbox/VBoxREM32.so
130 + usr/lib/virtualbox/VBoxPython2_7.so
131 + usr/lib/virtualbox/VBoxXPCOMC.so
132 + usr/lib/virtualbox/VBoxOGLhostcrutil.so
133 + usr/lib/virtualbox/VBoxNetDHCP.so
134 + usr/lib/virtualbox/VBoxNetNAT.so"
135 +
136 +S="${WORKDIR}/${MY_P}"
137 +
138 +REQUIRED_USE="
139 + java? ( sdk )
140 + python? ( sdk )
141 + vboxwebsrv? ( java )
142 + ${PYTHON_REQUIRED_USE}
143 +"
144 +
145 +pkg_setup() {
146 + if ! use headless && ! use qt5 ; then
147 + einfo "No USE=\"qt5\" selected, this build will not include any Qt frontend."
148 + elif use headless && use qt5 ; then
149 + einfo "You selected USE=\"headless qt5\", defaulting to"
150 + einfo "USE=\"headless\", this build will not include any X11/Qt frontend."
151 + fi
152 +
153 + if ! use opengl ; then
154 + einfo "No USE=\"opengl\" selected, this build will lack"
155 + einfo "the OpenGL feature."
156 + fi
157 + if ! use python ; then
158 + einfo "You have disabled the \"python\" USE flag. This will only"
159 + einfo "disable the python bindings being installed."
160 + fi
161 + java-pkg-opt-2_pkg_setup
162 + python-single-r1_pkg_setup
163 +
164 + tc-ld-disable-gold #bug 488176
165 + tc-export CC CXX LD AR RANLIB
166 + export HOST_CC="$(tc-getBUILD_CC)"
167 +}
168 +
169 +src_prepare() {
170 + # Remove shipped binaries (kBuild,yasm), see bug #232775
171 + rm -r kBuild/bin tools || die
172 +
173 + # Replace pointless GCC version check with something less stupid.
174 + # This is needed for the qt5 version check.
175 + sed -e 's@^check_gcc$@cc_maj="$(gcc -dumpversion | cut -d. -f1)" ; cc_min="$(gcc -dumpversion | cut -d. -f2)"@' \
176 + -i configure || die
177 +
178 + # Don't use "echo -n"
179 + sed 's@ECHO_N="echo -n"@ECHO_N="printf"@' -i configure || die
180 +
181 + # Disable things unused or split into separate ebuilds
182 + sed -e "s@MY_LIBDIR@$(get_libdir)@" \
183 + "${FILESDIR}"/${PN}-5-localconfig > LocalConfig.kmk || die
184 +
185 + # Respect LDFLAGS
186 + sed -e "s@_LDFLAGS\.${ARCH}*.*=@& ${LDFLAGS}@g" \
187 + -i Config.kmk src/libs/xpcom18a4/Config.kmk || die
188 +
189 + # Do not use hard-coded ld (related to bug #488176)
190 + sed -e '/QUIET)ld /s@ld @$(LD) @' \
191 + -i src/VBox/Devices/PC/ipxe/Makefile.kmk || die
192 +
193 + # Use PAM only when pam USE flag is enbaled (bug #376531)
194 + if ! use pam ; then
195 + elog "Disabling PAM removes the possibility to use the VRDP features."
196 + sed -i 's@^.*VBOX_WITH_PAM@#VBOX_WITH_PAM@' Config.kmk || die
197 + sed -i 's@\(.*/auth/Makefile.kmk.*\)@#\1@' \
198 + src/VBox/HostServices/Makefile.kmk || die
199 + fi
200 +
201 + # add correct java path
202 + if use java ; then
203 + sed "s@/usr/lib/jvm/java-6-sun@$(java-config -O)@" \
204 + -i "${S}"/Config.kmk || die
205 + java-pkg-opt-2_src_prepare
206 + fi
207 +
208 + # Only add nopie patch when we're on hardened
209 + if gcc-specs-pie ; then
210 + eapply "${FILESDIR}/050_virtualbox-5.2.8-nopie.patch"
211 + fi
212 +
213 + # Only add paxmark patch when we're on pax_kernel
214 + if use pax_kernel ; then
215 + eapply "${FILESDIR}"/virtualbox-5.2.8-paxmark-bldprogs.patch
216 + fi
217 +
218 + eapply "${WORKDIR}/patches"
219 +
220 + eapply_user
221 +}
222 +
223 +src_configure() {
224 + local myconf=(
225 + --with-gcc="$(tc-getCC)"
226 + --with-g++="$(tc-getCXX)"
227 + --disable-dbus
228 + --disable-kmods
229 + $(usex alsa '' --disable-alsa)
230 + $(usex debug --build-debug '')
231 + $(usex doc '' --disable-docs)
232 + $(usex java '' --disable-java)
233 + $(usex lvm '' --disable-devmapper)
234 + $(usex pulseaudio '' --disable-pulse)
235 + $(usex python '' --disable-python)
236 + $(usex vboxwebsrv --enable-webservice '')
237 + $(usex vnc --enable-vnc '')
238 + )
239 + if ! use headless ; then
240 + myconf+=(
241 + $(usex opengl '' --disable-opengl)
242 + $(usex qt5 '' --disable-qt)
243 + )
244 + else
245 + myconf+=(
246 + --build-headless
247 + --disable-opengl
248 + )
249 + fi
250 + if use amd64 && ! has_multilib_profile ; then
251 + myconf+=( --disable-vmmraw )
252 + fi
253 + # not an autoconf script
254 + ./configure ${myconf[@]} || die "configure failed"
255 +}
256 +
257 +src_compile() {
258 + source ./env.sh || die
259 +
260 + # Force kBuild to respect C[XX]FLAGS and MAKEOPTS (bug #178529)
261 + MAKEJOBS=$(grep -Eo '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+' <<< ${MAKEOPTS}) #'
262 + MAKELOAD=$(grep -Eo '(\-l|\-\-load-average)(=?|[[:space:]]*)[[:digit:]]+' <<< ${MAKEOPTS}) #'
263 + MAKEOPTS="${MAKEJOBS} ${MAKELOAD}"
264 + MAKE="kmk" emake \
265 + VBOX_BUILD_PUBLISHER=_Gentoo \
266 + TOOL_GCC3_CC="$(tc-getCC)" TOOL_GCC3_CXX="$(tc-getCXX)" \
267 + TOOL_GCC3_AS="$(tc-getCC)" TOOL_GCC3_AR="$(tc-getAR)" \
268 + TOOL_GCC3_LD="$(tc-getCXX)" TOOL_GCC3_LD_SYSMOD="$(tc-getLD)" \
269 + TOOL_GCC3_CFLAGS="${CFLAGS}" TOOL_GCC3_CXXFLAGS="${CXXFLAGS}" \
270 + VBOX_GCC_OPT="${CXXFLAGS}" \
271 + TOOL_YASM_AS=yasm KBUILD_VERBOSE=2 \
272 + all
273 +}
274 +
275 +src_install() {
276 + local binpath="release"
277 + use debug && binpath="debug"
278 + cd "${S}"/out/linux.${ARCH}/${binpath}/bin || die
279 +
280 + local vbox_inst_path="/usr/$(get_libdir)/${PN}" each fwfile size ico icofile
281 +
282 + vbox_inst() {
283 + local binary="${1}"
284 + local perms="${2:-0750}"
285 + local path="${3:-${vbox_inst_path}}"
286 +
287 + [[ -n "${binary}" ]] || die "vbox_inst: No binray given!"
288 + [[ ${perms} =~ ^[[:digit:]]+{4}$ ]] || die "vbox_inst: perms must consist of four digits."
289 +
290 + insinto ${path}
291 + doins ${binary}
292 + fowners root:vboxusers ${path}/${binary}
293 + fperms ${perms} ${path}/${binary}
294 + }
295 +
296 + # Create configuration files
297 + insinto /etc/vbox
298 + newins "${FILESDIR}/${PN}-4-config" vbox.cfg
299 +
300 + # Set the correct libdir
301 + sed \
302 + -e "s@MY_LIBDIR@$(get_libdir)@" \
303 + -i "${ED%/}"/etc/vbox/vbox.cfg || die "vbox.cfg sed failed"
304 +
305 + # Install the wrapper script
306 + exeinto ${vbox_inst_path}
307 + newexe "${FILESDIR}/${PN}-ose-5-wrapper" "VBox"
308 + fowners root:vboxusers ${vbox_inst_path}/VBox
309 + fperms 0750 ${vbox_inst_path}/VBox
310 +
311 + # Install binaries and libraries
312 + insinto ${vbox_inst_path}
313 + doins -r components
314 +
315 + # *.rc files for x86_64 are only available on multilib systems
316 + local rcfiles="*.rc"
317 + if use amd64 && ! has_multilib_profile ; then
318 + rcfiles=""
319 + fi
320 + for each in VBox{ExtPackHelperApp,Manage,SVC,Tunctl,XPCOMIPCD} *so *r0 ${rcfiles} ; do
321 + vbox_inst ${each}
322 + done
323 +
324 + # These binaries need to be suid root.
325 + for each in VBox{Headless,Net{AdpCtl,DHCP,NAT}} ; do
326 + vbox_inst ${each} 4750
327 + done
328 +
329 + # Install EFI Firmware files (bug #320757)
330 + pushd "${S}"/src/VBox/Devices/EFI/FirmwareBin &>/dev/null || die
331 + for fwfile in VBoxEFI{32,64}.fd ; do
332 + vbox_inst ${fwfile} 0644
333 + done
334 + popd &>/dev/null || die
335 +
336 + # VBoxSVC and VBoxManage need to be pax-marked (bug #403453)
337 + # VBoxXPCOMIPCD (bug #524202)
338 + for each in VBox{Headless,Manage,SVC,XPCOMIPCD} ; do
339 + pax-mark -m "${ED%/}"${vbox_inst_path}/${each}
340 + done
341 +
342 + # Symlink binaries to the shipped wrapper
343 + for each in vbox{headless,manage} VBox{Headless,Manage,VRDP} ; do
344 + dosym ${vbox_inst_path}/VBox /usr/bin/${each}
345 + done
346 + dosym ${vbox_inst_path}/VBoxTunctl /usr/bin/VBoxTunctl
347 +
348 + if use pam ; then
349 + # VRDPAuth only works with this (bug #351949)
350 + dosym VBoxAuth.so ${vbox_inst_path}/VRDPAuth.so
351 + fi
352 +
353 + # set an env-variable for 3rd party tools
354 + echo -n "VBOX_APP_HOME=${vbox_inst_path}" > "${T}/90virtualbox"
355 + doenvd "${T}/90virtualbox"
356 +
357 + if ! use headless ; then
358 + vbox_inst VBoxSDL 4750
359 + pax-mark -m "${ED%/}"${vbox_inst_path}/VBoxSDL
360 +
361 + for each in vboxsdl VBoxSDL ; do
362 + dosym ${vbox_inst_path}/VBox /usr/bin/${each}
363 + done
364 +
365 + if use qt5 ; then
366 + vbox_inst VirtualBox 4750
367 + pax-mark -m "${ED%/}"${vbox_inst_path}/VirtualBox
368 +
369 + if use opengl ; then
370 + vbox_inst VBoxTestOGL
371 + pax-mark -m "${ED%/}"${vbox_inst_path}/VBoxTestOGL
372 + fi
373 +
374 + for each in virtualbox VirtualBox ; do
375 + dosym ${vbox_inst_path}/VBox /usr/bin/${each}
376 + done
377 +
378 + insinto /usr/share/${PN}
379 + doins -r nls
380 + doins -r UnattendedTemplates
381 +
382 + newmenu "${FILESDIR}"/${PN}-ose.desktop-2 ${PN}.desktop
383 + fi
384 +
385 + pushd "${S}"/src/VBox/Artwork/OSE &>/dev/null || die
386 + for size in 16 32 48 64 128 ; do
387 + newicon -s ${size} ${PN}-${size}px.png ${PN}.png
388 + done
389 + newicon ${PN}-48px.png ${PN}.png
390 + doicon -s scalable ${PN}.svg
391 + popd &>/dev/null || die
392 + pushd "${S}"/src/VBox/Artwork/other &>/dev/null || die
393 + for size in 16 24 32 48 64 72 96 128 256 512 ; do
394 + for ico in hdd ova ovf vbox{,-extpack} vdi vdh vmdk ; do
395 + icofile="${PN}-${ico}-${size}px.png"
396 + if [[ -f "${icofile}" ]] ; then
397 + newicon -s ${size} ${icofile} ${PN}-${ico}.png
398 + fi
399 + done
400 + done
401 + popd &>/dev/null || die
402 + fi
403 +
404 + if use lvm ; then
405 + vbox_inst VBoxVolInfo 4750
406 + dosym ${vbox_inst_path}/VBoxVolInfo /usr/bin/VBoxVolInfo
407 + fi
408 +
409 + if use sdk ; then
410 + insinto ${vbox_inst_path}
411 + doins -r sdk
412 +
413 + if use java ; then
414 + java-pkg_regjar "${ED%/}/${vbox_inst_path}/sdk/bindings/xpcom/java/vboxjxpcom.jar"
415 + java-pkg_regso "${ED%/}/${vbox_inst_path}/libvboxjxpcom.so"
416 + fi
417 + fi
418 +
419 + if use udev ; then
420 + # New way of handling USB device nodes for VBox (bug #356215)
421 + local udevdir="$(get_udevdir)"
422 + insinto ${udevdir}
423 + doins VBoxCreateUSBNode.sh
424 + fowners root:vboxusers ${udevdir}/VBoxCreateUSBNode.sh
425 + fperms 0750 ${udevdir}/VBoxCreateUSBNode.sh
426 + insinto ${udevdir}/rules.d
427 + sed "s@%UDEVDIR%@${udevdir}@" "${FILESDIR}"/10-virtualbox.rules \
428 + > "${T}"/10-virtualbox.rules || die
429 + doins "${T}"/10-virtualbox.rules
430 + fi
431 +
432 + if use vboxwebsrv ; then
433 + vbox_inst vboxwebsrv
434 + dosym ${vbox_inst_path}/VBox /usr/bin/vboxwebsrv
435 + newinitd "${FILESDIR}"/vboxwebsrv-initd vboxwebsrv
436 + newconfd "${FILESDIR}"/vboxwebsrv-confd vboxwebsrv
437 + fi
438 +
439 + if use doc ; then
440 + dodoc UserManual.pdf
441 + fi
442 +
443 + newtmpfiles "${FILESDIR}"/${PN}-vboxusb_tmpfilesd ${PN}-vboxusb.conf
444 +}
445 +
446 +pkg_postinst() {
447 + xdg_desktop_database_update
448 +
449 + if use udev ; then
450 + udevadm control --reload-rules \
451 + && udevadm trigger --subsystem-match=usb
452 + fi
453 +
454 + tmpfiles_process /usr/lib/tmpfiles.d/virtualbox-vboxusb.conf
455 +
456 + if ! use headless && use qt5 ; then
457 + elog "To launch VirtualBox just type: \"virtualbox\"."
458 + fi
459 + elog "You must be in the vboxusers group to use VirtualBox."
460 + elog ""
461 + elog "The latest user manual is available for download at:"
462 + elog "http://download.virtualbox.org/virtualbox/${PV}/UserManual.pdf"
463 + elog ""
464 + elog "For advanced networking setups you should emerge:"
465 + elog "net-misc/bridge-utils and sys-apps/usermode-utilities"
466 + elog ""
467 + elog "Starting with version 4.0.0, ${PN} has USB-1 support."
468 + elog "For USB-2 support, PXE-boot ability and VRDP support please emerge"
469 + elog " app-emulation/virtualbox-extpack-oracle"
470 + elog "package."
471 + elog "Starting with version 5.0.0, ${PN} no longer has the \"additions\" and"
472 + elog "the \"extension\" USE flag. For installation of the guest additions ISO"
473 + elog "image, please emerge"
474 + elog " app-emulation/virtualbox-additions"
475 + elog "and for the USB2, USB3, VRDP and PXE boot ROM modules, please emerge"
476 + elog " app-emulation/virtualbox-extpack-oracle"
477 + if ! use udev ; then
478 + elog ""
479 + elog "WARNING!"
480 + elog "Without USE=udev, USB devices will likely not work in ${PN}."
481 + elif [ -e "${ROOT%/}/etc/udev/rules.d/10-virtualbox.rules" ] ; then
482 + elog ""
483 + elog "Please remove \"${ROOT%/}/etc/udev/rules.d/10-virtualbox.rules\""
484 + elog "or else USB in ${PN} won't work."
485 + fi
486 +}
487 +
488 +pkg_postrm() {
489 + xdg_desktop_database_update
490 +}