Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 605018 - app-crypt/veracrypt-1.19 fails to compile with USE=-X
Summary: app-crypt/veracrypt-1.19 fails to compile with USE=-X
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Göktürk Yüksek
URL: https://trac.wxwidgets.org/ticket/18038
Whiteboard:
Keywords:
: 693490 (view as bug list)
Depends on: 617440
Blocks:
  Show dependency tree
 
Reported: 2017-01-08 07:27 UTC by Sandino Araico Sanchez
Modified: 2019-10-15 23:21 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch for wxGTK fixes missing wx/eventloopsrc.h (wxGTK-3.0.2.0-missing-evtloopsrc-h.patch,955 bytes, patch)
2017-01-08 07:29 UTC, Sandino Araico Sanchez
Details | Diff
ebuild for wxGTK-3.0.2.0-r4 (wxGTK-3.0.2.0-r4.ebuild,4.52 KB, text/plain)
2017-01-08 07:33 UTC, Sandino Araico Sanchez
Details
patch for missing -lwx_baseu_adv-3.0 and -lwx_baseu_core-3.0 (veracrypt-1.19-missing-libs.patch,489 bytes, patch)
2017-01-08 07:44 UTC, Sandino Araico Sanchez
Details | Diff
ebuild for veracrypt-1.19-r1 (veracrypt-1.19-r1.ebuild,1.99 KB, text/plain)
2017-01-08 07:48 UTC, Sandino Araico Sanchez
Details
patch for missing -lwx_baseu_adv-3.0 and -lwx_baseu_core-3.0 (veracrypt-1.19-missing-libs.patch,433 bytes, patch)
2017-01-09 07:02 UTC, Sandino Araico Sanchez
Details | Diff
ebuild for veracrypt-1.19-r1 (veracrypt-1.19-r1.ebuild,2.12 KB, text/plain)
2017-01-09 07:07 UTC, Sandino Araico Sanchez
Details
Proposed fix (v1-0001-app-crypt-veracrypt-fix-the-linking-against-wxGTK.patch,5.95 KB, patch)
2019-10-11 22:34 UTC, Göktürk Yüksek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sandino Araico Sanchez 2017-01-08 07:27:03 UTC
From bug #522186

 Jan-Erik Skata 2017-01-04 11:04:18 UTC

Build fails on one of my machines;

Compiling UserPreferences.cpp
x86_64-pc-linux-gnu-g++ -MMD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES -I/var/tmp/portage/app-crypt/veracrypt-1.19/work/VeraCrypt-VeraCrypt_1.19/src -I/var/tmp/portage/app-crypt/veracrypt-1.19/work/VeraCrypt-VeraCrypt_1.19/src/Crypto -DTC_NO_GUI -I/var/tmp/portage/app-crypt/veracrypt-1.19/work/VeraCrypt-VeraCrypt_1.19/src/PKCS11 -O2 -fno-strict-aliasing   -D TC_ARCH_X64 -DTC_UNIX -DTC_LINUX -fdata-sections -ffunction-sections -Wall -Wno-unused-parameter -msse2 -maes -march=core2 -O2 -pipe -fomit-frame-pointer -I/var/tmp/portage/app-crypt/veracrypt-1.19/work/VeraCrypt-VeraCrypt_1.19/src/Main -I/usr/lib64/wx/include/base-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -pthread -c UserPreferences.cpp -o UserPreferences.o
In file included from /usr/include/wx-3.0/wx/apptrait.h:176:0,
                 from UserInterface.cpp:16:
/usr/include/wx-3.0/wx/unix/apptbase.h:15:27: fatal error: wx/evtloopsrc.h: No such file or directory
compilation terminated.
make[1]: *** [/var/tmp/portage/app-crypt/veracrypt-1.19/work/VeraCrypt-VeraCrypt_1.19/src/Build/Include/Makefile.inc:24: UserInterface.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/var/tmp/portage/app-crypt/veracrypt-1.19/work/VeraCrypt-VeraCrypt_1.19/src/Main'
make: *** [Makefile:338: all] Error 2
 * ERROR: app-crypt/veracrypt-1.19::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=app-crypt/veracrypt-1.19::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-crypt/veracrypt-1.19::gentoo'`.
 * The complete build log is located at '/var/log/portage/app-crypt:veracrypt-1.19:20170104-105743.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/app-crypt/veracrypt-1.19/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-crypt/veracrypt-1.19/temp/environment'.
 * Working directory: '/var/tmp/portage/app-crypt/veracrypt-1.19/work/VeraCrypt-VeraCrypt_1.19/src'
 * S: '/var/tmp/portage/app-crypt/veracrypt-1.19/work/VeraCrypt-VeraCrypt_1.19/src'

Even though 
find /usr -name evtloopsrc.h
/usr/include/wx-3.0/wx/unix/evtloopsrc.h
Comment 1 Sandino Araico Sanchez 2017-01-08 07:29:47 UTC
Created attachment 459126 [details, diff]
patch for wxGTK fixes missing wx/eventloopsrc.h
Comment 2 Sandino Araico Sanchez 2017-01-08 07:33:07 UTC
Created attachment 459128 [details]
ebuild for wxGTK-3.0.2.0-r4

This ebuild applies patch wxGTK-3.0.2.0-missing-evtloopsrc-h.patch. This patch fixes missing eventloopsrc.h errors.
Comment 3 Sandino Araico Sanchez 2017-01-08 07:38:27 UTC
With the patched wkGTK (wxGTK-3.0.2.0-r4.ebuild with wxGTK-3.0.2.0-missing-evtloopsrc-h.patch) reported errors get fixed bit new errors show up at linking:

x86_64-pc-linux-gnu-g++ -o veracrypt  Application.o CommandLineInterface.o FavoriteVolume.o LanguageStrings.o StringFormatter.o TextUserInterface.o UserInterface.o UserPreferences.o Xml.o Unix/Main.o Resources.o /usr/src/portage/app-crypt/veracrypt-1.19-r1/work/VeraCrypt-VeraCrypt_1.19/src/Core/Core.a /usr/src/portage/app-crypt/veracrypt-1.19-r1/work/VeraCrypt-VeraCrypt_1.19/src/Driver/Fuse/Driver.a /usr/src/portage/app-crypt/veracrypt-1.19-r1/work/VeraCrypt-VeraCrypt_1.19/src/Volume/Volume.a /usr/src/portage/app-crypt/veracrypt-1.19-r1/work/VeraCrypt-VeraCrypt_1.19/src/Platform/Platform.a  -lfuse -pthread  -L/usr/lib64 -pthread   -lwx_baseu_adv-3.0 -lwx_baseu_core-3.0 -lwx_baseu-3.0   -Wl,--gc-sections -Wl,--hash-style=sysv -ldl -Wl,-O1 -Wl,--as-needed
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lwx_baseu_adv-3.0
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lwx_baseu_core-3.0
collect2: error: ld returned 1 exit status
Main.make:137: recipe for target 'veracrypt' failed
make[1]: *** [veracrypt] Error 1
make[1]: Leaving directory '/usr/src/portage/app-crypt/veracrypt-1.19-r1/work/VeraCrypt-VeraCrypt_1.19/src/Main'
Makefile:337: recipe for target 'all' failed
make: *** [all] Error 2
Comment 4 Sandino Araico Sanchez 2017-01-08 07:44:00 UTC
Created attachment 459132 [details, diff]
patch for missing -lwx_baseu_adv-3.0 and -lwx_baseu_core-3.0

Libraries -lwx_baseu_adv-3.0 and -lwx_baseu_core-3.0 are not installed when you compile x11-libs/wxGTK with USE=-X

This patch fixes linking errors by calling wx-config --libs base instead of wx-config --libs adv,core,base since adv and core libraries are not installed and not needed for USE=-X.
Comment 5 Sandino Araico Sanchez 2017-01-08 07:48:18 UTC
Created attachment 459134 [details]
ebuild for veracrypt-1.19-r1

This ebuild applies patch veracrypt-1.19-missing-libs.patch to fix linking errors

USE=-X emerge =x11-libs/wxGTK-3.0.2.0-r4
USE=-X emerge =app-crypt/veracrypt-1.19-r1

Both packages compile and install successfully.
Comment 7 Göktürk Yüksek archtester gentoo-dev 2017-01-08 23:28:38 UTC
This patch fails for me:

$ USE='-X' ebuild veracrypt-1.19-r1.ebuild clean compile

...
x86_64-pc-linux-gnu-g++ -o veracrypt  Application.o CommandLineInterface.o FavoriteVolume.o LanguageStrings.o StringFormatter.o TextUserInterface.o UserInterface.o UserPreferences.o Xml.o Unix/Main.o Resources.o /var/tmp/portage/app-crypt/veracrypt-1.19-r1/work/VeraCrypt-VeraCrypt_1.19/src/Core/Core.a /var/tmp/portage/app-crypt/veracrypt-1.19-r1/work/VeraCrypt-VeraCrypt_1.19/src/Driver/Fuse/Driver.a /var/tmp/portage/app-crypt/veracrypt-1.19-r1/work/VeraCrypt-VeraCrypt_1.19/src/Volume/Volume.a /var/tmp/portage/app-crypt/veracrypt-1.19-r1/work/VeraCrypt-VeraCrypt_1.19/src/Platform/Platform.a  -lfuse -pthread  -L/usr/lib64 -pthread   -lwx_baseu-3.0   -Wl,--gc-sections -Wl,--hash-style=sysv -ldl -Wl,-O1 -Wl,--as-needed
TextUserInterface.o:(.rodata._ZTVN9VeraCrypt17TextUserInterfaceE[_ZTVN9VeraCrypt17TextUserInterfaceE]+0x10): undefined reference to `wxApp::GetClassInfo() const'
TextUserInterface.o:(.rodata._ZTVN9VeraCrypt17TextUserInterfaceE[_ZTVN9VeraCrypt17TextUserInterfaceE]+0xb8): undefined reference to `wxApp::Initialize(int&, wchar_t**)'
TextUserInterface.o:(.rodata._ZTVN9VeraCrypt17TextUserInterfaceE[_ZTVN9VeraCrypt17TextUserInterfaceE]+0xe8): undefined reference to `wxAppBase::OnExit()'
TextUserInterface.o:(.rodata._ZTVN9VeraCrypt17TextUserInterfaceE[_ZTVN9VeraCrypt17TextUserInterfaceE]+0xf8): undefined reference to `wxApp::CleanUp()'
TextUserInterface.o:(.rodata._ZTVN9VeraCrypt17TextUserInterfaceE[_ZTVN9VeraCrypt17TextUserInterfaceE]+0x110): undefined reference to `wxAppBase::OnInitCmdLine(wxCmdLineParser&)'
TextUserInterface.o:(.rodata._ZTVN9VeraCrypt17TextUserInterfaceE[_ZTVN9VeraCrypt17TextUserInterfaceE]+0x118): undefined reference to `wxAppBase::OnCmdLineParsed(wxCmdLineParser&)'
TextUserInterface.o:(.rodata._ZTVN9VeraCrypt17TextUserInterfaceE[_ZTVN9VeraCrypt17TextUserInterfaceE]+0x188): undefined reference to `wxApp::WakeUpIdle()'
TextUserInterface.o:(.rodata._ZTVN9VeraCrypt17TextUserInterfaceE[_ZTVN9VeraCrypt17TextUserInterfaceE]+0x190): undefined reference to `wxAppBase::ProcessIdle()'
TextUserInterface.o:(.rodata._ZTVN9VeraCrypt17TextUserInterfaceE[_ZTVN9VeraCrypt17TextUserInterfaceE]+0x1a0): undefined reference to `wxApp::OnAssertFailure(wchar_t const*, int, wchar_t const*, wchar_t const*, wchar_t const*)'
TextUserInterface.o:(.rodata._ZTVN9VeraCrypt17TextUserInterfaceE[_ZTVN9VeraCrypt17TextUserInterfaceE]+0x1b0): undefined reference to `wxAppBase::CreateTraits()'
TextUserInterface.o:(.rodata._ZTVN9VeraCrypt17TextUserInterfaceE[_ZTVN9VeraCrypt17TextUserInterfaceE]+0x1b8): undefined reference to `wxApp::OnInitGui()'
TextUserInterface.o:(.rodata._ZTVN9VeraCrypt17TextUserInterfaceE[_ZTVN9VeraCrypt17TextUserInterfaceE]+0x1c0): undefined reference to `wxAppBase::SafeYield(wxWindow*, bool)'
TextUserInterface.o:(.rodata._ZTVN9VeraCrypt17TextUserInterfaceE[_ZTVN9VeraCrypt17TextUserInterfaceE]+0x1c8): undefined reference to `wxAppBase::SafeYieldFor(wxWindow*, long)'
TextUserInterface.o:(.rodata._ZTVN9VeraCrypt17TextUserInterfaceE[_ZTVN9VeraCrypt17TextUserInterfaceE]+0x1d8): undefined reference to `wxAppBase::GetTopWindow() const'
TextUserInterface.o:(.rodata._ZTVN9VeraCrypt17TextUserInterfaceE[_ZTVN9VeraCrypt17TextUserInterfaceE]+0x1e0): undefined reference to `wxAppBase::GetDisplayMode() const'
TextUserInterface.o:(.rodata._ZTVN9VeraCrypt17TextUserInterfaceE[_ZTVN9VeraCrypt17TextUserInterfaceE]+0x1f8): undefined reference to `wxAppBase::GetLayoutDirection() const'
TextUserInterface.o:(.rodata._ZTVN9VeraCrypt17TextUserInterfaceE[_ZTVN9VeraCrypt17TextUserInterfaceE]+0x200): undefined reference to `wxApp::SetNativeTheme(wxString const&)'
TextUserInterface.o:(.rodata._ZTVN9VeraCrypt17TextUserInterfaceE[_ZTVN9VeraCrypt17TextUserInterfaceE]+0x208): undefined reference to `wxAppBase::SetActive(bool, wxWindow*)'
UserInterface.o: In function `VeraCrypt::UserInterface::UserInterface()':
UserInterface.cpp:(.text._ZN9VeraCrypt13UserInterfaceC2Ev+0x8): undefined reference to `wxApp::wxApp()'
UserInterface.cpp:(.text._ZN9VeraCrypt13UserInterfaceC2Ev+0x2b0): undefined reference to `wxApp::~wxApp()'
UserInterface.o: In function `VeraCrypt::UserInterface::~UserInterface()':
UserInterface.cpp:(.text._ZN9VeraCrypt13UserInterfaceD2Ev+0xd4): undefined reference to `wxApp::~wxApp()'
UserInterface.cpp:(.text._ZN9VeraCrypt13UserInterfaceD2Ev+0x114): undefined reference to `wxApp::~wxApp()'
UserInterface.o:(.rodata._ZTIN9VeraCrypt13UserInterfaceE[_ZTIN9VeraCrypt13UserInterfaceE]+0x10): undefined reference to `typeinfo for wxApp'
UserInterface.o:(.rodata._ZTVN9VeraCrypt13UserInterfaceE[_ZTVN9VeraCrypt13UserInterfaceE]+0x10): undefined reference to `wxApp::GetClassInfo() const'
UserInterface.o:(.rodata._ZTVN9VeraCrypt13UserInterfaceE[_ZTVN9VeraCrypt13UserInterfaceE]+0xb8): undefined reference to `wxApp::Initialize(int&, wchar_t**)'
UserInterface.o:(.rodata._ZTVN9VeraCrypt13UserInterfaceE[_ZTVN9VeraCrypt13UserInterfaceE]+0xd0): undefined reference to `wxAppBase::OnRun()'
UserInterface.o:(.rodata._ZTVN9VeraCrypt13UserInterfaceE[_ZTVN9VeraCrypt13UserInterfaceE]+0xe8): undefined reference to `wxAppBase::OnExit()'
UserInterface.o:(.rodata._ZTVN9VeraCrypt13UserInterfaceE[_ZTVN9VeraCrypt13UserInterfaceE]+0xf8): undefined reference to `wxApp::CleanUp()'
UserInterface.o:(.rodata._ZTVN9VeraCrypt13UserInterfaceE[_ZTVN9VeraCrypt13UserInterfaceE]+0x110): undefined reference to `wxAppBase::OnInitCmdLine(wxCmdLineParser&)'
UserInterface.o:(.rodata._ZTVN9VeraCrypt13UserInterfaceE[_ZTVN9VeraCrypt13UserInterfaceE]+0x118): undefined reference to `wxAppBase::OnCmdLineParsed(wxCmdLineParser&)'
UserInterface.o:(.rodata._ZTVN9VeraCrypt13UserInterfaceE[_ZTVN9VeraCrypt13UserInterfaceE]+0x188): undefined reference to `wxApp::WakeUpIdle()'
UserInterface.o:(.rodata._ZTVN9VeraCrypt13UserInterfaceE[_ZTVN9VeraCrypt13UserInterfaceE]+0x190): undefined reference to `wxAppBase::ProcessIdle()'
UserInterface.o:(.rodata._ZTVN9VeraCrypt13UserInterfaceE[_ZTVN9VeraCrypt13UserInterfaceE]+0x1a0): undefined reference to `wxApp::OnAssertFailure(wchar_t const*, int, wchar_t const*, wchar_t const*, wchar_t const*)'
UserInterface.o:(.rodata._ZTVN9VeraCrypt13UserInterfaceE[_ZTVN9VeraCrypt13UserInterfaceE]+0x1b0): undefined reference to `wxAppBase::CreateTraits()'
UserInterface.o:(.rodata._ZTVN9VeraCrypt13UserInterfaceE[_ZTVN9VeraCrypt13UserInterfaceE]+0x1b8): undefined reference to `wxApp::OnInitGui()'
UserInterface.o:(.rodata._ZTVN9VeraCrypt13UserInterfaceE[_ZTVN9VeraCrypt13UserInterfaceE]+0x1c0): undefined reference to `wxAppBase::SafeYield(wxWindow*, bool)'
UserInterface.o:(.rodata._ZTVN9VeraCrypt13UserInterfaceE[_ZTVN9VeraCrypt13UserInterfaceE]+0x1c8): undefined reference to `wxAppBase::SafeYieldFor(wxWindow*, long)'
UserInterface.o:(.rodata._ZTVN9VeraCrypt13UserInterfaceE[_ZTVN9VeraCrypt13UserInterfaceE]+0x1d8): undefined reference to `wxAppBase::GetTopWindow() const'
UserInterface.o:(.rodata._ZTVN9VeraCrypt13UserInterfaceE[_ZTVN9VeraCrypt13UserInterfaceE]+0x1e0): undefined reference to `wxAppBase::GetDisplayMode() const'
UserInterface.o:(.rodata._ZTVN9VeraCrypt13UserInterfaceE[_ZTVN9VeraCrypt13UserInterfaceE]+0x1f8): undefined reference to `wxAppBase::GetLayoutDirection() const'
UserInterface.o:(.rodata._ZTVN9VeraCrypt13UserInterfaceE[_ZTVN9VeraCrypt13UserInterfaceE]+0x200): undefined reference to `wxApp::SetNativeTheme(wxString const&)'
UserInterface.o:(.rodata._ZTVN9VeraCrypt13UserInterfaceE[_ZTVN9VeraCrypt13UserInterfaceE]+0x208): undefined reference to `wxAppBase::SetActive(bool, wxWindow*)'
collect2: error: ld returned 1 exit status
Main.make:133: recipe for target 'veracrypt' failed
make[1]: *** [veracrypt] Error 1
make[1]: Leaving directory '/var/tmp/portage/app-crypt/veracrypt-1.19-r1/work/VeraCrypt-VeraCrypt_1.19/src/Main'
Makefile:337: recipe for target 'all' failed
make: *** [all] Error 2
 * ERROR: app-crypt/veracrypt-1.19-r1::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=app-crypt/veracrypt-1.19-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-crypt/veracrypt-1.19-r1::gentoo'`.
 * The complete build log is located at '/var/log/portage/app-crypt:veracrypt-1.19-r1:20170108-231312.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/app-crypt/veracrypt-1.19-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-crypt/veracrypt-1.19-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/app-crypt/veracrypt-1.19-r1/work/VeraCrypt-VeraCrypt_1.19/src'
 * S: '/var/tmp/portage/app-crypt/veracrypt-1.19-r1/work/VeraCrypt-VeraCrypt_1.19/src'
Comment 8 Sandino Araico Sanchez 2017-01-09 05:33:33 UTC
USE='X' ebuild wxGTK-3.0.2.0-r4.ebuild clean compile
USE='X' ebuild wxGTK-3.0.2.0-r4.ebuild merge
cd ../../app-crypt/veracrypt/
USE='-X' ebuild veracrypt-1.19-r1.ebuild clean compile

I get the same errors.

So, the veracrypt-1.19-missing-libs.patch is only to be applied when wxGTK is installed with USE=-X.
Comment 9 Sandino Araico Sanchez 2017-01-09 07:02:37 UTC
Created attachment 459266 [details, diff]
patch for missing -lwx_baseu_adv-3.0 and -lwx_baseu_core-3.0

This improved patch fixes a warning from epatch() about discouraged using of ../ paths.
Comment 10 Sandino Araico Sanchez 2017-01-09 07:07:23 UTC
Created attachment 459268 [details]
ebuild for veracrypt-1.19-r1

Fixed ebuild. now missing-libs patch is applied only when /usr/bin/wx-config --basename is wx_baseu.

USE='-X' emerge wxGTK
USE='-X' ebuild veracrypt-1.19-r1.ebuild clean compile
-- applies missins-libs patch
-- compiles with no errors

USE='X' emerge wxGTK
USE='-X' ebuild veracrypt-1.19-r1.ebuild clean compile
-- skips missins-libs patch
-- compiles with no errors
Comment 11 Göktürk Yüksek archtester gentoo-dev 2017-01-12 23:03:00 UTC
Looks like "wx/evtloopsrc.h" is conditionally installed with wxGTK[X]. When the X support is disabled, this file isn't installed. Your tests are performed on the patched wxGTK correct?

Indeed, if I download evtloopsrc.h from https://raw.githubusercontent.com/wxWidgets/wxWidgets/master/include/wx/evtloopsrc.h and put it under wx/, the package compiles fine after applying your patch.

So we are dealing with two bugs here: one is the absence of wx/evtloopsrc.h on wxGTK[-X], the other is the linking. We should find out if the first one is really a bug or the intended behavior.
Comment 12 Sandino Araico Sanchez 2017-01-12 23:28:46 UTC
My tests were performed with the patched wxGTK.

wxGTK[-X] bug is in /usr/include/wx-3.0/wx/unix/apptbase.h line 15
#include "wx/evtloopsrc.h" <--- include of a missing file.
Comment 13 Göktürk Yüksek archtester gentoo-dev 2017-01-13 00:09:57 UTC
(In reply to Sandino Araico Sanchez from comment #12)
> My tests were performed with the patched wxGTK.
> 
> wxGTK[-X] bug is in /usr/include/wx-3.0/wx/unix/apptbase.h line 15
> #include "wx/evtloopsrc.h" <--- include of a missing file.

It exists when wxGTK is compiled with X:

$ md5sum /usr/include/wx-3.0/wx/evtloopsrc.h 
eca597620a45a57a80e4596b9e90c271  /usr/include/wx-3.0/wx/evtloopsrc.h
Comment 14 tman 2017-02-28 15:00:14 UTC
can we have a working ebuild in portage?
Comment 15 tsmksubc 2017-03-05 13:25:49 UTC
https://github.com/gentoo/gentoo/pull/3379 is to fix wxGTK.
https://github.com/gentoo/gentoo/pull/3380 is to fix veracrypt.
Comment 16 Göktürk Yüksek archtester gentoo-dev 2017-03-08 09:13:47 UTC
(In reply to tman from comment #14)
> can we have a working ebuild in portage?

The fix to this at the moment requires fixing wxGTK which I'm not a maintainer of.
Comment 17 Mart Raudsepp gentoo-dev 2018-01-04 16:00:23 UTC
I will have a change included in wxGTK-3.0.3 and wxGTK-3.0.3-r300 soon (commits bot will ping once I have it pushed after a final test). Once there, please test if it solves this, as I couldn't test with wxGTK[-X] myself. wx/evtloopsrc.h now gets installed in core only builds as well, so it either is fixed now, or it fails deeper down. Reports based on the patch that was attached here suggest that it might work out fine.
The important thing here is wxGTK[-X], that is, no USE=X on wxGTK. wxGTK[X] was fine before too, for veracrypt[-X] builds.
Comment 18 Mart Raudsepp gentoo-dev 2018-01-04 16:02:42 UTC
Though looks like there might be fixes to followup to veracrypt too then.
Note that the way to fix it that I saw in the previous PR seems completely wrong. Contact me if you need assistance on how to use wx-config properly in ebuilds (IRC is best, but I will probably notice mail and bugmail fast too)
Comment 19 Larry the Git Cow gentoo-dev 2018-01-04 17:18:51 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e16e67f0678b264a04e96954a4593ddac3a9a32d

commit e16e67f0678b264a04e96954a4593ddac3a9a32d
Author:     Mart Raudsepp <leio@gentoo.org>
AuthorDate: 2018-01-04 03:44:12 +0000
Commit:     Mart Raudsepp <leio@gentoo.org>
CommitDate: 2018-01-04 17:18:28 +0000

    x11-libs/wxGTK: Apply patchset for lots of 3.0 branch fixes and webkit-gtk:4 port
    
    Includes 105 patches taken from WX_3_0_BRANCH, plus one from master only that we
    need to not litter DT_NEEDED with wxWebView library without --as-needed (it was
    part of squashed wxGTK-3.0.2.0-webview-fixes.patch before). Also includes my patch
    to install wx/evtloopsrc.h in core-only builds.
    Most notably the patchset adds support for webkit2gtk API (as provided by security
    safe net-libs/webkit-gtk:4), and lots of gtk3 port fixes, hopefully making 3.0-gtk3
    SLOT good enough for mass transition without problematic runtime regressions.
    
    The patchset touches lines right above the first Makefile.in changes in the
    collision patch, so that patch needed to be adjusted to not fail on top of the
    patchset. Ideally the collision patch would be revised and moved to the same
    approach as 3.0-gtk3 has with seds - or vice-versa, but at least same approach..
    
    Compiling amule[-X] and veracrypt[-X] against wxGTK[-X] is untested; please test
    and close the relevant bugs (617440 and 605018) if this is fixed now.
    
    Bug: https://bugs.gentoo.org/629122
    Bug: https://bugs.gentoo.org/617440
    Bug: https://bugs.gentoo.org/605018
    Package-Manager: Portage-2.3.19, Repoman-2.3.6

 x11-libs/wxGTK/Manifest                          |  1 +
 x11-libs/wxGTK/files/wxGTK-3.0.3-collision.patch | 75 ++++++++++++++++++++++++
 x11-libs/wxGTK/wxGTK-3.0.3-r300.ebuild           |  4 +-
 x11-libs/wxGTK/wxGTK-3.0.3.ebuild                |  4 +-
 4 files changed, 82 insertions(+), 2 deletions(-)}
Comment 20 Göktürk Yüksek archtester gentoo-dev 2019-10-11 20:44:13 UTC
Revisiting the issue, I'm not convinced that this is even possible. The build still fails with errors similar to the following when trying to link against wxGTK[-X]:

  /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: TextUserInterface.o: 
  (.data.rel.ro._ZTVN9VeraCrypt17TextUserInterfaceE[_ZTVN9VeraCrypt17TextUserInterfaceE]+0x10): undefined reference to `wxApp::GetClassInfo() const'

VeraCrypt::UserInterface inherits the wxApp class (https://github.com/veracrypt/VeraCrypt/blob/0ebc26e12541e585ea42ce3d1e0faa04f7720efa/src/Main/UserInterface.h#L28). According to the wxWidgets documentation (https://docs.wxwidgets.org/trunk/classwx_app.html): "The wxApp class represents the application itself when wxUSE_GUI=1." Indeed, the symbol 'wxApp::GetClassInfo()' is only defined in 'libwx_gtk2u_core-3.0.so':

  $ objdump -CT /usr/lib64/libwx_gtk2u_core-3.0.so | grep 'wxApp::GetClassInfo'
  000000000027cc70 g    DF .text	0000000000000008  WXU_3.0     wxApp::GetClassInfo() const

However, wxGTK[-X] does not install 'libwx_gtk2u_core-3.0.so'.

Currently, my conclusion is that both veracrypt[X] and veracrypt[-X] require wxGTK[X]. I'll try to use the upstream build system for compiling wxWidgets and see if it actually results in a successful wxGTK[-X],veracrypt[-X] combination.
Comment 21 Göktürk Yüksek archtester gentoo-dev 2019-10-11 20:48:33 UTC
*** Bug 693490 has been marked as a duplicate of this bug. ***
Comment 22 Göktürk Yüksek archtester gentoo-dev 2019-10-11 21:30:36 UTC
(In reply to Göktürk Yüksek from comment #20)
> Currently, my conclusion is that both veracrypt[X] and veracrypt[-X] require
> wxGTK[X]. I'll try to use the upstream build system for compiling wxWidgets
> and see if it actually results in a successful wxGTK[-X],veracrypt[-X]
> combination.

The upstream build system compiles a static version of wxwidgets with '-DwxUSE_GUI=0' and successfully links veracrypt against 'libwx_baseu-3.0.a' only. I suspect '/usr/lib64/wx/include/gtk2-unicode-3.0/wx/setup.h', for wxGTK[X], is injecting GUI-specific symbols by defining 'wxUSE_GUI' that the linker cannot resolve.
Comment 23 Göktürk Yüksek archtester gentoo-dev 2019-10-11 21:44:13 UTC
(In reply to Göktürk Yüksek from comment #22)
> (In reply to Göktürk Yüksek from comment #20)
> > Currently, my conclusion is that both veracrypt[X] and veracrypt[-X] require
> > wxGTK[X]. I'll try to use the upstream build system for compiling wxWidgets
> > and see if it actually results in a successful wxGTK[-X],veracrypt[-X]
> > combination.
> 
> The upstream build system compiles a static version of wxwidgets with
> '-DwxUSE_GUI=0' and successfully links veracrypt against 'libwx_baseu-3.0.a'
> only. I suspect '/usr/lib64/wx/include/gtk2-unicode-3.0/wx/setup.h', for
> wxGTK[X], is injecting GUI-specific symbols by defining 'wxUSE_GUI' that the
> linker cannot resolve.

Yep, https://github.com/wxWidgets/wxWidgets/blob/master/include/wx/app.h#L553


#if wxUSE_GUI

class WXDLLIMPEXP_CORE wxAppBase : public wxAppConsole
...
[snip]
...
#else // !GUI

// wxApp is defined in core and we cannot define another one in wxBase,
// so use the preprocessor to allow using wxApp in console programs too
#define wxApp wxAppConsole

#endif // GUI/!GUI
Comment 24 Göktürk Yüksek archtester gentoo-dev 2019-10-11 22:34:58 UTC
Created attachment 592550 [details, diff]
Proposed fix

May I ask someone to test the attached veracrypt-1.24-r1 to see if this resolves the issue?

@leio, is my fix acceptable from the wxWidgets perspective? i.e. forcing '-DwxUSE_GTK=0' when wxGTK[X] is installed on the system.
Comment 25 Mart Raudsepp gentoo-dev 2019-10-12 09:23:38 UTC
(In reply to Göktürk Yüksek from comment #24)
> @leio, is my fix acceptable from the wxWidgets perspective? i.e. forcing
> '-DwxUSE_GTK=0' when wxGTK[X] is installed on the system.

It feels a bit iffy, but sounds like a logical workaround to me. Ideally maybe wx-config should somehow take care of it itself though, but that's a discussion with upstream if you feel up to it
Comment 26 Mart Raudsepp gentoo-dev 2019-10-12 09:26:10 UTC
If you want to support wxGTK[-X] builds for veracrypt[-X], you should depend on the fixed wxGTK version at least, though. I think that's >=3.0.3-r0 in Gentoo.

Unrelated to that and this bug, I'd appreciate if you looked at using WX_GTK_VER="3.0-gtk3".
Comment 27 Larry the Git Cow gentoo-dev 2019-10-15 23:21:56 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ac3f1a90286538ec943337d34552553205aa3d05

commit ac3f1a90286538ec943337d34552553205aa3d05
Author:     Göktürk Yüksek <gokturk@gentoo.org>
AuthorDate: 2019-10-11 22:31:32 +0000
Commit:     Göktürk Yüksek <gokturk@gentoo.org>
CommitDate: 2019-10-15 23:20:38 +0000

    app-crypt/veracrypt: fix the linking against wxGTK[X] when USE='-X'
    
    veracrypt[-X] fails to properly link against wxGTK[X] only using the
    'base' library because the wx's setup.h implicitly defines
    wxUSE_GUI=1, which then changes the definition of various structures,
    requiring symbols from the core library as well.
    
    For example, wxwidgets include/wx/app.h defines:
    
      #if wxUSE_GUI
    
      class WXDLLIMPEXP_CORE wxAppBase : public wxAppConsole
      ...
      [snip]
      ...
      #else // !GUI
    
      // wxApp is defined in core and we cannot define another one in wxBase,
      // so use the preprocessor to allow using wxApp in console programs too
      #define wxApp wxAppConsole
    
      #endif // GUI/!GUI
    
    To fix this, pass '-DwxUSE_GUI=0' when compiling veracrypt[-X].
    
    Closes: https://bugs.gentoo.org/605018
    Package-Manager: Portage-2.3.76, Repoman-2.3.17
    Signed-off-by: Göktürk Yüksek <gokturk@gentoo.org>

 .../files/veracrypt-1.24-no-gui-fix.patch          |  35 ++++++
 app-crypt/veracrypt/veracrypt-1.24-r1.ebuild       | 117 +++++++++++++++++++++
 2 files changed, 152 insertions(+)