commit f3c34ca231c93293cb21ecf4675e310408d4f4c4
Author: Sérgio M. Basto <sergio(a)serjux.com>
Date: Thu Oct 17 14:29:54 2024 +0100
Not build test cases
Minor cleanup of scripts for el7
VirtualBox.spec | 74 +++++++++++++++++---------------------
cxx17.patch | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 140 insertions(+), 42 deletions(-)
---
diff --git a/VirtualBox.spec b/VirtualBox.spec
index c0300ac..2f05902 100644
--- a/VirtualBox.spec
+++ b/VirtualBox.spec
@@ -23,7 +23,7 @@
%bcond_with docs
%bcond_without vnc
-%if 0%{?fedora} > 27 || 0%{?rhel} >= 9
+%if 0%{?fedora} > 27 || 0%{?rhel} > 8
%bcond_with guest_additions
%else
%bcond_without guest_additions
@@ -50,7 +50,7 @@
Name: VirtualBox
Version: 7.1.2
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: A general-purpose full virtualizer for PC hardware
License: GPL-3.0-only AND (GPL-3.0-only OR CDDL-1.0)
@@ -91,6 +91,7 @@ Patch54:
VirtualBox-7.0.2-ExtPacks-VBoxDTrace-no-publisher-in-version.patch
# from Fedora
Patch60: VirtualBox-7.0.2-xclient-cleanups.patch
# from OpenSuse
+Patch65: cxx17.patch
# from Arch
Patch70: 009-properly-handle-i3wm.patch
@@ -177,8 +178,8 @@ BuildRequires: libvncserver-devel
%if %{with system_libtpms}
BuildRequires: pkgconfig(libtpms)
%endif
-#BuildRequires: pkgconfig(ogg)
-#BuildRequires: pkgconfig(vorbis)
+BuildRequires: pkgconfig(ogg)
+BuildRequires: pkgconfig(vorbis)
%if %{with dxvk_native}
BuildRequires: glslang
#BuildRequires: dxvk-native-devel
@@ -328,7 +329,7 @@ rm -r src/libs/libtpms-0.9.*/
#patch -P 50 -p1 -b .mageia-support
%patch -P 54 -p1 -b .dtrace
%patch -P 60 -p1 -b .xclient
-
+%patch -P 65 -p1 -b .cxx17
%patch -P 70 -p1 -b .i3wm
@@ -351,6 +352,7 @@ rm -r src/libs/libtpms-0.9.*/
cp %{SOURCE1} UserManual.pdf
%endif
+#--enable-libogg --enable-libvorbis
#--enable-vde
#--build-headless --build-libxml2
#--disable-java
@@ -375,10 +377,15 @@ kmk %{_smp_mflags} \
PATH_OUT="$PWD/obj" \
TOOL_YASM_AS=yasm \
VBOX_PATH_APP_PRIVATE=%{_libdir}/virtualbox \
+ VBOX_PATH_APP_PRIVATE_ARCH=%{_libdir}/virtualbox \
VBOX_PATH_APP_DOCS=%{_docdir}/VirtualBox \
+ VBOX_WITH_ORIGIN= \
+ VBOX_WITH_RUNPATH=%{_libdir}/virtualbox \
+ VBOX_GUI_WITH_SHARED_LIBRARY=1 \
+ VBOX_PATH_SHARED_LIBS=%{_libdir}/virtualbox \
VBOX_WITH_VBOX_IMG=1 \
VBOX_WITH_VBOXIMGMOUNT=1 \
- VBOX_WITH_SYSFS_BY_DEFAULT=1 \
+ VBOX_WITH_UNATTENDED=1 \
VBOX_USE_SYSTEM_XORG_HEADERS=1 \
VBOX_USE_SYSTEM_GL_HEADERS=1 \
VBOX_NO_LEGACY_XORG_X11=1 \
@@ -396,13 +403,20 @@ kmk %{_smp_mflags} \
%{?with_docs: VBOX_WITH_DOCS=1 } \
VBOX_JAVA_HOME=%{_prefix}/lib/jvm/java \
VBOX_WITH_UPDATE_REQUEST= \
- VBOX_WITHOUT_PRECOMPILED_HEADERS=1 \
+ VBOX_WITH_TESTCASES= \
+ VBOX_WITH_TESTSUITE= \
+ VBOX_WITH_HOST_SHIPPING_AUDIO_TEST= \
+ VBOX_WITH_VALIDATIONKIT= \
VBOX_BUILD_PUBLISHER=%{publisher}
# VBOX_WITH_CLOUD_NET:=
-# VBOX_WITH_TESTCASES= \
-# VBOX_WITH_VALIDATIONKIT= \
+# VBOX_WITH_VBOXSDL=1 \
+# VBoxSDL_INCS += \
+# VBoxSDL_LIBS
+# VBOX_WITH_SYSFS_BY_DEFAULT=1 \
+# VBOX_WITHOUT_PRECOMPILED_HEADERS=1 \
# VBOX_XCURSOR_LIBS="Xcursor Xext X11 GL" \
+# VBOX_DOCBOOK_WITH_LATEX := 1
# build fails with system dxvk_native
@@ -507,8 +521,8 @@ ln -s VBox %{buildroot}%{_bindir}/VirtualBox
ln -s VBox %{buildroot}%{_bindir}/virtualbox
ln -s VBox %{buildroot}%{_bindir}/VBoxManage
ln -s VBox %{buildroot}%{_bindir}/vboxmanage
-ln -s VBox %{buildroot}%{_bindir}/VBoxSDL
-ln -s VBox %{buildroot}%{_bindir}/vboxsdl
+#ln -s VBox %{buildroot}%{_bindir}/VBoxSDL
+#ln -s VBox %{buildroot}%{_bindir}/vboxsdl
ln -s VBox %{buildroot}%{_bindir}/VBoxVRDP
ln -s VBox %{buildroot}%{_bindir}/VBoxHeadless
ln -s VBox %{buildroot}%{_bindir}/vboxheadless
@@ -656,35 +670,6 @@ fi
%triggerun -- VirtualBox-server < 0:6.1.10-4
/usr/bin/systemctl --no-reload preset vboxdrv.service || :
-# Need review, I don't know the rules of Icon Cache, mimeinfo and Desktop databases
for epel 8
-%if 0%{?rhel} && 0%{?rhel} < 8
-%post
-# Icon Cache
-/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
-# mimeinfo F23 only
-/bin/touch --no-create %{_datadir}/mime/packages &>/dev/null || :
-# Desktop databases F23 and F24 only
-/usr/bin/update-desktop-database &> /dev/null || :
-
-%postun
-if [ $1 -eq 0 ] ; then
- # Package upgrade, not uninstall
- # Icon Cache
- /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
- /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
- # mimeinfo F23 only
- /usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
-fi
-# Desktop databases F23 and F24 only
-/usr/bin/update-desktop-database &> /dev/null || :
-
-%posttrans
-# Icon Cache
-/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
-# mimeinfo F23 only
-/usr/bin/update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :
-%endif
-
%post webservice
%systemd_post vboxweb.service
@@ -752,8 +737,8 @@ getent passwd vboxadd >/dev/null || \
%{_bindir}/VBoxHeadless
%{_bindir}/VBoxManage
%{_bindir}/vboxmanage
-%{_bindir}/VBoxSDL
-%{_bindir}/vboxsdl
+#{_bindir}/VBoxSDL
+#{_bindir}/vboxsdl
%{_bindir}/VBoxVRDP
%{_bindir}/VirtualBoxVM
%{_bindir}/virtualboxvm
@@ -787,6 +772,7 @@ getent passwd vboxadd >/dev/null || \
%attr(4511,root,root) %{_libdir}/virtualbox/VBoxNetNAT
%attr(4511,root,root) %{_libdir}/virtualbox/VBoxVolInfo
%attr(4511,root,root) %{_libdir}/virtualbox/VBoxHeadless
+#%%attr(4511,root,root) %%{_libdir}/virtualbox/VBoxSDL
%attr(4511,root,root) %{_libdir}/virtualbox/VBoxNetDHCP
%attr(4511,root,root) %{_libdir}/virtualbox/VBoxNetAdpCtl
%attr(4511,root,root) %{_libdir}/virtualbox/VirtualBoxVM
@@ -851,6 +837,10 @@ getent passwd vboxadd >/dev/null || \
%{_datadir}/%{name}-kmod-%{version}
%changelog
+* Fri Oct 04 2024 Sérgio Basto <sergio(a)serjux.com> - 7.1.2-2
+- Not build test cases
+- Minor cleanup of scripts for el7
+
* Fri Sep 27 2024 Sérgio Basto <sergio(a)serjux.com> - 7.1.2-1
- Update VirtualBox to 7.1.2
diff --git a/cxx17.patch b/cxx17.patch
new file mode 100644
index 0000000..640ce2e
--- /dev/null
+++ b/cxx17.patch
@@ -0,0 +1,108 @@
+From: Jan Engelhardt <ej(a)inai.de>
+Date: 2024-09-20 22:48:58.758026690 +0200
+
+The code uses <filesystem>, so ensure we always use -std=c++17 at the
+very least.
+
+Prior to C++17, noexcept cannot be part of a type alias, and so is
+not part of the function signature, and so is not part of the ABI.
+
+In C++17, noexcept is significant. There is a compile error because
+the FNCONSUMER alias as defined in a .h file does not match the
+function body in a .cpp file.
+
+The def file is also wrong, but no one at
virtualbox.org noticed for
+some reason, even though the def mismatch also caused a link/build
+failure in its own right.
+
+To resolve the mismatch between .cpp/.h, the function signature is
+augmented by RT_NOEXCEPT, based upon the function head being the
+authoritative source as to whether something was meant to be noexcept
+or not.
+
+In turn, adding RT_NOEXCEPT causes a change in the ABI of VBoxRT.so.
+The closed-source VirtualBox extension pack does not expect that and
+is unable to load [LD_BIND_NOW=1]. To resolve _that_, we add extra
+symbol aliases.
+
+---
+ Config.kmk | 3 +++
+ include/iprt/cpp/restclient.h | 12 ++++++++++--
+ src/VBox/Runtime/VBox/VBoxRTImp-gcc.def | 2 +-
+ src/VBox/Runtime/common/rest/rest-binary.cpp | 9 +++++++++
+ 4 files changed, 23 insertions(+), 3 deletions(-)
+
+Index: VirtualBox-7.1.0/Config.kmk
+===================================================================
+--- VirtualBox-7.1.0.orig/Config.kmk
++++ VirtualBox-7.1.0/Config.kmk
+@@ -3093,6 +3093,9 @@ ifeq ($(KBUILD_TARGET),darwin)
+ endif
+ endif
+ endif
++ifndef VBOX_GCC_std
++ VBOX_GCC_std := -std=c++17
++endif
+
+ #
+ # Check for incompatible rpath combinations.
+Index: VirtualBox-7.1.0/include/iprt/cpp/restclient.h
+===================================================================
+--- VirtualBox-7.1.0.orig/include/iprt/cpp/restclient.h
++++ VirtualBox-7.1.0/include/iprt/cpp/restclient.h
+@@ -130,7 +130,11 @@ public:
+ * is the sum of the previously returned @a *pcbActual values.
+ */
+ typedef DECLCALLBACKTYPE(int, FNPRODUCER,(RTCRestBinaryParameter *a_pThis, void
*a_pvDst, size_t a_cbDst,
+- uint64_t a_offContent, size_t
*a_pcbActual)) /*RT_NOEXCEPT*/;
++ uint64_t a_offContent, size_t
*a_pcbActual))
++#if defined(__cplusplus) && __cplusplus >= 201700L
++RT_NOEXCEPT
++#endif
++;
+ /** Pointer to a byte producer callback. */
+ typedef FNPRODUCER *PFNPRODUCER;
+
+@@ -268,7 +272,11 @@ public:
+ * is the sum of the previous @a a_cbSrc values.
+ */
+ typedef DECLCALLBACKTYPE(int, FNCONSUMER,(RTCRestBinaryResponse *a_pThis, const void
*a_pvSrc, size_t a_cbSrc,
+- uint32_t a_uHttpStatus, uint64_t
a_offContent, uint64_t a_cbContent)) /*RT_NOEXCEPT*/;
++ uint32_t a_uHttpStatus, uint64_t
a_offContent, uint64_t a_cbContent))
++#if defined(__cplusplus) && __cplusplus >= 201700L
++RT_NOEXCEPT
++#endif
++;
+ /** Pointer to a byte consumer callback. */
+ typedef FNCONSUMER *PFNCONSUMER;
+
+Index: VirtualBox-7.1.0/src/VBox/Runtime/VBox/VBoxRTImp-gcc.def
+===================================================================
+--- VirtualBox-7.1.0.orig/src/VBox/Runtime/VBox/VBoxRTImp-gcc.def
++++ VirtualBox-7.1.0/src/VBox/Runtime/VBox/VBoxRTImp-gcc.def
+@@ -379,7 +379,7 @@ EXPORTS
+ _ZN22RTCRestBinaryParameter16xmitHttpCallbackEP14RTHTTPINTERNALPvmyPmS2_ ;
int64=llong
+ _ZN22RTCRestBinaryParameter19setProducerCallbackEPFiPS_PvmmPmES1_m ;
before-noexcept int64=long
+ _ZN22RTCRestBinaryParameter19setProducerCallbackEPFiPS_PvmyPmES1_y ;
before-noexcept int64=llong
+- _ZN22RTCRestBinaryParameter19setProducerCallbackEPDoFiPS_PvmyPmES1_m ;
after-noexcept int64=long
++ _ZN22RTCRestBinaryParameter19setProducerCallbackEPDoFiPS_PvmmPmES1_m ;
after-noexcept int64=long
+ _ZN22RTCRestBinaryParameter19setProducerCallbackEPDoFiPS_PvmyPmES1_y ;
after-noexcept int64=llong
+ _ZN22RTCRestBinaryParameterC1Ev
+ _ZN22RTCRestBinaryParameterC2Ev
+Index: VirtualBox-7.1.0/src/VBox/Runtime/common/rest/rest-binary.cpp
+===================================================================
+--- VirtualBox-7.1.0.orig/src/VBox/Runtime/common/rest/rest-binary.cpp
++++ VirtualBox-7.1.0/src/VBox/Runtime/common/rest/rest-binary.cpp
+@@ -706,3 +706,12 @@ void RTCRestBinaryResponse::receiveCompl
+ AssertRC(rc);
+ }
+
++// extpack was built with wrong -std=, add a redirect
++extern "C" void DECLEXPORT_CLASS __attribute__((weak,
++alias("_ZN21RTCRestBinaryResponse19setConsumerCallbackEPDoFiPS_PKvmjmmEPv")))
// T symbol that exists
++ _ZN21RTCRestBinaryResponse19setConsumerCallbackEPFiPS_PKvmjmmEPv( // W symbol to
make
++ RTCRestBinaryResponse::PFNCONSUMER, void *);
++extern "C" void DECLEXPORT_CLASS __attribute__((weak,
++alias("_ZN22RTCRestBinaryParameter19setProducerCallbackEPDoFiPS_PvmmPmES1_m")))
// T
++ _ZN22RTCRestBinaryParameter19setProducerCallbackEPFiPS_PvmmPmES1_m( // W
++ RTCRestBinaryParameter::PFNPRODUCER, void *, uint64_t);