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-guest-additions/
Date: Tue, 25 Feb 2020 17:15:58
Message-Id: 1582650946.2655f4547091d0b238f14935f2f43753839b2f01.polynomial-c@gentoo
1 commit: 2655f4547091d0b238f14935f2f43753839b2f01
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 25 17:05:17 2020 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 25 17:15:46 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2655f454
7
8 app-emulation/virtualbox-guest-additions: Use GELP-81 compliant acct-*
9
10 packages
11
12 Package-Manager: Portage-2.3.89, Repoman-2.3.20
13 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
14
15 .../virtualbox-guest-additions-6.0.16-r1.ebuild | 216 +++++++++++++++++++++
16 .../virtualbox-guest-additions-6.1.4-r1.ebuild | 215 ++++++++++++++++++++
17 2 files changed, 431 insertions(+)
18
19 diff --git a/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-6.0.16-r1.ebuild b/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-6.0.16-r1.ebuild
20 new file mode 100644
21 index 00000000000..a9d194c3ded
22 --- /dev/null
23 +++ b/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-6.0.16-r1.ebuild
24 @@ -0,0 +1,216 @@
25 +# Copyright 1999-2020 Gentoo Authors
26 +# Distributed under the terms of the GNU General Public License v2
27 +
28 +EAPI=7
29 +
30 +inherit linux-mod systemd toolchain-funcs
31 +
32 +MY_PV="${PV/beta/BETA}"
33 +MY_PV="${MY_PV/rc/RC}"
34 +MY_P="VirtualBox-${MY_PV}"
35 +DESCRIPTION="VirtualBox kernel modules and user-space tools for Gentoo guests"
36 +HOMEPAGE="https://www.virtualbox.org/"
37 +SRC_URI="https://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.tar.bz2
38 + https://dev.gentoo.org/~polynomial-c/virtualbox/patchsets/virtualbox-6.0.16-patches-01.tar.xz"
39 +
40 +LICENSE="GPL-2"
41 +SLOT="0"
42 +[[ "${PV}" == *_beta* ]] || [[ "${PV}" == *_rc* ]] || \
43 +KEYWORDS="~amd64 ~x86"
44 +IUSE="X"
45 +
46 +# automount Error: VBoxServiceAutoMountWorker: Group "vboxsf" does not exist
47 +RDEPEND="
48 + acct-group/vboxguest
49 + acct-group/vboxsf
50 + acct-user/vboxguest
51 + X? ( x11-apps/xrandr
52 + x11-apps/xrefresh
53 + x11-libs/libXmu
54 + x11-libs/libX11
55 + x11-libs/libXt
56 + x11-libs/libXext
57 + x11-libs/libXau
58 + x11-libs/libXdmcp
59 + x11-libs/libSM
60 + x11-libs/libICE )
61 + sys-apps/dbus
62 +"
63 +DEPEND="
64 + ${RDEPEND}
65 + >=dev-util/kbuild-0.1.9998.3127
66 + >=dev-lang/yasm-0.6.2
67 + sys-devel/bin86
68 + sys-libs/pam
69 + sys-power/iasl
70 + x11-base/xorg-proto
71 +"
72 +PDEPEND="
73 + X? ( x11-drivers/xf86-video-vboxvideo )
74 +"
75 +BUILD_TARGETS="all"
76 +BUILD_TARGET_ARCH="${ARCH}"
77 +
78 +S="${WORKDIR}/${MY_P}"
79 +VBOX_MOD_SRC_DIR="${S}/out/linux.${ARCH}/release/bin/additions/src"
80 +
81 +pkg_setup() {
82 + export DISTCC_DISABLE=1 #674256
83 + MODULE_NAMES="vboxguest(misc:${VBOX_MOD_SRC_DIR}/vboxguest:${VBOX_MOD_SRC_DIR}/vboxguest)
84 + vboxsf(misc:${VBOX_MOD_SRC_DIR}/vboxsf:${VBOX_MOD_SRC_DIR}/vboxsf)"
85 + use X && MODULE_NAMES+=" vboxvideo(misc:${VBOX_MOD_SRC_DIR}/vboxvideo::${VBOX_MOD_SRC_DIR}/vboxvideo)"
86 +
87 + linux-mod_pkg_setup
88 + BUILD_PARAMS="KERN_DIR=/lib/modules/${KV_FULL}/build KERNOUT=${KV_OUT_DIR}"
89 +}
90 +
91 +src_prepare() {
92 + # Remove shipped binaries (kBuild,yasm), see bug #232775
93 + rm -r kBuild/bin tools || die
94 +
95 + # Provide kernel sources
96 + pushd src/VBox/Additions &>/dev/null || die
97 + ebegin "Extracting guest kernel module sources"
98 + kmk GuestDrivers-src vboxguest-src vboxsf-src vboxvideo-src &>/dev/null || die
99 + eend
100 + popd &>/dev/null || die
101 +
102 + # PaX fixes (see bug #298988)
103 + pushd "${VBOX_MOD_SRC_DIR}" &>/dev/null || die
104 + eapply "${FILESDIR}"/vboxguest-6.0.6-log-use-c99.patch
105 + popd &>/dev/null || die
106 +
107 + # Disable things unused or splitted into separate ebuilds
108 + cp "${FILESDIR}/${PN}-5-localconfig" LocalConfig.kmk || die
109 + use X || echo "VBOX_WITH_X11_ADDITIONS :=" >> LocalConfig.kmk
110 +
111 + # Remove pointless GCC version check
112 + sed -e '/^check_gcc$/d' -i configure || die
113 +
114 + rm "${WORKDIR}/patches/010_virtualbox-5.2.12-qt511.patch" || die
115 + eapply "${WORKDIR}/patches"
116 +
117 + eapply_user
118 +}
119 +
120 +src_configure() {
121 + # build the user-space tools, warnings are harmless
122 + local cmd=(
123 + ./configure
124 + --nofatal
125 + --disable-xpcom
126 + --disable-sdl-ttf
127 + --disable-pulse
128 + --disable-alsa
129 + --with-gcc="$(tc-getCC)"
130 + --with-g++="$(tc-getCXX)"
131 + --target-arch=${ARCH}
132 + --with-linux="${KV_OUT_DIR}"
133 + --build-headless
134 + )
135 + echo "${cmd[@]}"
136 + "${cmd[@]}" || die "configure failed"
137 + source ./env.sh
138 + export VBOX_GCC_OPT="${CFLAGS} ${CPPFLAGS}"
139 +}
140 +
141 +src_compile() {
142 + MAKE="kmk" \
143 + emake TOOL_YASM_AS=yasm \
144 + VBOX_ONLY_ADDITIONS=1 \
145 + KBUILD_VERBOSE=2
146 +
147 + # Now creating the kernel modules. We must do this _after_
148 + # we compiled the user-space tools as we need two of the
149 + # automatically generated header files. (>=3.2.0)
150 + linux-mod_src_compile
151 +}
152 +
153 +src_install() {
154 + linux-mod_src_install
155 +
156 + cd "${S}"/out/linux.${ARCH}/release/bin/additions || die
157 +
158 + insinto /sbin
159 + newins mount.vboxsf mount.vboxsf
160 + fperms 4755 /sbin/mount.vboxsf
161 +
162 + newinitd "${FILESDIR}"/${PN}-8.initd ${PN}
163 +
164 + insinto /usr/sbin/
165 + newins VBoxService vboxguest-service
166 + fperms 0755 /usr/sbin/vboxguest-service
167 +
168 + insinto /usr/bin
169 + doins VBoxControl
170 + fperms 0755 /usr/bin/VBoxControl
171 +
172 + # VBoxClient user service and xrandr wrapper
173 + if use X ; then
174 + doins VBoxClient
175 + fperms 0755 /usr/bin/VBoxClient
176 +
177 + pushd "${S}"/src/VBox/Additions/x11/Installer &>/dev/null \
178 + || die
179 + newins 98vboxadd-xclient VBoxClient-all
180 + fperms 0755 /usr/bin/VBoxClient-all
181 + popd &>/dev/null || die
182 + fi
183 +
184 + # udev rule for vboxdrv
185 + local udev_rules_dir="/lib/udev/rules.d"
186 + dodir ${udev_rules_dir}
187 + echo 'KERNEL=="vboxguest", OWNER="vboxguest", GROUP="vboxguest", MODE="0660"' \
188 + >> "${ED}/${udev_rules_dir}/60-virtualbox-guest-additions.rules" \
189 + || die
190 + echo 'KERNEL=="vboxuser", OWNER="vboxguest", GROUP="vboxguest", MODE="0660"' \
191 + >> "${ED}/${udev_rules_dir}/60-virtualbox-guest-additions.rules" \
192 + || die
193 +
194 + # VBoxClient autostart file
195 + insinto /etc/xdg/autostart
196 + doins "${FILESDIR}"/vboxclient.desktop
197 +
198 + # sample xorg.conf
199 + dodoc "${FILESDIR}"/xorg.conf.vbox
200 + docompress -x "${ED}"/usr/share/doc/${PF}/xorg.conf.vbox
201 +
202 + systemd_dounit "${FILESDIR}/${PN}.service"
203 +}
204 +
205 +pkg_postinst() {
206 + linux-mod_pkg_postinst
207 + if ! use X ; then
208 + elog "use flag X is off, enable it to install the"
209 + elog "X Window System video driver."
210 + fi
211 + elog ""
212 + elog "Please add users to the \"vboxguest\" group so they can"
213 + elog "benefit from seamless mode, auto-resize and clipboard."
214 + elog ""
215 + elog "The vboxsf group has been added to make automount services work."
216 + elog "These services are part of the shared folders support."
217 + elog ""
218 + elog "Please add:"
219 + elog "/etc/init.d/${PN}"
220 + elog "to the default runlevel in order to start"
221 + elog "needed services."
222 + elog "To use the VirtualBox X driver, use the following"
223 + elog "file as your /etc/X11/xorg.conf:"
224 + elog " /usr/share/doc/${PF}/xorg.conf.vbox"
225 + elog ""
226 + elog "Also make sure you use the Mesa library for OpenGL:"
227 + elog " eselect opengl set xorg-x11"
228 + elog ""
229 + elog "An autostart .desktop file has been installed to start"
230 + elog "VBoxClient in desktop sessions."
231 + elog ""
232 + elog "You can mount shared folders with:"
233 + elog " mount -t vboxsf <shared_folder_name> <mount_point>"
234 + elog ""
235 + elog "Warning:"
236 + elog "this ebuild is only needed if you are running gentoo"
237 + elog "inside a VirtualBox Virtual Machine, you don't need"
238 + elog "it to run VirtualBox itself."
239 + elog ""
240 +}
241
242 diff --git a/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-6.1.4-r1.ebuild b/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-6.1.4-r1.ebuild
243 new file mode 100644
244 index 00000000000..6779b7c6ccc
245 --- /dev/null
246 +++ b/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-6.1.4-r1.ebuild
247 @@ -0,0 +1,215 @@
248 +# Copyright 1999-2020 Gentoo Authors
249 +# Distributed under the terms of the GNU General Public License v2
250 +
251 +EAPI=7
252 +
253 +inherit linux-mod systemd toolchain-funcs
254 +
255 +MY_PV="${PV/beta/BETA}"
256 +MY_PV="${MY_PV/rc/RC}"
257 +MY_P="VirtualBox-${MY_PV}"
258 +DESCRIPTION="VirtualBox kernel modules and user-space tools for Gentoo guests"
259 +HOMEPAGE="https://www.virtualbox.org/"
260 +SRC_URI="https://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.tar.bz2
261 + https://dev.gentoo.org/~polynomial-c/virtualbox/patchsets/virtualbox-6.1.0_rc1-patches-01.tar.xz"
262 +
263 +LICENSE="GPL-2"
264 +SLOT="0"
265 +[[ "${PV}" == *_beta* ]] || [[ "${PV}" == *_rc* ]] || \
266 +KEYWORDS="~amd64 ~x86"
267 +IUSE="X"
268 +
269 +# automount Error: VBoxServiceAutoMountWorker: Group "vboxsf" does not exist
270 +RDEPEND="
271 + acct-group/vboxguest
272 + acct-group/vboxsf
273 + acct-user/vboxguest
274 + X? ( x11-apps/xrandr
275 + x11-apps/xrefresh
276 + x11-libs/libXmu
277 + x11-libs/libX11
278 + x11-libs/libXt
279 + x11-libs/libXext
280 + x11-libs/libXau
281 + x11-libs/libXdmcp
282 + x11-libs/libSM
283 + x11-libs/libICE )
284 + sys-apps/dbus
285 +"
286 +DEPEND="
287 + ${RDEPEND}
288 + >=dev-util/kbuild-0.1.9998.3127
289 + >=dev-lang/yasm-0.6.2
290 + sys-devel/bin86
291 + sys-libs/pam
292 + sys-power/iasl
293 + x11-base/xorg-proto
294 +"
295 +PDEPEND="
296 + X? ( x11-drivers/xf86-video-vboxvideo )
297 +"
298 +BUILD_TARGETS="all"
299 +BUILD_TARGET_ARCH="${ARCH}"
300 +
301 +S="${WORKDIR}/${MY_P}"
302 +VBOX_MOD_SRC_DIR="${S}/out/linux.${ARCH}/release/bin/additions/src"
303 +
304 +pkg_setup() {
305 + export DISTCC_DISABLE=1 #674256
306 + MODULE_NAMES="vboxguest(misc:${VBOX_MOD_SRC_DIR}/vboxguest:${VBOX_MOD_SRC_DIR}/vboxguest)
307 + vboxsf(misc:${VBOX_MOD_SRC_DIR}/vboxsf:${VBOX_MOD_SRC_DIR}/vboxsf)"
308 + use X && MODULE_NAMES+=" vboxvideo(misc:${VBOX_MOD_SRC_DIR}/vboxvideo::${VBOX_MOD_SRC_DIR}/vboxvideo)"
309 +
310 + linux-mod_pkg_setup
311 + BUILD_PARAMS="KERN_DIR=/lib/modules/${KV_FULL}/build KERNOUT=${KV_OUT_DIR}"
312 +}
313 +
314 +src_prepare() {
315 + # Remove shipped binaries (kBuild,yasm), see bug #232775
316 + rm -r kBuild/bin tools || die
317 +
318 + # Provide kernel sources
319 + pushd src/VBox/Additions &>/dev/null || die
320 + ebegin "Extracting guest kernel module sources"
321 + kmk GuestDrivers-src vboxguest-src vboxsf-src vboxvideo-src &>/dev/null || die
322 + eend
323 + popd &>/dev/null || die
324 +
325 + # PaX fixes (see bug #298988)
326 + pushd "${VBOX_MOD_SRC_DIR}" &>/dev/null || die
327 + eapply "${FILESDIR}"/vboxguest-6.0.6-log-use-c99.patch
328 + popd &>/dev/null || die
329 +
330 + # Disable things unused or splitted into separate ebuilds
331 + cp "${FILESDIR}/${PN}-5-localconfig" LocalConfig.kmk || die
332 + use X || echo "VBOX_WITH_X11_ADDITIONS :=" >> LocalConfig.kmk
333 +
334 + # Remove pointless GCC version check
335 + sed -e '/^check_gcc$/d' -i configure || die
336 +
337 + eapply "${WORKDIR}/patches"
338 +
339 + eapply_user
340 +}
341 +
342 +src_configure() {
343 + # build the user-space tools, warnings are harmless
344 + local cmd=(
345 + ./configure
346 + --nofatal
347 + --disable-xpcom
348 + --disable-sdl-ttf
349 + --disable-pulse
350 + --disable-alsa
351 + --with-gcc="$(tc-getCC)"
352 + --with-g++="$(tc-getCXX)"
353 + --target-arch=${ARCH}
354 + --with-linux="${KV_OUT_DIR}"
355 + --build-headless
356 + )
357 + echo "${cmd[@]}"
358 + "${cmd[@]}" || die "configure failed"
359 + source ./env.sh
360 + export VBOX_GCC_OPT="${CFLAGS} ${CPPFLAGS}"
361 +}
362 +
363 +src_compile() {
364 + MAKE="kmk" \
365 + emake TOOL_YASM_AS=yasm \
366 + VBOX_ONLY_ADDITIONS=1 \
367 + KBUILD_VERBOSE=2
368 +
369 + # Now creating the kernel modules. We must do this _after_
370 + # we compiled the user-space tools as we need two of the
371 + # automatically generated header files. (>=3.2.0)
372 + linux-mod_src_compile
373 +}
374 +
375 +src_install() {
376 + linux-mod_src_install
377 +
378 + cd "${S}"/out/linux.${ARCH}/release/bin/additions || die
379 +
380 + insinto /sbin
381 + newins mount.vboxsf mount.vboxsf
382 + fperms 4755 /sbin/mount.vboxsf
383 +
384 + newinitd "${FILESDIR}"/${PN}-8.initd ${PN}
385 +
386 + insinto /usr/sbin/
387 + newins VBoxService vboxguest-service
388 + fperms 0755 /usr/sbin/vboxguest-service
389 +
390 + insinto /usr/bin
391 + doins VBoxControl
392 + fperms 0755 /usr/bin/VBoxControl
393 +
394 + # VBoxClient user service and xrandr wrapper
395 + if use X ; then
396 + doins VBoxClient
397 + fperms 0755 /usr/bin/VBoxClient
398 +
399 + pushd "${S}"/src/VBox/Additions/x11/Installer &>/dev/null \
400 + || die
401 + newins 98vboxadd-xclient VBoxClient-all
402 + fperms 0755 /usr/bin/VBoxClient-all
403 + popd &>/dev/null || die
404 + fi
405 +
406 + # udev rule for vboxdrv
407 + local udev_rules_dir="/lib/udev/rules.d"
408 + dodir ${udev_rules_dir}
409 + echo 'KERNEL=="vboxguest", OWNER="vboxguest", GROUP="vboxguest", MODE="0660"' \
410 + >> "${ED}/${udev_rules_dir}/60-virtualbox-guest-additions.rules" \
411 + || die
412 + echo 'KERNEL=="vboxuser", OWNER="vboxguest", GROUP="vboxguest", MODE="0660"' \
413 + >> "${ED}/${udev_rules_dir}/60-virtualbox-guest-additions.rules" \
414 + || die
415 +
416 + # VBoxClient autostart file
417 + insinto /etc/xdg/autostart
418 + doins "${FILESDIR}"/vboxclient.desktop
419 +
420 + # sample xorg.conf
421 + dodoc "${FILESDIR}"/xorg.conf.vbox
422 + docompress -x "${ED}"/usr/share/doc/${PF}/xorg.conf.vbox
423 +
424 + systemd_dounit "${FILESDIR}/${PN}.service"
425 +}
426 +
427 +pkg_postinst() {
428 + linux-mod_pkg_postinst
429 + if ! use X ; then
430 + elog "use flag X is off, enable it to install the"
431 + elog "X Window System video driver."
432 + fi
433 + elog ""
434 + elog "Please add users to the \"vboxguest\" group so they can"
435 + elog "benefit from seamless mode, auto-resize and clipboard."
436 + elog ""
437 + elog "The vboxsf group has been added to make automount services work."
438 + elog "These services are part of the shared folders support."
439 + elog ""
440 + elog "Please add:"
441 + elog "/etc/init.d/${PN}"
442 + elog "to the default runlevel in order to start"
443 + elog "needed services."
444 + elog "To use the VirtualBox X driver, use the following"
445 + elog "file as your /etc/X11/xorg.conf:"
446 + elog " /usr/share/doc/${PF}/xorg.conf.vbox"
447 + elog ""
448 + elog "Also make sure you use the Mesa library for OpenGL:"
449 + elog " eselect opengl set xorg-x11"
450 + elog ""
451 + elog "An autostart .desktop file has been installed to start"
452 + elog "VBoxClient in desktop sessions."
453 + elog ""
454 + elog "You can mount shared folders with:"
455 + elog " mount -t vboxsf <shared_folder_name> <mount_point>"
456 + elog ""
457 + elog "Warning:"
458 + elog "this ebuild is only needed if you are running gentoo"
459 + elog "inside a VirtualBox Virtual Machine, you don't need"
460 + elog "it to run VirtualBox itself."
461 + elog ""
462 +}