Bug 218748 - emulators/virtualbox-ose (5.1.18): Doesn't upgrading to 5.1.20
Summary: emulators/virtualbox-ose (5.1.18): Doesn't upgrading to 5.1.20
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Virtualbox Team (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-19 09:33 UTC by Vladimir Omelchuk
Modified: 2017-04-19 18:13 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (vbox)


Attachments
portupgrade_VBox_5.1.20.log (19.54 KB, text/x-log)
2017-04-19 09:33 UTC, Vladimir Omelchuk
no flags Details
patch-UIMiniToolBar.cpp (750 bytes, patch)
2017-04-19 11:17 UTC, Walter Schwarzenfeld
no flags Details | Diff
proposed_patch-UIMiniToolBar.cpp (1.37 KB, patch)
2017-04-19 13:13 UTC, Walter Schwarzenfeld
no flags Details | Diff
patch_svn.diff (2.14 KB, patch)
2017-04-19 14:30 UTC, Vladimir Omelchuk
no flags Details | Diff
svn-diff_virtualbox-ose (2.99 KB, patch)
2017-04-19 17:06 UTC, Walter Schwarzenfeld
no flags Details | Diff
svn-diff-virtualbox-ose_2 (2.99 KB, patch)
2017-04-19 17:11 UTC, Walter Schwarzenfeld
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Omelchuk 2017-04-19 09:33:34 UTC
Created attachment 181888 [details]
portupgrade_VBox_5.1.20.log

I tried upgrading VBox to 5.1.20 with and without ccache, with default clang (3.4.1) and clang 4.0.
Always same error (part of log):
[…]
4 warnings generated.
kBuild: Compiling VirtualBox - /usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.1.20/src/VBox/Frontends/VirtualBox/src/widgets/UIToolBar.cpp
kBuild: Compiling VirtualBox - /usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.1.20/src/VBox/Frontends/VirtualBox/src/widgets/VBoxGuestRAMSlider.cpp
kBuild: Compiling VirtualBox - /usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.1.20/src/VBox/Frontends/VirtualBox/src/widgets/VBoxMediaComboBox.cpp
kBuild: Compiling VirtualBox - /usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.1.20/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.1.20/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp:32:11: fatal error: 'QWindow' file not
      found
# include <Qwindow>
[...]

<uname>
FreeBSD 10.3-RELEASE-p18 amd64

<make.conf>
CPUTYPE?=core2
OPTIONS_SET=CUPS
WITHOUT_LPR=YES
DEFAULT_VERSIONS+=apache=2.4
QT4_OPTIONS=CUPS NAS QGTKSTYLE
LOCALIZED_LANG=ru
MAKE_JOBS_UNSAFE=yes
DEFAULT_VERSIONS+=mysql=5.7
.if ${.CURDIR:M*/ports/devel/ccache}
NO_CCACHE=yes
.endif
DEFAULT_VERSIONS+=ssl=openssl
.if ${.CURDIR:M*/emulators/linux-c6}
OPTIONS_SET=NVIDIA_GL
.endif
.if ${.CURDIR:M*/graphics/linux-c6-glx-utils}
OPTIONS_SET=NVIDIA_GL
.endif
.if ${.CURDIR:M*/x11-toolkits/linux-c6-qt47-x11}
OPTIONS_SET=NVIDIA_GL
.endif
DEFAULT_VERSIONS+=samba=4.3
Comment 1 Walter Schwarzenfeld freebsd_triage 2017-04-19 11:14:46 UTC
This could fixed with 
--- src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp.orig    2017-04-19 09:40:35 UTC
+++ src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp
@@ -29,7 +29,9 @@
 # include <QToolButton>
 # include <QStateMachine>
 # include <QPainter>
+# if QT_VERSION >= 0x050000
 # include <QWindow>
+# endif
 # ifdef VBOX_WS_X11
 #  include <QWindowStateChangeEvent>
 # endif
@@ -806,6 +808,8 @@ void UIMiniToolBar::sltAdjust()
 #endif
 }
 
