2014-07-23 07:31:30 +02:00
PACKAGE = qt
2018-12-13 14:32:41 +01:00
$(package)_version = 5.9.7
2021-05-13 11:32:12 +02:00
$(package)_download_path = https://download.qt.io/archive/qt/5.9/$( $( package) _version) /submodules
2018-05-19 16:22:47 +02:00
$(package)_suffix = opensource-src-$( $( package) _version) .tar.xz
2015-07-24 01:07:03 +02:00
$(package)_file_name = qtbase-$( $( package) _suffix)
2018-12-13 14:32:41 +01:00
$(package)_sha256_hash = 36dd9574f006eaa1e5af780e4b33d11fe39d09fd7c12f3b9d83294174bd28f00
2017-01-30 09:00:51 +01:00
$(package)_dependencies = openssl zlib
2019-07-23 08:22:06 +02:00
$(package)_linux_dependencies = freetype fontconfig libxcb
2014-07-23 07:31:30 +02:00
$(package)_qt_libs = corelib network widgets gui plugins testlib
2018-07-19 07:04:00 +02:00
$(package)_patches = fix_qt_pkgconfig.patch mac-qmake.conf fix_configure_mac.patch fix_no_printer.patch fix_riscv64_arch.patch
2021-09-01 19:47:04 +02:00
$(package)_patches += fix_rcc_determinism.patch xkb-default.patch no-xlib.patch
$(package)_patches += dont_hardcode_pwd.patch
$(package)_patches += freetype_back_compat.patch drop_lrelease_dependency.patch
$(package)_patches += fix_limits_header.patch
2015-07-24 01:07:03 +02:00
2020-05-26 02:30:35 +02:00
# Update OSX_QT_TRANSLATIONS when this is updated
2015-07-24 01:07:03 +02:00
$(package)_qttranslations_file_name = qttranslations-$( $( package) _suffix)
2018-12-13 14:32:41 +01:00
$(package)_qttranslations_sha256_hash = b36da7d93c3ab6fca56b32053bb73bc619c8b192bb89b74e3bcde2705f1c2a14
2015-07-24 01:07:03 +02:00
$(package)_qttools_file_name = qttools-$( $( package) _suffix)
2018-12-13 14:32:41 +01:00
$(package)_qttools_sha256_hash = d62e0f70d99645d6704dbb8976fb2222443061743689943d40970c52c49367a1
2015-07-24 01:07:03 +02:00
$(package)_extra_sources = $( $( package) _qttranslations_file_name)
$(package)_extra_sources += $( $( package) _qttools_file_name)
2014-07-23 07:31:30 +02:00
d e f i n e $( package ) _ s e t _ v a r s
2014-09-23 23:41:42 +02:00
$(package)_config_opts_release = -release
2020-11-23 14:04:09 +01:00
$(package)_config_opts_release += -silent
2017-01-15 06:41:39 +01:00
$(package)_config_opts_debug = -debug
2016-06-20 13:31:17 +02:00
$(package)_config_opts += -bindir $( build_prefix) /bin
2020-11-23 14:04:09 +01:00
$(package)_config_opts += -c++std c++1z
2016-06-20 13:31:17 +02:00
$(package)_config_opts += -confirm-license
$(package)_config_opts += -dbus-runtime
$(package)_config_opts += -hostprefix $( build_prefix)
2018-12-13 14:32:41 +01:00
$(package)_config_opts += -no-compile-examples
2016-06-20 13:31:17 +02:00
$(package)_config_opts += -no-cups
$(package)_config_opts += -no-egl
$(package)_config_opts += -no-eglfs
$(package)_config_opts += -no-freetype
$(package)_config_opts += -no-gif
2015-06-12 19:49:47 +02:00
$(package)_config_opts += -no-glib
$(package)_config_opts += -no-icu
$(package)_config_opts += -no-iconv
2016-06-20 13:31:17 +02:00
$(package)_config_opts += -no-kms
$(package)_config_opts += -no-linuxfb
$(package)_config_opts += -no-libudev
$(package)_config_opts += -no-mtdev
$(package)_config_opts += -no-openvg
$(package)_config_opts += -no-reduce-relocations
2015-06-12 19:49:47 +02:00
$(package)_config_opts += -no-qml-debug
$(package)_config_opts += -no-sql-db2
$(package)_config_opts += -no-sql-ibase
$(package)_config_opts += -no-sql-oci
$(package)_config_opts += -no-sql-tds
$(package)_config_opts += -no-sql-mysql
$(package)_config_opts += -no-sql-odbc
$(package)_config_opts += -no-sql-psql
$(package)_config_opts += -no-sql-sqlite
$(package)_config_opts += -no-sql-sqlite2
2016-06-20 13:31:17 +02:00
$(package)_config_opts += -no-use-gold-linker
$(package)_config_opts += -no-xinput2
$(package)_config_opts += -nomake examples
$(package)_config_opts += -nomake tests
$(package)_config_opts += -opensource
2015-06-12 19:49:47 +02:00
$(package)_config_opts += -openssl-linked
2016-06-20 13:31:17 +02:00
$(package)_config_opts += -optimized-qmake
$(package)_config_opts += -pch
2015-06-12 19:49:47 +02:00
$(package)_config_opts += -pkg-config
2016-06-20 13:31:17 +02:00
$(package)_config_opts += -prefix $( host_prefix)
2015-06-12 19:49:47 +02:00
$(package)_config_opts += -qt-libpng
$(package)_config_opts += -qt-libjpeg
$(package)_config_opts += -qt-pcre
2019-03-01 16:29:48 +01:00
$(package)_config_opts += -qt-harfbuzz
2017-01-30 09:00:51 +01:00
$(package)_config_opts += -system-zlib
2016-06-20 13:31:17 +02:00
$(package)_config_opts += -static
$(package)_config_opts += -v
2018-12-13 14:32:41 +01:00
$(package)_config_opts += -no-feature-dial
$(package)_config_opts += -no-feature-ftp
$(package)_config_opts += -no-feature-lcdnumber
$(package)_config_opts += -no-feature-pdf
2017-01-26 10:30:36 +01:00
$(package)_config_opts += -no-feature-printer
$(package)_config_opts += -no-feature-printdialog
2018-05-19 16:22:47 +02:00
$(package)_config_opts += -no-feature-concurrent
2018-12-13 14:32:41 +01:00
$(package)_config_opts += -no-feature-sql
$(package)_config_opts += -no-feature-statemachine
$(package)_config_opts += -no-feature-syntaxhighlighter
$(package)_config_opts += -no-feature-textbrowser
$(package)_config_opts += -no-feature-textodfwriter
$(package)_config_opts += -no-feature-udpsocket
$(package)_config_opts += -no-feature-wizard
2018-05-19 16:22:47 +02:00
$(package)_config_opts += -no-feature-xml
2014-07-23 07:31:30 +02:00
i f n e q ( $( build_os ) , d a r w i n )
2015-06-12 19:49:47 +02:00
$(package)_config_opts_darwin = -xplatform macx-clang-linux
$(package)_config_opts_darwin += -device-option MAC_SDK_PATH = $( OSX_SDK)
2015-07-24 01:07:03 +02:00
$(package)_config_opts_darwin += -device-option MAC_SDK_VERSION = $( OSX_SDK_VERSION)
2015-06-12 19:49:47 +02:00
$(package)_config_opts_darwin += -device-option CROSS_COMPILE = " $( host) - "
$(package)_config_opts_darwin += -device-option MAC_MIN_VERSION = $( OSX_MIN_VERSION)
$(package)_config_opts_darwin += -device-option MAC_TARGET = $( host)
2014-07-23 07:31:30 +02:00
e n d i f
2020-12-07 10:07:43 +01:00
# for macOS on Apple Silicon (ARM) see https://bugreports.qt.io/browse/QTBUG-85279
2021-06-03 15:04:16 +02:00
$(package)_config_opts_aarch64_darwin += -device-option QMAKE_APPLE_DEVICE_ARCHS = arm64
2020-12-07 10:07:43 +01:00
2018-08-21 08:21:18 +02:00
$(package)_config_opts_linux = -qt-xkbcommon-x11
2015-06-12 19:49:47 +02:00
$(package)_config_opts_linux += -qt-xcb
2019-07-23 08:22:06 +02:00
$(package)_config_opts_linux += -no-xcb-xlib
$(package)_config_opts_linux += -no-feature-xlib
2015-06-12 19:49:47 +02:00
$(package)_config_opts_linux += -system-freetype
2018-05-19 16:22:47 +02:00
$(package)_config_opts_linux += -no-feature-sessionmanager
2015-06-12 19:49:47 +02:00
$(package)_config_opts_linux += -fontconfig
$(package)_config_opts_linux += -no-opengl
2018-07-17 13:06:41 +02:00
$(package)_config_opts_arm_linux += -platform linux-g++ -xplatform bitcoin-linux-g++
2014-07-23 07:31:30 +02:00
$(package)_config_opts_i686_linux = -xplatform linux-g++-32
2018-05-19 16:22:47 +02:00
$(package)_config_opts_x86_64_linux = -xplatform linux-g++-64
2018-08-05 19:22:11 +02:00
$(package)_config_opts_aarch64_linux = -xplatform linux-aarch64-gnu-g++
2018-07-19 07:04:00 +02:00
$(package)_config_opts_riscv64_linux = -platform linux-g++ -xplatform bitcoin-linux-g++
2014-07-23 07:31:30 +02:00
$(package)_config_opts_mingw32 = -no-opengl -xplatform win32-g++ -device-option CROSS_COMPILE = " $( host) - "
$(package)_build_env = QT_RCC_TEST = 1
2018-07-21 08:21:50 +02:00
$(package)_build_env += QT_RCC_SOURCE_DATE_OVERRIDE = 1
2014-07-23 07:31:30 +02:00
e n d e f
2015-07-24 01:07:03 +02:00
d e f i n e $( package ) _ f e t c h _ c m d s
$( call fetch_file ,$ ( package ) ,$ ( $ ( package ) _download_path ) ,$ ( $ ( package ) _download_file ) ,$ ( $ ( package ) _file_name ) ,$ ( $ ( package ) _sha 256_hash ) ) & & \
$( call fetch_file ,$ ( package ) ,$ ( $ ( package ) _download_path ) ,$ ( $ ( package ) _qttranslations_file_name ) ,$ ( $ ( package ) _qttranslations_file_name ) ,$ ( $ ( package ) _qttranslations_sha 256_hash ) ) & & \
$( call fetch_file ,$ ( package ) ,$ ( $ ( package ) _download_path ) ,$ ( $ ( package ) _qttools_file_name ) ,$ ( $ ( package ) _qttools_file_name ) ,$ ( $ ( package ) _qttools_sha 256_hash ) )
e n d e f
d e f i n e $( package ) _ e x t r a c t _ c m d s
mkdir -p $( $( package) _extract_dir) && \
echo " $( $( package) _sha256_hash) $( $( package) _source) " > $( $( package) _extract_dir) /.$( $( package) _file_name) .hash && \
2016-04-15 08:55:38 +02:00
echo " $( $( package) _qttranslations_sha256_hash) $( $( package) _source_dir) / $( $( package) _qttranslations_file_name) " >> $( $( package) _extract_dir) /.$( $( package) _file_name) .hash && \
echo " $( $( package) _qttools_sha256_hash) $( $( package) _source_dir) / $( $( package) _qttools_file_name) " >> $( $( package) _extract_dir) /.$( $( package) _file_name) .hash && \
2015-07-24 01:07:03 +02:00
$( build_SHA256SUM) -c $( $( package) _extract_dir) /.$( $( package) _file_name) .hash && \
mkdir qtbase && \
2019-03-18 16:31:05 +01:00
tar --no-same-owner --strip-components= 1 -xf $( $( package) _source) -C qtbase && \
2015-07-24 01:07:03 +02:00
mkdir qttranslations && \
2019-03-18 16:31:05 +01:00
tar --no-same-owner --strip-components= 1 -xf $( $( package) _source_dir) /$( $( package) _qttranslations_file_name) -C qttranslations && \
2015-07-24 01:07:03 +02:00
mkdir qttools && \
2019-03-18 16:31:05 +01:00
tar --no-same-owner --strip-components= 1 -xf $( $( package) _source_dir) /$( $( package) _qttools_file_name) -C qttools
2015-07-24 01:07:03 +02:00
e n d e f
2014-07-23 07:31:30 +02:00
d e f i n e $( package ) _ p r e p r o c e s s _ c m d s
2021-09-01 19:47:04 +02:00
patch -p1 -i $( $( package) _patch_dir) /freetype_back_compat.patch && \
2014-07-23 07:31:30 +02:00
sed -i.old " s|updateqm.commands = \$ $$ $\$ $$ $LRELEASE |updateqm.commands = $( $( package) _extract_dir) /qttools/bin/lrelease| " qttranslations/translations/translations.pro && \
2021-09-01 19:47:04 +02:00
patch -p1 -i $( $( package) _patch_dir) /drop_lrelease_dependency.patch && \
patch -p1 -i $( $( package) _patch_dir) /dont_hardcode_pwd.patch && \
2014-07-23 07:31:30 +02:00
mkdir -p qtbase/mkspecs/macx-clang-linux && \
cp -f qtbase/mkspecs/macx-clang/Info.plist.lib qtbase/mkspecs/macx-clang-linux/ && \
cp -f qtbase/mkspecs/macx-clang/Info.plist.app 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 && \
2018-07-17 13:06:41 +02:00
cp -r qtbase/mkspecs/linux-arm-gnueabi-g++ qtbase/mkspecs/bitcoin-linux-g++ && \
2018-07-25 12:59:08 +02:00
sed -i.old " s/arm-linux-gnueabi-/ $( host) -/g " qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \
2018-05-19 16:22:47 +02:00
patch -p1 -i $( $( package) _patch_dir) /fix_qt_pkgconfig.patch && \
patch -p1 -i $( $( package) _patch_dir) /fix_configure_mac.patch && \
patch -p1 -i $( $( package) _patch_dir) /fix_no_printer.patch && \
2018-07-21 08:21:50 +02:00
patch -p1 -i $( $( package) _patch_dir) /fix_rcc_determinism.patch && \
2018-08-21 08:21:18 +02:00
patch -p1 -i $( $( package) _patch_dir) /xkb-default.patch && \
2021-09-02 23:30:12 +02:00
patch -p1 -i $( $( package) _patch_dir) /fix_limits_header.patch && \
2017-01-30 09:00:51 +01:00
echo " !host_build: QMAKE_CFLAGS += $( $( package) _cflags) $( $( package) _cppflags) " >> qtbase/mkspecs/common/gcc-base.conf && \
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 && \
2019-07-23 08:22:06 +02:00
patch -p1 -i $( $( package) _patch_dir) /no-xlib.patch && \
2018-07-19 07:04:00 +02:00
patch -p1 -i $( $( package) _patch_dir) /fix_riscv64_arch.patch && \
2018-05-19 16:22:47 +02:00
echo "QMAKE_LINK_OBJECT_MAX = 10" >> qtbase/mkspecs/win32-g++/qmake.conf && \
echo "QMAKE_LINK_OBJECT_SCRIPT = object_script" >> qtbase/mkspecs/win32-g++/qmake.conf && \
2017-01-30 09:00:51 +01:00
sed -i.old " s|QMAKE_CFLAGS = |!host_build: QMAKE_CFLAGS = $( $( package) _cflags) $( $( package) _cppflags) | " qtbase/mkspecs/win32-g++/qmake.conf && \
sed -i.old " s|QMAKE_LFLAGS = |!host_build: QMAKE_LFLAGS = $( $( package) _ldflags) | " qtbase/mkspecs/win32-g++/qmake.conf && \
2020-12-18 13:09:04 +01:00
sed -i.old " s|QMAKE_CXXFLAGS = |!host_build: QMAKE_CXXFLAGS = $( $( package) _cxxflags) $( $( package) _cppflags) | " qtbase/mkspecs/win32-g++/qmake.conf && \
sed -i.old "s/error(\"failed to parse default search paths from compiler output\")/\!darwin: error(\"failed to parse default search paths from compiler output\")/g" qtbase/mkspecs/features/toolchain.prf
2014-07-23 07:31:30 +02:00
e n d e f
d e f i n e $( package ) _ c o n f i g _ c m d s
2020-12-18 03:23:04 +01:00
export PKG_CONFIG_SYSROOT_DIR = / && \
2014-07-23 07:31:30 +02:00
export PKG_CONFIG_LIBDIR = $( host_prefix) /lib/pkgconfig && \
export PKG_CONFIG_PATH = $( host_prefix) /share/pkgconfig && \
2020-12-25 03:54:23 +01:00
cd qtbase && \
2014-07-23 07:31:30 +02:00
./configure $( $( package) _config_opts) && \
2017-01-30 09:00:51 +01:00
echo "host_build: QT_CONFIG ~= s/system-zlib/zlib" >> mkspecs/qconfig.pri && \
echo "CONFIG += force_bootstrap" >> mkspecs/qconfig.pri && \
2020-12-25 03:54:23 +01:00
cd .. && \
$( 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 && \
qtbase/bin/qmake -o qttools/src/linguist/lrelease/Makefile qttools/src/linguist/lrelease/lrelease.pro && \
qtbase/bin/qmake -o qttools/src/linguist/lupdate/Makefile qttools/src/linguist/lupdate/lupdate.pro
2014-07-23 07:31:30 +02:00
e n d e f
d e f i n e $( package ) _ b u i l d _ c m d s
2020-12-25 03:54:23 +01:00
$( MAKE) -C qtbase/src $( addprefix sub-,$( $( package) _qt_libs) ) && \
$( MAKE) -C qttools/src/linguist/lrelease && \
$( MAKE) -C qttools/src/linguist/lupdate && \
$( MAKE) -C qttranslations
2014-07-23 07:31:30 +02:00
e n d e f
d e f i n e $( package ) _ s t a g e _ c m d s
2020-12-25 03:54:23 +01:00
$( MAKE) -C qtbase/src INSTALL_ROOT = $( $( package) _staging_dir) $( addsuffix -install_subtargets,$( addprefix sub-,$( $( package) _qt_libs) ) ) && \
2014-07-23 07:31:30 +02:00
$( MAKE) -C qttools/src/linguist/lrelease INSTALL_ROOT = $( $( package) _staging_dir) install_target && \
2019-01-22 12:15:26 +01:00
$( MAKE) -C qttools/src/linguist/lupdate INSTALL_ROOT = $( $( package) _staging_dir) install_target && \
2020-12-16 13:58:59 +01:00
$( MAKE) -C qttranslations INSTALL_ROOT = $( $( package) _staging_dir) install_subtargets
2014-07-23 07:31:30 +02:00
e n d e f
d e f i n e $( package ) _ p o s t p r o c e s s _ c m d s
2015-07-24 01:07:03 +02:00
rm -rf native/mkspecs/ native/lib/ lib/cmake/ && \
rm -f lib/lib*.la lib/*.prl plugins/*/*.prl
2014-07-23 07:31:30 +02:00
e n d e f