app-emulation/virtualbox-guest-additions: fix building against >=linux-4.18
authorThomas Deutschmann <whissi@gentoo.org>
Fri, 24 Aug 2018 00:37:06 +0000 (02:37 +0200)
committerThomas Deutschmann <whissi@gentoo.org>
Fri, 24 Aug 2018 00:38:05 +0000 (02:38 +0200)
Closes: https://bugs.gentoo.org/663488
Package-Manager: Portage-2.3.48, Repoman-2.3.10

app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-5.2.18-linux-4.18.patch [new file with mode: 0644]
app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-5.2.14.ebuild
app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-5.2.16.ebuild
app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-5.2.18.ebuild

diff --git a/app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-5.2.18-linux-4.18.patch b/app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-5.2.18-linux-4.18.patch
new file mode 100644 (file)
index 0000000..ed31494
--- /dev/null
@@ -0,0 +1,29 @@
+Author: Larry Finger
+Origin: https://www.mail-archive.com/vbox-dev@virtualbox.org/msg09363.html
+
+--- a/src/VBox/Additions/linux/sharedfolders/utils.c
++++ b/src/VBox/Additions/linux/sharedfolders/utils.c
+@@ -50,7 +50,11 @@ static void sf_timespec_from_ftime(RTTIMESPEC *ts, time_t *time)
+     RTTimeSpecSetNano(ts, t);
+ }
+ #else /* >= 2.6.0 */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0)
++static void sf_ftime_from_timespec(struct timespec64 *tv, RTTIMESPEC *ts)
++#else
+ static void sf_ftime_from_timespec(struct timespec *tv, RTTIMESPEC *ts)
++#endif
+ {
+     int64_t t = RTTimeSpecGetNano(ts);
+     int64_t nsec;
+@@ -60,7 +64,11 @@ static void sf_ftime_from_timespec(struct timespec *tv, RTTIMESPEC *ts)
+     tv->tv_nsec = nsec;
+ }
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0)
++static void sf_timespec_from_ftime(RTTIMESPEC *ts, struct timespec64 *tv)
++#else
+ static void sf_timespec_from_ftime(RTTIMESPEC *ts, struct timespec *tv)
++#endif
+ {
+     int64_t t = (int64_t)tv->tv_nsec + (int64_t)tv->tv_sec * 1000000000;
+     RTTimeSpecSetNano(ts, t);
index f5deb742885e0a148216cc58c853cc5f34d284fd..e0a70e26ee7b3339370315f749f8a1d821240275 100644 (file)
@@ -66,6 +66,11 @@ pkg_setup() {
 src_unpack() {
        unpack ${A}
 
+       # Apply before we create archive with Linux guest kernel modules
+       pushd "${S}" &>/dev/null || die
+       eapply "${FILESDIR}"/virtualbox-guest-additions-5.2.18-linux-4.18.patch # 663488
+       popd &>/dev/null || die
+
        # Create and unpack a tarball with the sources of the Linux guest
        # kernel modules, to include all the needed files
        "${S}"/src/VBox/Additions/linux/export_modules.sh "${WORKDIR}/vbox-kmod.tar.gz"
index e694510dc385f64d9efd3ea3a76ad53d99f3c010..551c7bdd592f99e85858e331a2d9abb25eadccb5 100644 (file)
@@ -62,6 +62,11 @@ pkg_setup() {
 src_unpack() {
        unpack ${A}
 
+       # Apply before we create archive with Linux guest kernel modules
+       pushd "${S}" &>/dev/null || die
+       eapply "${FILESDIR}"/virtualbox-guest-additions-5.2.18-linux-4.18.patch # 663488
+       popd &>/dev/null || die
+
        # Create and unpack a tarball with the sources of the Linux guest
        # kernel modules, to include all the needed files
        "${S}"/src/VBox/Additions/linux/export_modules.sh "${WORKDIR}/vbox-kmod.tar.gz"
index e694510dc385f64d9efd3ea3a76ad53d99f3c010..551c7bdd592f99e85858e331a2d9abb25eadccb5 100644 (file)
@@ -62,6 +62,11 @@ pkg_setup() {
 src_unpack() {
        unpack ${A}
 
+       # Apply before we create archive with Linux guest kernel modules
+       pushd "${S}" &>/dev/null || die
+       eapply "${FILESDIR}"/virtualbox-guest-additions-5.2.18-linux-4.18.patch # 663488
+       popd &>/dev/null || die
+
        # Create and unpack a tarball with the sources of the Linux guest
        # kernel modules, to include all the needed files
        "${S}"/src/VBox/Additions/linux/export_modules.sh "${WORKDIR}/vbox-kmod.tar.gz"