Skip to content

Commit

Permalink
Fix depends Qt path resolution for auxillary modules
Browse files Browse the repository at this point in the history
This adds a top-level project to the Qt depends recipe that enables
the build system to generate the correct pkgconfig paths for all of
the platform targets.

Gridcoin uses the Charts and SVG modules in additon to the basic Qt
UI components needed upstream by Bitcoin. Some platform tool chains
ignored the invalid pkgconfig paths generated for these modules. To
fix the static Qt builds for every target, we need to address those
issues because the previous work-around for one broke another.
  • Loading branch information
cyrossignol committed Mar 8, 2021
1 parent 14698a8 commit 6f090a0
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
6 changes: 4 additions & 2 deletions depends/packages/qt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_configure_mac.patch
$(package)_patches+= fix_rcc_determinism.patch fix_riscv64_arch.patch xkb-default.patch no-xlib.patch
$(package)_patches+= fix_android_qmake_conf.patch fix_android_jni_static.patch dont_hardcode_pwd.patch
$(package)_patches+= freetype_back_compat.patch drop_lrelease_dependency.patch fix_powerpc_libpng.patch
$(package)_patches+= fix_mingw_cross_compile.patch fix_qpainter_non_determinism.patch
$(package)_patches+= fix_mingw_cross_compile.patch fix_qpainter_non_determinism.patch subdirs.pro

$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
$(package)_qttranslations_sha256_hash=fb5a47799754af73d3bf501fe513342cfe2fc37f64e80df5533f6110e804220c
Expand Down Expand Up @@ -257,6 +257,7 @@ define $(package)_preprocess_cmds
patch -p1 -i $($(package)_patch_dir)/no-xlib.patch && \
patch -p1 -i $($(package)_patch_dir)/fix_mingw_cross_compile.patch && \
patch -p1 -i $($(package)_patch_dir)/fix_qpainter_non_determinism.patch &&\
cp $($(package)_patch_dir)/subdirs.pro subdirs.pro && \
sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \
mkdir -p qtbase/mkspecs/macx-clang-linux &&\
cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\
Expand All @@ -279,10 +280,11 @@ define $(package)_config_cmds
export PKG_CONFIG_LIBDIR=$(host_prefix)/lib/pkgconfig && \
export PKG_CONFIG_PATH=$(host_prefix)/share/pkgconfig && \
cd qtbase && \
./configure $($(package)_config_opts) && \
./configure -top-level $($(package)_config_opts) && \
echo "host_build: QT_CONFIG ~= s/system-zlib/zlib" >> mkspecs/qconfig.pri && \
echo "CONFIG += force_bootstrap" >> mkspecs/qconfig.pri && \
cd .. && \
qtbase/bin/qmake -o qtbase/Makefile qtbase/qtbase.pro && \
$(MAKE) -C qtbase sub-src-clean && \
qtbase/bin/qmake -o qttranslations/Makefile qttranslations/qttranslations.pro && \
qtbase/bin/qmake -o qttranslations/translations/Makefile qttranslations/translations/translations.pro && \
Expand Down
33 changes: 33 additions & 0 deletions depends/patches/qt/subdirs.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# This project file enable the Qt depends recipe to build additional modules
# with proper dependency and path resolution.
#
# https://wiki.qt.io/SUBDIRS_-_handling_dependencies
#

cache(, super)

TEMPLATE = subdirs

SUBDIRS = \
qtbase \
qtcharts \
qtsvg \
qttools \
qttranslations

qtbase.target = module-qtbase

qtcharts.target = module-qtcharts
qtcharts.depends = qtbase

qtsvg.target = module-qtsvg
qtsvg.depends = qtbase

qttools.target = module-qttools
qttools.depends = qtbase

qttranslations.target = module-qttranslations
qttranslations.depends = qttools

load(qt_configure)

0 comments on commit 6f090a0

Please sign in to comment.