Diff virtualbox-6.1.46 with a virtualbox-7.0.10

/usr/portage/app-emulation/virtualbox/virtualbox-7.0.10.ebuild 2023-10-09 14:52:28.736368331 +0300
15 15
#  trunk branch but not release branch.
16 16
#
17 17
#  See bug #785835, bug #856121.
18
PYTHON_COMPAT=( python3_{10..11} )
18
PYTHON_COMPAT=( python3_{10..12} )
19 19

  
20 20
inherit desktop edo flag-o-matic java-pkg-opt-2 linux-info multilib optfeature pax-utils \
21 21
	python-single-r1 tmpfiles toolchain-funcs udev xdg
......
25 25

  
26 26
DESCRIPTION="Family of powerful x86 virtualization products for enterprise and home use"
27 27
HOMEPAGE="https://www.virtualbox.org/"
28
SRC_URI="https://download.virtualbox.org/virtualbox/${PV}/${MY_P}.tar.bz2
29
	https://gitweb.gentoo.org/proj/virtualbox-patches.git/snapshot/virtualbox-patches-6.1.36.tar.bz2"
28
SRC_URI="
29
	https://download.virtualbox.org/virtualbox/${PV}/${MY_P}.tar.bz2
30
	https://gitweb.gentoo.org/proj/virtualbox-patches.git/snapshot/virtualbox-patches-7.0.8.tar.bz2
31
	gui? ( !doc? ( https://dev.gentoo.org/~ceamac/${CATEGORY}/${PN}/${PN}-help-${PV}.tar.xz ) )
32
"
30 33
S="${WORKDIR}/${MY_PN}-${PV}"
31 34

  
32
LICENSE="GPL-2 dtrace? ( CDDL )"
35
LICENSE="GPL-2+ GPL-3 LGPL-2.1 MIT dtrace? ( CDDL )"
33 36
SLOT="0/$(ver_cut 1-2)"
34 37
KEYWORDS="amd64"
35
IUSE="alsa debug doc dtrace headless java lvm +opus pam pax-kernel pch pulseaudio +opengl python +qt5 +sdk +sdl +udev vboxwebsrv vnc"
38
IUSE="alsa dbus debug doc dtrace +gui java lvm nls pam pch pulseaudio +opengl python +sdk +sdl +udev vboxwebsrv vde vnc"
36 39

  
37 40
unset WATCOM #856769
38 41

  
......
40 43
	${PYTHON_DEPS}
41 44
	acct-group/vboxusers
42 45
	~app-emulation/virtualbox-modules-${PV}
43
	>=dev-libs/libxslt-1.1.19
44
	net-misc/curl
46
	dev-libs/libtpms
45 47
	dev-libs/libxml2
48
	dev-libs/openssl:0=
46 49
	media-libs/libpng:0=
47 50
	media-libs/libvpx:0=
48
	sys-libs/zlib:=
49
	!headless? (
50
		sdl? ( media-libs/libsdl:0[X,video] )
51
		x11-base/xorg-proto
51
	net-misc/curl
52
	sys-libs/zlib
53
	dbus? ( sys-apps/dbus )
54
	gui? (
55
		dev-qt/qtcore:5
56
		dev-qt/qtdbus:5
57
		dev-qt/qtgui:5
58
		dev-qt/qthelp:5
59
		dev-qt/qtprintsupport:5
60
		dev-qt/qtwidgets:5
61
		dev-qt/qtx11extras:5
62
		dev-qt/qtxml:5
52 63
		x11-libs/libX11
53
		x11-libs/libxcb:=
54
		x11-libs/libXcursor
55
		x11-libs/libXext
56
		x11-libs/libXmu
57 64
		x11-libs/libXt
58
		opengl? (
59
			media-libs/libglvnd[X]
60
			virtual/glu
61
		)
62
		qt5? (
63
			dev-qt/qtcore:5
64
			dev-qt/qtgui:5
65
			dev-qt/qtprintsupport:5
66
			dev-qt/qtwidgets:5
67
			dev-qt/qtx11extras:5
68
			opengl? ( dev-qt/qtopengl:5 )
69
			x11-libs/libXinerama
70
		)
65
		opengl? ( dev-qt/qtopengl:5 )
71 66
	)
72
	dev-libs/openssl:0=
73
	virtual/libcrypt:=
74 67
	lvm? ( sys-fs/lvm2 )
75
	opus? ( media-libs/opus )
76
	udev? ( >=virtual/udev-171 )
77
	vboxwebsrv? ( net-libs/gsoap[-gnutls(-)] )
68
	opengl? (
69
		media-libs/libglvnd[X]
70
		media-libs/vulkan-loader
71
		x11-libs/libX11
72
		x11-libs/libXt
73
	)
74
	pam? ( sys-libs/pam )
75
	sdl? (
76
		media-libs/libsdl2[X,video]
77
		x11-libs/libX11
78
		x11-libs/libXcursor
79
		x11-libs/libXt
80
	)
81
	vboxwebsrv? ( net-libs/gsoap[-gnutls(-),debug?] )
82
	vde? ( net-misc/vde )
78 83
	vnc? ( >=net-libs/libvncserver-0.9.9 )
79 84
"
80 85
# We're stuck on JDK (and JRE, I guess?) 1.8 because of need for wsimport
......
89 94
# See bug #878299 to track this issue.
90 95
DEPEND="
91 96
	${COMMON_DEPEND}
97
	>=dev-libs/libxslt-1.1.19
98
	virtual/libcrypt:=
92 99
	alsa? ( >=media-libs/alsa-lib-1.0.13 )
93
	!headless? (
100
	gui? (
101
		x11-base/xorg-proto
102
		x11-libs/libxcb:=
103
		x11-libs/libXcursor
104
		x11-libs/libXext
94 105
		x11-libs/libXinerama
106
		x11-libs/libXmu
95 107
		x11-libs/libXrandr
96
		opengl? ( virtual/opengl )
97 108
	)
98 109
	java? ( virtual/jdk:1.8 )
99
	pam? ( sys-libs/pam )
100
	pax-kernel? ( sys-apps/elfix )
110
	opengl? (
111
		x11-base/xorg-proto
112
		x11-libs/libXcursor
113
		x11-libs/libXinerama
114
		x11-libs/libXmu
115
		x11-libs/libXrandr
116
		virtual/glu
117
	)
118
	sdl? ( x11-libs/libXinerama )
101 119
	pulseaudio? ( media-libs/libpulse )
120
	udev? ( >=virtual/udev-171 )
121
"
122
RDEPEND="
123
	${COMMON_DEPEND}
124
	gui? ( x11-libs/libxcb:= )
125
	java? ( virtual/jre:1.8 )
102 126
"
103 127
BDEPEND="
104 128
	${PYTHON_DEPS}
105 129
	>=app-arch/tar-1.34-r2
106
	>=dev-util/kbuild-0.1.9998.3127
107
	<=dev-util/kbuild-0.1.9998.3500
108 130
	>=dev-lang/yasm-0.6.2
109 131
	dev-libs/libIDL
132
	dev-util/glslang
133
	>=dev-util/kbuild-0.1.9998.3592
110 134
	sys-apps/which
111 135
	sys-devel/bin86
112 136
	sys-libs/libcap
......
114 138
	virtual/pkgconfig
115 139
	doc? (
116 140
		app-text/docbook-sgml-dtd:4.4
141
		app-text/docbook-xsl-ns-stylesheets
117 142
		dev-texlive/texlive-basic
118 143
		dev-texlive/texlive-latex
119 144
		dev-texlive/texlive-latexrecommended
120 145
		dev-texlive/texlive-latexextra
121 146
		dev-texlive/texlive-fontsrecommended
122 147
		dev-texlive/texlive-fontsextra
148
		dev-qt/qthelp:5
123 149
	)
150
	gui? ( dev-qt/linguist-tools:5 )
151
	nls? ( dev-qt/linguist-tools:5 )
124 152
	java? ( virtual/jdk:1.8 )
125
	qt5? ( dev-qt/linguist-tools:5 )
126
"
127
RDEPEND="
128
	${COMMON_DEPEND}
129
	java? ( virtual/jre:1.8 )
130 153
"
131 154

  
132 155
QA_FLAGS_IGNORED="
......
178 201
	# 865361
179 202
	"${FILESDIR}"/${PN}-6.1.36-fcf-protection.patch
180 203

  
181
	# 906309
182
	"${FILESDIR}"/${PN}-6.1.44-fix-libxml2.patch
204
	"${FILESDIR}"/${PN}-7.0.0-fix-compilation-clang.patch
205
	"${FILESDIR}"/${PN}-7.0.10-python.patch
206
	"${FILESDIR}"/${PN}-7.0.6-gcc-13.patch
207
	"${FILESDIR}"/${PN}-7.0.8-mtune-keep-size.patch
208
	"${FILESDIR}"/${PN}-7.0.6-fix-libxml2.patch
183 209

  
184 210
	# Downloaded patchset
185
	"${WORKDIR}"/virtualbox-patches-6.1.36/patches
211
	"${WORKDIR}"/virtualbox-patches-7.0.8/patches
186 212
)
187 213

  
188 214
pkg_pretend() {
189
	if ! use headless && ! use qt5 ; then
190
		einfo "No USE=\"qt5\" selected, this build will not include any Qt frontend."
191
	elif use headless && use qt5 ; then
192
		einfo "You selected USE=\"headless qt5\", defaulting to"
193
		einfo "USE=\"headless\", this build will not include any X11/Qt frontend."
215
	if ! use gui; then
216
		einfo "No USE=\"gui\" selected, this build will not include any Qt frontend."
194 217
	fi
195 218

  
196
	if ! use opengl ; then
219
	if ! use opengl; then
197 220
		einfo "No USE=\"opengl\" selected, this build will lack"
198 221
		einfo "the OpenGL feature."
199 222
	fi
200
	if ! use python ; then
223
	if ! use python; then
201 224
		einfo "You have disabled the \"python\" USE flag. This will only"
202 225
		einfo "disable the python bindings being installed."
203 226
	fi
227
	if ! use nls && use gui; then
228
		einfo "USE=\"gui\" also selects USE=\"nls\".  This build"
229
		einfo "will have NLS support."
230
	fi
204 231

  
205 232
	# 749273
206 233
	local d=${ROOT}
......
221 248
	default
222 249

  
223 250
	# Only add nopie patch when we're on hardened
224
	if gcc-specs-pie ; then
251
	if gcc-specs-pie; then
225 252
		eapply "${FILESDIR}"/050_virtualbox-5.2.8-nopie.patch
226 253
	fi
227 254

  
228
	# Remove shipped binaries (kBuild, yasm), see bug #232775
229
	rm -r kBuild/bin tools || die
230

  
231
	# Replace pointless GCC version check with something more sensible.
232
	# This is needed for the qt5 version check.
233
	sed -e 's@^check_gcc$@cc_maj="$(${CC} -dumpversion | cut -d. -f1)" ; cc_min="$(${CC} -dumpversion | cut -d. -f2)"@' \
234
		-i configure || die
255
	# Remove shipped binaries (kBuild, yasm) and tools, see bug #232775
256
	rm -r kBuild/bin || die
257
	# Remove everything in tools except kBuildUnits
258
	find tools -mindepth 1 -maxdepth 1 -name kBuildUnits -prune -o -exec rm -r {} \+ || die
235 259

  
236 260
	# Disable things unused or split into separate ebuilds
237 261
	sed -e "s@MY_LIBDIR@$(get_libdir)@" \
238 262
		"${FILESDIR}"/${PN}-5-localconfig > LocalConfig.kmk || die
239 263

  
240
	if ! use pch ; then
264
	if ! use pch; then
241 265
		# bug #753323
242 266
		printf '\n%s\n' "VBOX_WITHOUT_PRECOMPILED_HEADERS=1" \
243 267
			>> LocalConfig.kmk || die
......
252 276
		-i src/VBox/Devices/PC/ipxe/Makefile.kmk || die
253 277

  
254 278
	# Use PAM only when pam USE flag is enbaled (bug #376531)
255
	if ! use pam ; then
279
	if ! use pam; then
256 280
		einfo "Disabling PAM removes the possibility to use the VRDP features."
257 281
		sed -i 's@^.*VBOX_WITH_PAM@#VBOX_WITH_PAM@' Config.kmk || die
258 282
		sed -i 's@\(.*/auth/Makefile.kmk.*\)@#\1@' \
259 283
			src/VBox/HostServices/Makefile.kmk || die
284
		echo -e "\nIPRT_WITHOUT_PAM=1" >> LocalConfig.kmk || die
260 285
	fi
261 286

  
262 287
	# add correct java path
263
	if use java ; then
288
	if use java; then
264 289
		sed "s@/usr/lib/jvm/java-6-sun@$(java-config -O)@" \
265 290
			-i "${S}"/Config.kmk || die
266 291
		java-pkg-opt-2_src_prepare
267 292
	fi
268 293

  
269
	# 890561
270
	echo -e "\nVBOX_GTAR=gtar" >> LocalConfig.kmk || die
271
}
272

  
273
src_configure() {
274
	tc-ld-disable-gold # bug #488176
275

  
276 294
	#856811 #864274
277 295
	# cannot filter out only one flag, some combinations of these flags produce buggy executables
278 296
	for i in abm avx avx2 bmi bmi2 fma fma4 popcnt; do
......
280 298
		append-cxxflags $(test-flags-CXX -mno-$i)
281 299
	done
282 300

  
301
	# bug #843437
302
	cat >> LocalConfig.kmk <<-EOF || die
303
		CXXFLAGS=${CXXFLAGS}
304
		CFLAGS=${CFLAGS}
305
	EOF
306

  
307
	if use sdl; then
308
		sed -i 's/sdl-config/sdl2-config/' configure || die
309
		echo -e "\nVBOX_WITH_VBOXSDL=1" >> LocalConfig.kmk || die
310
	fi
311

  
312
	#443830
313
	echo -e "\nVBOX_WITH_VBOX_IMG=1" >> LocalConfig.kmk || die
314

  
315
	if tc-is-clang; then
316
		# clang assembler chokes on comments starting with /
317
		sed -i -e '/^\//d' src/libs/xpcom18a4/nsprpub/pr/src/md/unix/os_Linux_x86_64.s || die
318

  
319
		# clang does not support this extension
320
		eapply "${FILESDIR}"/${PN}-7.0.8-disable-rebuild-iPxeBiosBin.patch
321
	fi
322

  
323
	# fix doc generation
324
	echo -e "\nVBOX_PATH_DOCBOOK=/usr/share/sgml/docbook/xsl-ns-stylesheets" >> LocalConfig.kmk || die
283 325
	# replace xhtml names with numeric equivalents
284 326
	find doc/manual -name \*.xml -exec sed -i \
285 327
		-e 's/&nbsp;/\&#160;/g' \
......
288 330
		-e 's/&rarr;/\&#8594;/g' \
289 331
		-e 's/&harr;/\&#8596;/g' {} \+ || die
290 332

  
333
	# fix help path #891879
334
	echo -e "\nVBOX_PATH_PACKAGE_DOCS=/usr/share/doc/${PF}" >> LocalConfig.kmk || die
335

  
336
	# 489208
337
	# Cannot patch the whole text, many translations.  Use sed instead to replace the command
338
	find src/VBox/Frontends/VirtualBox/nls -name \*.ts -exec sed -i \
339
		's/&apos;[^&]*\(vboxdrv setup\|vboxconfig\)&apos;/\&apos;emerge -1 virtualbox-modules\&apos;/' {} \+ || die
340
	sed -i "s:'/sbin/vboxconfig':'emerge -1 virtualbox-modules':" \
341
		src/VBox/Frontends/VirtualBox/src/main.cpp \
342
		src/VBox/VMM/VMMR3/VM.cpp || die
343

  
344
	# 890561
345
	echo -e "\nVBOX_GTAR=gtar" >> LocalConfig.kmk || die
346

  
347
	if ! use nls && ! use gui; then
348
		cat >> LocalConfig.kmk <<-EOF || die
349
			VBOX_WITH_NLS :=
350
			VBOX_WITH_MAIN_NLS :=
351
			VBOX_WITH_PUEL_NLS :=
352
			VBOX_WITH_VBOXMANAGE_NLS :=
353
		EOF
354
	fi
355
}
356

  
357
src_configure() {
358
	tc-ld-disable-gold # bug #488176
359

  
291 360
	tc-export AR CC CXX LD RANLIB
292 361
	export HOST_CC="$(tc-getBUILD_CC)"
293 362

  
......
295 364
		--with-gcc="$(tc-getCC)"
296 365
		--with-g++="$(tc-getCXX)"
297 366

  
298
		--disable-dbus
299 367
		--disable-kmods
300 368

  
301 369
		$(usev !alsa --disable-alsa)
370
		$(usev !dbus --disable-dbus)
302 371
		$(usev debug --build-debug)
303 372
		$(usev !doc --disable-docs)
304 373
		$(usev !java --disable-java)
305 374
		$(usev !lvm --disable-devmapper)
306
		$(usev !opus --disable-libopus)
307 375
		$(usev !pulseaudio --disable-pulse)
308 376
		$(usev !python --disable-python)
309 377
		$(usev vboxwebsrv --enable-webservice)
378
		$(usev vde --enable-vde)
310 379
		$(usev vnc --enable-vnc)
311 380
	)
312 381

  
313
	if ! use headless ; then
382
	if use gui || use sdl || use opengl; then
314 383
		myconf+=(
315 384
			$(usev !opengl --disable-opengl)
316
			$(usev !qt5 --disable-qt)
385
			$(usev !gui --disable-qt)
317 386
			$(usev !sdl --disable-sdl)
318 387
		)
319 388
	else
320 389
		myconf+=(
321 390
			--build-headless
322
			--disable-opengl
323 391
		)
324 392
	fi
325 393

  
326
	if use amd64 && ! has_multilib_profile ; then
394
	if use amd64 && ! has_multilib_profile; then
327 395
		myconf+=( --disable-vmmraw )
328 396
	fi
329 397

  
330
	# bug #843437
331
	cat >> LocalConfig.kmk <<-EOF || die
332
		CXXFLAGS=${CXXFLAGS}
333
		CFLAGS=${CFLAGS}
334
	EOF
335

  
336 398
	# not an autoconf script
337 399
	edo ./configure "${myconf[@]}"
338 400

  
......
350 412
		VBOX_LIB_PYTHON=$(python_get_library_path)
351 413
	EOF
352 414

  
353
	if use python ; then
415
	if use python; then
354 416
		local mangled_python="${EPYTHON#python}"
355 417
		mangled_python="${mangled_python/.}"
356 418

  
......
409 471
		TOOL_YASM_AS=yasm
410 472
	)
411 473

  
412
	if use amd64 && has_multilib_profile ; then
474
	if use amd64 && has_multilib_profile; then
413 475
		myemakeargs+=(
414 476
			CC32="$(tc-getCC) -m32"
415 477
			CXX32="$(tc-getCXX) -m32"
......
471 533
	insinto ${vbox_inst_path}
472 534
	doins -r components
473 535

  
474
	for each in VBox{Autostart,BalloonCtrl,BugReport,CpuReport,ExtPackHelperApp,Manage,SVC,Tunctl,VMMPreload,XPCOMIPCD} \
475
		vboximg-mount *so *r0 iPxeBaseBin ; do
536
	for each in VBox{Autostart,BalloonCtrl,BugReport,CpuReport,ExtPackHelperApp,Manage,SVC,VMMPreload,XPCOMIPCD} \
537
		vboximg-mount vbox-img *so *r0; do
476 538
		vbox_inst ${each}
477 539
	done
478 540

  
......
497 559
		VBox{Autostart,BalloonCtrl,BugReport,Headless,Manage,VRDP} ; do
498 560
			dosym ${vbox_inst_path}/VBox /usr/bin/${each}
499 561
	done
500
	dosym ${vbox_inst_path}/VBoxTunctl /usr/bin/VBoxTunctl
501 562
	dosym ${vbox_inst_path}/vboximg-mount /usr/bin/vboximg-mount
563
	dosym ${vbox_inst_path}/vbox-img /usr/bin/vbox-img
502 564

  
503
	if use pam ; then
565
	if use pam; then
504 566
		# VRDPAuth only works with this (bug #351949)
505 567
		dosym VBoxAuth.so ${vbox_inst_path}/VRDPAuth.so
506 568
	fi
......
509 571
	echo -n "VBOX_APP_HOME=${vbox_inst_path}" > "${T}/90virtualbox"
510 572
	doenvd "${T}/90virtualbox"
511 573

  
512
	if ! use headless ; then
513
		vbox_inst rdesktop-vrdp
514
		if use sdl ; then
515
			vbox_inst VBoxSDL 4750
516
			pax-mark -m "${ED}"${vbox_inst_path}/VBoxSDL
574
	if use sdl; then
575
		vbox_inst VBoxSDL 4750
576
		pax-mark -m "${ED}"${vbox_inst_path}/VBoxSDL
517 577

  
518
			for each in vboxsdl VBoxSDL ; do
519
				dosym ${vbox_inst_path}/VBox /usr/bin/${each}
520
			done
521
		fi
578
		for each in vboxsdl VBoxSDL ; do
579
			dosym ${vbox_inst_path}/VBox /usr/bin/${each}
580
		done
581
	fi
522 582

  
523
		if use qt5 ; then
524
			vbox_inst VirtualBox
525
			vbox_inst VirtualBoxVM 4750
526
			for each in VirtualBox{,VM} ; do
527
				pax-mark -m "${ED}"${vbox_inst_path}/${each}
528
			done
583
	if use gui; then
584
		vbox_inst VirtualBox
585
		vbox_inst VirtualBoxVM 4750
586
		for each in VirtualBox{,VM} ; do
587
			pax-mark -m "${ED}"${vbox_inst_path}/${each}
588
		done
529 589

  
530
			if use opengl ; then
531
				vbox_inst VBoxTestOGL
532
				pax-mark -m "${ED}"${vbox_inst_path}/VBoxTestOGL
533
			fi
590
		if use opengl; then
591
			vbox_inst VBoxTestOGL
592
			pax-mark -m "${ED}"${vbox_inst_path}/VBoxTestOGL
593
		fi
534 594

  
535
			for each in virtualbox{,vm} VirtualBox{,VM} ; do
536
				dosym ${vbox_inst_path}/VBox /usr/bin/${each}
537
			done
595
		for each in virtualbox{,vm} VirtualBox{,VM} ; do
596
			dosym ${vbox_inst_path}/VBox /usr/bin/${each}
597
		done
538 598

  
539
			insinto /usr/share/${PN}
540
			doins -r nls
541
			doins -r UnattendedTemplates
599
		insinto /usr/share/${PN}
600
		doins -r nls
601
		doins -r UnattendedTemplates
542 602

  
543
			domenu ${PN}.desktop
544
		fi
603
		domenu ${PN}.desktop
545 604

  
546 605
		pushd "${S}"/src/VBox/Artwork/OSE &>/dev/null || die
547 606
		for size in 16 32 48 64 128 ; do
......
554 613
		for size in 16 24 32 48 64 72 96 128 256 512 ; do
555 614
			for ico in hdd ova ovf vbox{,-extpack} vdi vdh vmdk ; do
556 615
				icofile="${PN}-${ico}-${size}px.png"
557
				if [[ -f "${icofile}" ]] ; then
616
				if [[ -f "${icofile}" ]]; then
558 617
					newicon -s ${size} ${icofile} ${PN}-${ico}.png
559 618
				fi
560 619
			done
......
562 621
		popd &>/dev/null || die
563 622
	fi
564 623

  
565
	if use lvm ; then
624
	if use lvm; then
566 625
		vbox_inst VBoxVolInfo 4750
567 626
		dosym ${vbox_inst_path}/VBoxVolInfo /usr/bin/VBoxVolInfo
568 627
	fi
569 628

  
570
	if use sdk ; then
629
	if use sdk; then
571 630
		insinto ${vbox_inst_path}
572 631
		doins -r sdk
573 632

  
574
		if use java ; then
633
		if use java; then
575 634
			java-pkg_regjar "${ED}/${vbox_inst_path}/sdk/bindings/xpcom/java/vboxjxpcom.jar"
576 635
			java-pkg_regso "${ED}/${vbox_inst_path}/libvboxjxpcom.so"
577 636
		fi
578 637
	fi
579 638

  
580
	if use udev ; then
639
	if use udev; then
581 640
		local udevdir="$(get_udevdir)"
582 641
		local udev_file="VBoxCreateUSBNode.sh"
583 642
		local rules_file="10-virtualbox.rules"
......
593 652
		doins "${T}"/${rules_file}
594 653
	fi
595 654

  
596
	if use vboxwebsrv ; then
655
	if use vboxwebsrv; then
597 656
		vbox_inst vboxwebsrv
598 657
		dosym ${vbox_inst_path}/VBox /usr/bin/vboxwebsrv
599 658
		newinitd "${FILESDIR}"/vboxwebsrv-initd vboxwebsrv
......
609 668

  
610 669
	local extensions_dir="${vbox_inst_path}/ExtensionPacks"
611 670

  
612
	if use vnc ; then
671
	if use vnc; then
613 672
		insinto ${extensions_dir}
614 673
		doins -r ExtensionPacks/VNC
615 674
	fi
616 675

  
617
	if use dtrace ; then
676
	if use dtrace; then
618 677
		insinto ${extensions_dir}
619 678
		doins -r ExtensionPacks/Oracle_VBoxDTrace_Extension_Pack
620 679
	fi
621 680

  
622
	if use doc ; then
623
		dodoc UserManual.pdf
681
	if use doc; then
682
		dodoc UserManual.pdf UserManual.q{ch,hc}
683
		docompress -x /usr/share/doc/${PF}
684
	elif use gui; then
685
		dodoc "${WORKDIR}"/${PN}-help-${PV}/UserManual.q{ch,hc}
686
		docompress -x /usr/share/doc/${PF}
624 687
	fi
625 688

  
626
	if use python ; then
627
		local mangled_python="${EPYTHON#python}"
628
		mangled_python="${mangled_python/./_}"
629

  
630
		local python_path_ext="${ED}/usr/$(get_libdir)/virtualbox/VBoxPython${mangled_python}.so"
631
		if [[ ! -x "${python_path_ext}" ]] ; then
689
	if use python; then
690
		local python_path_ext="${ED}/usr/$(get_libdir)/virtualbox/VBoxPython3.so"
691
		if [[ ! -x "${python_path_ext}" ]]; then
632 692
			eerror "Couldn't find ${python_path_ext}! Bindings were requested with USE=python"
633 693
			eerror "but none were installed. This may happen if support for a Python target"
634 694
			eerror "(listed in PYTHON_COMPAT in the ebuild) is incomplete within the Makefiles."
......
642 702
pkg_postinst() {
643 703
	xdg_pkg_postinst
644 704

  
645
	if use udev ; then
705
	if use udev; then
646 706
		udev_reload
647 707
		udevadm trigger --subsystem-match=usb
648 708
	fi
649 709

  
650 710
	tmpfiles_process virtualbox-vboxusb.conf
651 711

  
652
	if ! use headless && use qt5 ; then
712
	if use gui; then
653 713
		elog "To launch VirtualBox just type: \"virtualbox\"."
654 714
	fi
655 715

  
......
663 723
	optfeature "USB2, USB3, PXE boot, and VRDP support" app-emulation/virtualbox-extpack-oracle
664 724
	optfeature "Guest additions ISO" app-emulation/virtualbox-additions
665 725

  
666
	if ! use udev ; then
726
	if ! use udev; then
667 727
		ewarn "Without USE=udev, USB devices will likely not work in ${PN}."
668 728
	fi
669 729
}
Thank you!