qt: use patch over sed for guix CROSS_LIBRARY_PATH change

pull/25719/head
fanquake 2 years ago committed by Hennadii Stepanov
parent ecb617fefe
commit fd0e8df67c
No known key found for this signature in database
GPG Key ID: 410108112E7EA81F

@ -21,6 +21,7 @@ $(package)_patches += use_android_ndk23.patch
$(package)_patches += rcc_hardcode_timestamp.patch
$(package)_patches += duplicate_lcqpafonts.patch
$(package)_patches += fast_fixed_dtoa_no_optimize.patch
$(package)_patches += guix_cross_lib_path.patch
$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
$(package)_qttranslations_sha256_hash=c92af4171397a0ed272330b4fa0669790fcac8d050b07c8b8cc565ebeba6735e
@ -252,6 +253,7 @@ define $(package)_preprocess_cmds
patch -p1 -i $($(package)_patch_dir)/rcc_hardcode_timestamp.patch && \
patch -p1 -i $($(package)_patch_dir)/duplicate_lcqpafonts.patch && \
patch -p1 -i $($(package)_patch_dir)/fast_fixed_dtoa_no_optimize.patch && \
patch -p1 -i $($(package)_patch_dir)/guix_cross_lib_path.patch && \
mkdir -p qtbase/mkspecs/macx-clang-linux &&\
cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\
cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \
@ -261,8 +263,7 @@ define $(package)_preprocess_cmds
echo "!host_build: QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
echo "!host_build: QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
sed -i.old "s|QMAKE_CC = \$$$$\$$$${CROSS_COMPILE}clang|QMAKE_CC = $($(package)_cc)|" qtbase/mkspecs/common/clang.conf && \
sed -i.old "s|QMAKE_CXX = \$$$$\$$$${CROSS_COMPILE}clang++|QMAKE_CXX = $($(package)_cxx)|" qtbase/mkspecs/common/clang.conf && \
sed -i.old "s/LIBRARY_PATH/(CROSS_)?\0/g" qtbase/mkspecs/features/toolchain.prf
sed -i.old "s|QMAKE_CXX = \$$$$\$$$${CROSS_COMPILE}clang++|QMAKE_CXX = $($(package)_cxx)|" qtbase/mkspecs/common/clang.conf
endef
define $(package)_config_cmds

@ -0,0 +1,17 @@
Facilitate guix building with CROSS_LIBRARY_PATH
See discussion in https://github.com/bitcoin/bitcoin/pull/15277.
--- a/qtbase/mkspecs/features/toolchain.prf
+++ b/qtbase/mkspecs/features/toolchain.prf
@@ -231,8 +231,8 @@ isEmpty($${target_prefix}.INCDIRS) {
add_libraries = false
for (line, output) {
line ~= s/^[ \\t]*// # remove leading spaces
- contains(line, "LIBRARY_PATH=.*") {
- line ~= s/^LIBRARY_PATH=// # remove leading LIBRARY_PATH=
+ contains(line, "(CROSS_)?LIBRARY_PATH=.*") {
+ line ~= s/^(CROSS_)?LIBRARY_PATH=// # remove leading (CROSS_)?LIBRARY_PATH=
equals(QMAKE_HOST.os, Windows): \
paths = $$split(line, ;)
else: \
Loading…
Cancel
Save