Gentoo Archives: gentoo-commits

From: Viorel Munteanu <ceamac@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/virtualbox-guest-additions/
Date: Wed, 02 Nov 2022 06:41:45
Message-Id: 1667371182.f54a7eb55c1f574a10e6b1b03430dda3665790b7.ceamac@gentoo
1 commit: f54a7eb55c1f574a10e6b1b03430dda3665790b7
2 Author: Viorel Munteanu <ceamac.paragon <AT> gmail <DOT> com>
3 AuthorDate: Fri Oct 14 06:37:51 2022 +0000
4 Commit: Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 2 06:39:42 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f54a7eb5
7
8 app-emulation/virtualbox-guest-additions: add 7.0.2
9
10 Signed-off-by: Viorel Munteanu <ceamac.paragon <AT> gmail.com>
11 Signed-off-by: Viorel Munteanu <ceamac <AT> gentoo.org>
12
13 app-emulation/virtualbox-guest-additions/Manifest | 1 +
14 .../virtualbox-guest-additions-7.0.2.ebuild | 286 +++++++++++++++++++++
15 2 files changed, 287 insertions(+)
16
17 diff --git a/app-emulation/virtualbox-guest-additions/Manifest b/app-emulation/virtualbox-guest-additions/Manifest
18 index c3288f9542c0..7223bc1b6af8 100644
19 --- a/app-emulation/virtualbox-guest-additions/Manifest
20 +++ b/app-emulation/virtualbox-guest-additions/Manifest
21 @@ -1,4 +1,5 @@
22 DIST VirtualBox-6.1.36.tar.bz2 165685382 BLAKE2B 98dbb06450b9df650cb72493bcdea4b88fa9dd21f76d723fdc0bb2c1ab8266f67e972a7222dc9b5bd0d43754911710664bddace753995be025cf6bcc05a24ae5 SHA512 cc3b984a7da40c9bf14831808a2bc2bf7bf6821e53c25fa11cb4b4275feb1d4b0cb4a47d8a360b90c89e5a4038481efe8fe28ee22996dbefb6446761e88a8dec
23 DIST VirtualBox-6.1.38.tar.bz2 165761175 BLAKE2B decda6e7a595f79e6ace6f8f6b8a7829223ac1422c3d280b6287a40ef942e773ad473f4fa4640a76f8fb825ebd8561c646f1b3d87922b1af55c138298b4c8f4f SHA512 7a4f2dc80e3251b1da6d29d3c6f6b802527decc70497b1a1d1008c0ab3109c2039d131c587d6ec4786aea619546757655337c2ec3456243336ca13c6f6748116
24 DIST VirtualBox-6.1.40.tar.bz2 165769795 BLAKE2B 5c216f23422be3fc4f7760881c666c57a516d12726ed8ef040bbdf918f1af53c69d204b22949e25f751cbe788b00c810c49c27b7c51c1837fd1c503a3eff202c SHA512 0dace071fe58500d0912fe4da4751de6840752375039554a56c8c753a0880a419c4a1ed7f1b0ebc51230f7099ca3f5d987dc7b91ad4d98dbd75bf63e3c27e096
25 +DIST VirtualBox-7.0.2.tar.bz2 199461536 BLAKE2B 94f7c2961c13530b6086bf4576f243b5b260f43ec445c8a2e411205989a9db229715502f2b76b8f3cb45a49ff565410701be90f1e850f069aae5579c0796b503 SHA512 c79d6365f83e1fde356a7f4a6ccd23bc7306d1b5b4be669634c575f08ba53338caca684758c9409ecef2b05ab6f9ad37dfa6075ad6afbc5d7909d46ee6794927
26 DIST virtualbox-patches-6.1.36.tar.bz2 2733 BLAKE2B dcfebfeca4873d382441515d48b4dfee9343bc7c83ea3cbb5002dbf7975143a79fae9a701b67dc35505e9ca03ff1b6293cb7c3279c4fdfda8ad21ba5fb9b7e87 SHA512 1bed5cdefbf8e7c4b0d9092ba4961ecf2262f27f35c71a91ef6f2e8fe8a1d92ed74f06bafbf58d70ba7165d933997f58073f4d4f4051e3ba5c0339b729066f57
27
28 diff --git a/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-7.0.2.ebuild b/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-7.0.2.ebuild
29 new file mode 100644
30 index 000000000000..5954fa0edd6d
31 --- /dev/null
32 +++ b/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-7.0.2.ebuild
33 @@ -0,0 +1,286 @@
34 +# Copyright 2022 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=8
38 +
39 +inherit edo linux-mod systemd toolchain-funcs udev
40 +
41 +MY_PN="VirtualBox"
42 +MY_P="${MY_PN}-${PV}"
43 +
44 +DESCRIPTION="VirtualBox kernel modules and user-space tools for Gentoo guests"
45 +HOMEPAGE="https://www.virtualbox.org/"
46 +SRC_URI="https://download.virtualbox.org/virtualbox/${PV}/${MY_P}.tar.bz2
47 + https://gitweb.gentoo.org/proj/virtualbox-patches.git/snapshot/virtualbox-patches-6.1.36.tar.bz2"
48 +
49 +# Reminder: see the LICENSE related comment in app-emulation/virtualbox-additions ebuild
50 +LICENSE="GPL-2+ GPL-3 LGPL-2.1 MIT"
51 +SLOT="0/$(ver_cut 1-2)"
52 +KEYWORDS="~amd64 ~x86"
53 +IUSE="+dbus X"
54 +
55 +# automount Error: VBoxServiceAutoMountWorker: Group "vboxsf" does not exist
56 +# TODO: find out what this is, remove comment if obsolete
57 +
58 +RDEPEND="
59 + acct-group/vboxguest
60 + acct-group/vboxsf
61 + acct-user/vboxguest
62 + sys-libs/pam
63 + sys-libs/zlib
64 + dbus? ( sys-apps/dbus )
65 + X? (
66 + x11-apps/xrandr
67 + x11-apps/xrefresh
68 + x11-libs/libX11
69 + x11-libs/libXext
70 + x11-libs/libXmu
71 + x11-libs/libXt
72 + )
73 +"
74 +# some libs here are indirect dependencies, and also needed at compile time.
75 +# keeping them in DEPEND to avoid warnings from qa-vdb.
76 +DEPEND="
77 + ${RDEPEND}
78 + x11-libs/libICE
79 + x11-libs/libSM
80 + x11-libs/libXau
81 + x11-libs/libXdmcp
82 + x11-base/xorg-proto
83 +"
84 +BDEPEND="
85 + >=dev-lang/yasm-0.6.2
86 + >=dev-util/kbuild-0.1.9998.3127
87 + sys-devel/bin86
88 + sys-power/iasl
89 +"
90 +PDEPEND="
91 + X? ( x11-drivers/xf86-video-vboxvideo )
92 +"
93 +
94 +BUILD_TARGETS="all"
95 +BUILD_TARGET_ARCH="${ARCH}"
96 +
97 +S="${WORKDIR}/${MY_PN}-${PV}"
98 +VBOX_MOD_SRC_DIR="${S}/out/linux.${ARCH}/release/bin/additions/src"
99 +MODULESD_VBOXSF_ALIASES=("fs-vboxsf vboxsf") # 485996
100 +
101 +pkg_setup() {
102 + export DISTCC_DISABLE=1 #674256
103 + MODULE_NAMES="vboxguest(misc:${VBOX_MOD_SRC_DIR}/vboxguest:${VBOX_MOD_SRC_DIR}/vboxguest)
104 + vboxsf(misc:${VBOX_MOD_SRC_DIR}/vboxsf:${VBOX_MOD_SRC_DIR}/vboxsf)"
105 + use X && MODULE_NAMES+=" vboxvideo(misc:${VBOX_MOD_SRC_DIR}/vboxvideo::${VBOX_MOD_SRC_DIR}/vboxvideo)"
106 +
107 + linux-mod_pkg_setup
108 +}
109 +
110 +src_prepare() {
111 + # Remove shipped binaries (kBuild,yasm), see bug #232775
112 + rm -r kBuild/bin tools || die
113 +
114 + # Provide kernel sources
115 + pushd src/VBox/Additions &>/dev/null || die
116 + ebegin "Extracting guest kernel module sources"
117 + kmk GuestDrivers-src vboxguest-src vboxsf-src vboxvideo-src &>/dev/null
118 + eend $? || die
119 + popd &>/dev/null || die
120 +
121 + # PaX fixes (see bug #298988)
122 + pushd "${VBOX_MOD_SRC_DIR}" &>/dev/null || die
123 + eapply "${FILESDIR}"/vboxguest-6.1.36-log-use-c99.patch
124 + popd &>/dev/null || die
125 +
126 + # Disable things unused or splitted into separate ebuilds
127 + cp "${FILESDIR}/${PN}-5-localconfig" LocalConfig.kmk || die
128 + if ! use X; then
129 + echo "VBOX_WITH_X11_ADDITIONS :=" >> LocalConfig.kmk || die
130 + fi
131 +
132 + # Remove pointless GCC version check
133 + sed -e '/^check_gcc$/d' -i configure || die
134 +
135 + # Respect LDFLAGS (bug #759100)
136 + sed -i -e '/TEMPLATE_VBOXR3EXE_LDFLAGS.linux[ ]*=/ s/$/ $(CCLDFLAGS)/' Config.kmk || die
137 +
138 + eapply "${WORKDIR}/virtualbox-patches-6.1.36/patches"
139 + eapply_user
140 +}
141 +
142 +src_configure() {
143 + tc-export AR CC CXX LD RANLIB
144 +
145 + # Build the user-space tools, warnings are harmless
146 + local myconf=(
147 + --with-gcc="$(tc-getCC)"
148 + --with-g++="$(tc-getCXX)"
149 +
150 + --nofatal
151 + --disable-xpcom
152 + --disable-sdl-ttf
153 + --disable-pulse
154 + --disable-alsa
155 + $(usex dbus '' --disable-dbus)
156 + --target-arch=${ARCH}
157 + --with-linux="${KV_OUT_DIR}"
158 + --build-headless
159 + )
160 +
161 + # bug #843437
162 + # Respect LDFLAGS (bug #759100)
163 + # Cannot use LDFLAGS here because they also get passed to $(LD)
164 + cat >> LocalConfig.kmk <<-EOF || die
165 + CFLAGS=${CFLAGS}
166 + CXXFLAGS=${CXXFLAGS}
167 + CCLDFLAGS=${LDFLAGS}
168 + EOF
169 +
170 + edo ./configure "${myconf[@]}"
171 +}
172 +
173 +src_compile() {
174 + source ./env.sh || die
175 +
176 + # Force kBuild to respect C[XX]FLAGS and MAKEOPTS (bug #178529)
177 + MAKEJOBS=$(grep -Eo '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+' <<< ${MAKEOPTS})
178 + MAKELOAD=$(grep -Eo '(\-l|\-\-load-average)(=?|[[:space:]]*)[[:digit:]]+' <<< ${MAKEOPTS})
179 + MAKEOPTS="${MAKEJOBS} ${MAKELOAD}"
180 +
181 + local myemakeargs=(
182 + VBOX_BUILD_PUBLISHER=_Gentoo
183 + VBOX_ONLY_ADDITIONS=1
184 +
185 + KBUILD_VERBOSE=2
186 +
187 + AS="$(tc-getCC)"
188 + CC="$(tc-getCC)"
189 + CXX="$(tc-getCXX)"
190 + LD="$(tc-getCC)"
191 +
192 + TOOL_GCC3_CC="$(tc-getCC)"
193 + TOOL_GCC3_CXX="$(tc-getCXX)"
194 + TOOL_GCC3_LD="$(tc-getCC)"
195 + TOOL_GCC3_AS="$(tc-getCC)"
196 + TOOL_GCC3_AR="$(tc-getAR)"
197 + TOOL_GCC3_OBJCOPY="$(tc-getOBJCOPY)"
198 + #TOOL_GCC3_LD_SYSMOD="$(tc-getCC)"
199 +
200 + TOOL_GXX3_CC="$(tc-getCC)"
201 + TOOL_GXX3_CXX="$(tc-getCXX)"
202 + TOOL_GXX3_LD="$(tc-getCXX)"
203 + TOOL_GXX3_AS="$(tc-getCXX)"
204 + TOOL_GXX3_AR="$(tc-getAR)"
205 + TOOL_GXX3_OBJCOPY="$(tc-getOBJCOPY)"
206 + #TOOL_GXX3_LD_SYSMOD="$(tc-getCXX)"
207 +
208 + TOOL_GCC3_CFLAGS="${CFLAGS}"
209 + TOOL_GCC3_CXXFLAGS="${CXXFLAGS}"
210 + VBOX_GCC_OPT="${CXXFLAGS}"
211 + VBOX_NM="$(tc-getNM)"
212 + TOOL_YASM_AS=yasm
213 + )
214 +
215 + MAKE="kmk" emake "${myemakeargs[@]}"
216 +
217 + # Now creating the kernel modules. We must do this _after_
218 + # we compiled the user-space tools as we need two of the
219 + # automatically generated header files. (>=3.2.0)
220 + # Move this here for bug 836037
221 + BUILD_PARAMS="KERN_DIR=/lib/modules/${KV_FULL}/build KERNOUT=${KV_OUT_DIR} KBUILD_EXTRA_SYMBOLS=${S}/Module.symvers"
222 + linux-mod_src_compile
223 +}
224 +
225 +src_install() {
226 + linux-mod_src_install
227 +
228 + cd "${S}"/out/linux.${ARCH}/release/bin/additions || die
229 +
230 + insinto /sbin
231 + newins mount.vboxsf mount.vboxsf
232 + fperms 4755 /sbin/mount.vboxsf
233 +
234 + newinitd "${FILESDIR}"/${PN}-8.initd-r1 ${PN}
235 +
236 + insinto /usr/sbin/
237 + newins VBoxService vboxguest-service
238 + fperms 0755 /usr/sbin/vboxguest-service
239 +
240 + insinto /usr/bin
241 + doins VBoxControl
242 + fperms 0755 /usr/bin/VBoxControl
243 +
244 + # VBoxClient user service and xrandr wrapper
245 + if use X ; then
246 + doins VBoxClient
247 + fperms 0755 /usr/bin/VBoxClient
248 + doins VBoxDRMClient
249 + fperms 4755 /usr/bin/VBoxDRMClient
250 +
251 + pushd "${S}"/src/VBox/Additions/x11/Installer &>/dev/null || die
252 + newins 98vboxadd-xclient VBoxClient-all
253 + fperms 0755 /usr/bin/VBoxClient-all
254 + popd &>/dev/null || die
255 + fi
256 +
257 + # udev rule for vboxdrv
258 + local udev_rules_dir="/lib/udev/rules.d"
259 + dodir ${udev_rules_dir}
260 + echo 'KERNEL=="vboxguest", OWNER="vboxguest", GROUP="vboxguest", MODE="0660"' \
261 + >> "${ED}/${udev_rules_dir}/60-virtualbox-guest-additions.rules" \
262 + || die
263 + echo 'KERNEL=="vboxuser", OWNER="vboxguest", GROUP="vboxguest", MODE="0660"' \
264 + >> "${ED}/${udev_rules_dir}/60-virtualbox-guest-additions.rules" \
265 + || die
266 +
267 + # VBoxClient autostart file
268 + insinto /etc/xdg/autostart
269 + doins "${FILESDIR}"/vboxclient.desktop
270 +
271 + # sample xorg.conf
272 + dodoc "${FILESDIR}"/xorg.conf.vbox
273 + docompress -x "${ED}"/usr/share/doc/${PF}/xorg.conf.vbox
274 +
275 + systemd_dounit "${FILESDIR}/${PN}.service"
276 +}
277 +
278 +pkg_postinst() {
279 + linux-mod_pkg_postinst
280 + udev_reload
281 + if ! use X ; then
282 + elog "use flag X is off, enable it to install the"
283 + elog "X Window System video driver."
284 + fi
285 + elog ""
286 + elog "Please add users to the \"vboxguest\" group so they can"
287 + elog "benefit from seamless mode, auto-resize and clipboard."
288 + elog ""
289 + elog "The vboxsf group has been added to make automount services work."
290 + elog "These services are part of the shared folders support."
291 + elog ""
292 + elog "Please add:"
293 + elog "/etc/init.d/${PN}"
294 + elog "to the default runlevel in order to start"
295 + elog "needed services."
296 + elog "To use the VirtualBox X driver, use the following"
297 + elog "file as your /etc/X11/xorg.conf:"
298 + elog " /usr/share/doc/${PF}/xorg.conf.vbox"
299 + elog ""
300 + elog "Also make sure you use the Mesa library for OpenGL:"
301 + elog " eselect opengl set xorg-x11"
302 + elog ""
303 + elog "An autostart .desktop file has been installed to start"
304 + elog "VBoxClient in desktop sessions."
305 + elog ""
306 + elog "You can mount shared folders with:"
307 + elog " mount -t vboxsf <shared_folder_name> <mount_point>"
308 + elog ""
309 + elog "Warning:"
310 + elog "this ebuild is only needed if you are running gentoo"
311 + elog "inside a VirtualBox Virtual Machine, you don't need"
312 + elog "it to run VirtualBox itself."
313 + elog ""
314 +}
315 +
316 +pkg_postrm() {
317 + linux-mod_pkg_postrm
318 + udev_reload
319 +}