+# if QT_VERSION >= 0x050000
+
 void UIMiniToolBar::sltAdjustTransience()
 {
     // WORKAROUND:
@@ -818,6 +822,8 @@ void UIMiniToolBar::sltAdjustTransience(


So it compiles, but after this it does not start:

VirtualBox: supR3HardenedMainGetTrustedMain: dlopen("/usr/local/lib/virtualbox/VirtualBox.so",) failed: /usr/local/lib/virtualbox/VirtualBox.so: Undefined symbol "_ZN13UIMiniToolBar19sltAdjustTransienceEv"
Comment 2 Walter Schwarzenfeld freebsd_triage 2017-04-19 11:17:06 UTC
Created attachment 181890 [details]
patch-UIMiniToolBar.cpp
Comment 3 Walter Schwarzenfeld freebsd_triage 2017-04-19 11:17:52 UTC
Sorry, there was a paste error. It was not complete. I attached the whole
patch.
Comment 4 Walter Schwarzenfeld freebsd_triage 2017-04-19 11:20:44 UTC
Oh, I does not read the second error message correct. Obsolete the patch.
Comment 5 Walter Schwarzenfeld freebsd_triage 2017-04-19 13:13:10 UTC
Created attachment 181897 [details]
proposed_patch-UIMiniToolBar.cpp
Comment 6 Walter Schwarzenfeld freebsd_triage 2017-04-19 13:14:22 UTC
If I am right, this should work. It seems it is  caused by the qt5 WORKAROUND
in UIMiniToolBar.cpp.
Comment 7 Vladimir Omelchuk 2017-04-19 14:30:14 UTC
Created attachment 181905 [details]
patch_svn.diff
Comment 8 Vladimir Omelchuk 2017-04-19 14:30:39 UTC
Patch work fine for me!
Thanks!

Version VBox in the CLI:
admin@vladiom:~ % vboxmanage --version
5.1.20r114628

Version VBox in the GUI (with warning message):
admin@vladiom:~ % VirtualBox
Qt WARNING: libpng warning: iCCP: known incorrect sRGB profile

VirtualBox Graphical User Interface Version 5.1.20 r114628

In the attachment patch for the port.
Comment 9 Walter Schwarzenfeld freebsd_triage 2017-04-19 16:21:12 UTC
Thanks. but the svn-diff has a problem with poudriere.
I think we had to rename the patch to
extrapatch-src_VBox_Frontends_VirtualBox_src_widgets_UIMiniToolBar.cpp
and add to the Makefile
EXTRA_PATCHES+= ${PATCHFILE}/patch-src_VBox_Frontends_VirtualBox_src_widgets_UIMiniToolBar.cpp

cause virtualbox-ose-kmod tries to take the patch.
Comment 10 Walter Schwarzenfeld freebsd_triage 2017-04-19 16:23:37 UTC
correct:
EXTRA_PATCHES+= ${PATCHFILE}/extrapatch-src_VBox_Frontends_VirtualBox_src_widgets_UIMiniToolBar.cpp
Comment 11 Jung-uk Kim freebsd_committer freebsd_triage 2017-04-19 16:47:37 UTC
I've been trying to keep Qt4 support but it's getting harder and harder.

https://svnweb.freebsd.org/changeset/ports/431852
https://svnweb.freebsd.org/changeset/ports/434552
https://svnweb.freebsd.org/changeset/ports/435797

As I threatened earlier, I think it's time to let go of Qt4 support.  Do we really want to keep going like this?
Comment 12 Walter Schwarzenfeld freebsd_triage 2017-04-19 17:06:53 UTC
Created attachment 181912 [details]
svn-diff_virtualbox-ose
Comment 13 Walter Schwarzenfeld freebsd_triage 2017-04-19 17:11:57 UTC
Created attachment 181913 [details]
svn-diff-virtualbox-ose_2
Comment 14 Walter Schwarzenfeld freebsd_triage 2017-04-19 17:14:58 UTC
(In reply to Jung-uk Kim from comment #11)
If qt4 is "over", it is over. You only had to remove the qt4 option.
Comment 15 Vladimir Omelchuk 2017-04-19 17:16:49 UTC
(In reply to Jung-uk Kim from comment #11)

> As I threatened earlier, I think it's time to let go of Qt4 support.
> Do we really want to keep going like this?

Of course NOT!

(In reply to w.schwarzenfeld from comment #14)

I agree! :)
Comment 16 commit-hook freebsd_committer freebsd_triage 2017-04-19 18:11:38 UTC
A commit references this bug:

Author: jkim
Date: Wed Apr 19 18:10:34 UTC 2017
New revision: 438899
URL: https://svnweb.freebsd.org/changeset/ports/438899

Log:
  - Fix build with option QT4.
  - Warn users Qt4 support may be removed in the future.

  PR:		218748
  Submitted by:	w dot schwarzenfeld at utanet dot at (initial)

Changes:
  head/emulators/virtualbox-ose/Makefile
  head/emulators/virtualbox-ose/files/extrapatch-src_VBox_Frontends_VirtualBox_src_widgets_UIMiniToolBar.cpp
Comment 17 Jung-uk Kim freebsd_committer freebsd_triage 2017-04-19 18:13:20 UTC
I went ahead and committed the patch (with minor changes).  However, I also added a warning that the option may be removed in the future.