Skip to content

Instantly share code, notes, and snippets.

@hebasto
Last active January 22, 2019 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hebasto/4c571f6b368ab2b0d75b94aaf4bb512a to your computer and use it in GitHub Desktop.
Save hebasto/4c571f6b368ab2b0d75b94aaf4bb512a to your computer and use it in GitHub Desktop.
How to build the Bitcoin Core against any version of Qt Open Source

Discussion

2018-09-27T10:09:16 <wumpus> that way, bitcoin won't magically install its own qt; so it will build against system qt if available, and not build against qt at all if not available

bitcoin/bitcoin#14723

https://bugreports.qt.io/browse/QTBUG-73151

Preconditions

  • Ubuntu 18.04.1 LTS, minimal installation without preinstalled Qt.

  • All other dependencies are installed.

  • Successful completion of the following commands:

make distclean
./configure --without-gui
make
make check
test/functional/test_runner.py

Qt Open Source

Install any version of Qt Open Source with the Qt Online Installer for Linux (64-bit).

In the following, Qt version 5.12.0 will be used as an example.

Assume that Qt is installed in the home directory:

QTDIR=/home/hebasto/Qt/5.12.0/gcc_64

Configure dynamic linker run-time bindings:

sudo bash -c 'echo /home/hebasto/Qt/5.12.0/gcc_64/lib > /etc/ld.so.conf.d/Qt.conf'
sudo ldconfig

Fix libQt5*.la files (Core, Gui, Widgets, Network, DBus, Test):

--- old/Qt/5.12.0/gcc_64/lib/libQt5Gui.la
+++ new/Qt/5.12.0/gcc_64/lib/libQt5Gui.la
@@ -10,7 +10,7 @@
 old_library='libQt5Gui.a'
 
 # Libraries that this one depends upon.
-dependency_libs='-L=/home/hebasto/Qt/5.12.0/gcc_64/lib -lQt5Core -lpthread  '
+dependency_libs='-L/home/hebasto/Qt/5.12.0/gcc_64/lib -lQt5Core -lpthread  '
 
 # Version information for libQt5Gui.la
 current=62
@@ -25,4 +25,4 @@
 dlpreopen=''
 
 # Directory that this library needs to be installed in:
-libdir='=/home/hebasto/Qt/5.12.0/gcc_64/lib'
+libdir='/home/hebasto/Qt/5.12.0/gcc_64/lib'

Bitcoin Core

make distclean
./configure PKG_CONFIG_PATH=${QTDIR}/lib/pkgconfig
make

Q.E.F.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment