diff --git a/build-aux/m4/groestlcoin_qt.m4 b/build-aux/m4/groestlcoin_qt.m4 index 7f6824347d362..2cda8b4cc8785 100644 --- a/build-aux/m4/groestlcoin_qt.m4 +++ b/build-aux/m4/groestlcoin_qt.m4 @@ -70,8 +70,6 @@ AC_DEFUN([BITCOIN_QT_INIT],[ [qt_lib_suffix= ]); bitcoin_qt_want_version=qt5], [qt_lib_suffix= ]) - AS_CASE([$host], [*android*], [qt_lib_suffix=_$ANDROID_ARCH]) - AC_ARG_WITH([qt-incdir],[AS_HELP_STRING([--with-qt-incdir=INC_DIR],[specify qt include path (overridden by pkgconfig)])], [qt_include_path=$withval], []) AC_ARG_WITH([qt-libdir],[AS_HELP_STRING([--with-qt-libdir=LIB_DIR],[specify qt lib path (overridden by pkgconfig)])], [qt_lib_path=$withval], []) AC_ARG_WITH([qt-plugindir],[AS_HELP_STRING([--with-qt-plugindir=PLUGIN_DIR],[specify qt plugin path (overridden by pkgconfig)])], [qt_plugin_path=$withval], []) @@ -80,19 +78,10 @@ AC_DEFUN([BITCOIN_QT_INIT],[ AC_ARG_WITH([qtdbus], [AS_HELP_STRING([--with-qtdbus], - [enable DBus support (default is yes if qt is enabled and QtDBus is found, except on Android)])], + [enable DBus support (default is yes if qt is enabled and QtDBus is found)])], [use_dbus=$withval], [use_dbus=auto]) - dnl Android doesn't support D-Bus and certainly doesn't use it for notifications - case $host in - *android*) - if test "$use_dbus" != "yes"; then - use_dbus=no - fi - ;; - esac - AC_SUBST(QT_TRANSLATION_DIR,$qt_translation_path) ]) @@ -132,16 +121,11 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ if test -d "$qt_plugin_path/accessible"; then QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible" fi - if test -d "$qt_plugin_path/platforms/android"; then - QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms/android -lqtfreetype -lEGL" - fi fi AC_DEFINE([QT_STATICPLUGIN], [1], [Define this symbol if qt plugins are static]) - if test "$TARGET_OS" != "android"; then - _BITCOIN_QT_CHECK_STATIC_PLUGIN([QMinimalIntegrationPlugin], [-lqminimal]) - AC_DEFINE([QT_QPA_PLATFORM_MINIMAL], [1], [Define this symbol if the minimal qt platform exists]) - fi + _BITCOIN_QT_CHECK_STATIC_PLUGIN([QMinimalIntegrationPlugin], [-lqminimal]) + AC_DEFINE([QT_QPA_PLATFORM_MINIMAL], [1], [Define this symbol if the minimal qt platform exists]) if test "$TARGET_OS" = "windows"; then dnl Linking against wtsapi32 is required. See #17749 and dnl https://bugreports.qt.io/browse/QTBUG-27097. @@ -160,9 +144,6 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ _BITCOIN_QT_CHECK_STATIC_PLUGIN([QCocoaIntegrationPlugin], [-lqcocoa]) _BITCOIN_QT_CHECK_STATIC_PLUGIN([QMacStylePlugin], [-lqmacstyle]) AC_DEFINE([QT_QPA_PLATFORM_COCOA], [1], [Define this symbol if the qt platform is cocoa]) - elif test "$TARGET_OS" = "android"; then - QT_LIBS="-Wl,--export-dynamic,--undefined=JNI_OnLoad -lplugins_platforms_qtforandroid${qt_lib_suffix} -ljnigraphics -landroid -lqtfreetype${qt_lib_suffix} $QT_LIBS" - AC_DEFINE([QT_QPA_PLATFORM_ANDROID], [1], [Define this symbol if the qt platform is android]) fi fi CPPFLAGS=$TEMP_CPPFLAGS @@ -357,9 +338,6 @@ AC_DEFUN([_BITCOIN_QT_CHECK_STATIC_LIBS], [ PKG_CHECK_MODULES([QT_SERVICE], [${qt_lib_prefix}ServiceSupport${qt_lib_suffix}], [QT_LIBS="$QT_SERVICE_LIBS $QT_LIBS"]) elif test "$TARGET_OS" = "windows"; then PKG_CHECK_MODULES([QT_WINDOWSUIAUTOMATION], [${qt_lib_prefix}WindowsUIAutomationSupport${qt_lib_suffix}], [QT_LIBS="$QT_WINDOWSUIAUTOMATION_LIBS $QT_LIBS"]) - elif test "$TARGET_OS" = "android"; then - PKG_CHECK_MODULES([QT_EGL], [${qt_lib_prefix}EglSupport${qt_lib_suffix}], [QT_LIBS="$QT_EGL_LIBS $QT_LIBS"]) - PKG_CHECK_MODULES([QT_SERVICE], [${qt_lib_prefix}ServiceSupport${qt_lib_suffix}], [QT_LIBS="$QT_SERVICE_LIBS $QT_LIBS"]) fi ]) diff --git a/ci/lint/04_install.sh b/ci/lint/04_install.sh index 6b12c53f2ad84..87e3a8fa9b110 100644 --- a/ci/lint/04_install.sh +++ b/ci/lint/04_install.sh @@ -57,3 +57,8 @@ SHELLCHECK_VERSION=v0.8.0 curl -sL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | \ tar --xz -xf - --directory /tmp/ mv "/tmp/shellcheck-${SHELLCHECK_VERSION}/shellcheck" /usr/bin/ + +MLC_VERSION=v0.16.3 +MLC_BIN=mlc-x86_64-linux +curl -sL "https://github.com/becheran/mlc/releases/download/${MLC_VERSION}/${MLC_BIN}" -o "/usr/bin/mlc" +chmod +x /usr/bin/mlc diff --git a/ci/test/00_setup_env_android.sh b/ci/test/00_setup_env_android.sh deleted file mode 100755 index a04fd6874d124..0000000000000 --- a/ci/test/00_setup_env_android.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright (c) 2019-present The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -export LC_ALL=C.UTF-8 - -export HOST=aarch64-linux-android -export PACKAGES="unzip openjdk-8-jdk gradle" -export CONTAINER_NAME=ci_android -export CI_IMAGE_NAME_TAG="docker.io/amd64/ubuntu:22.04" - -export ANDROID_API_LEVEL=28 -export ANDROID_BUILD_TOOLS_VERSION=28.0.3 -export ANDROID_NDK_VERSION=23.2.8568313 -export ANDROID_TOOLS_URL=https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip -export ANDROID_HOME="${DEPENDS_DIR}/SDKs/android" -export ANDROID_NDK_HOME="${ANDROID_HOME}/ndk/${ANDROID_NDK_VERSION}" -export DEP_OPTS="ANDROID_SDK=${ANDROID_HOME} ANDROID_NDK=${ANDROID_NDK_HOME} ANDROID_API_LEVEL=${ANDROID_API_LEVEL} ANDROID_TOOLCHAIN_BIN=${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/" - -export GROESTLCOIN_CONFIG="--disable-tests --disable-bench --disable-fuzz-binary --without-utils --without-libs --without-daemon" diff --git a/ci/test/01_base_install.sh b/ci/test/01_base_install.sh index 25962a53e5c19..f16321ba55fb5 100755 --- a/ci/test/01_base_install.sh +++ b/ci/test/01_base_install.sh @@ -86,14 +86,4 @@ if [ -n "$XCODE_VERSION" ] && [ ! -d "${DEPENDS_DIR}/SDKs/${OSX_SDK_BASENAME}" ] tar -C "${DEPENDS_DIR}/SDKs" -xf "$OSX_SDK_PATH" fi -if [ -n "$ANDROID_HOME" ] && [ ! -d "$ANDROID_HOME" ]; then - ANDROID_TOOLS_PATH=${DEPENDS_DIR}/sdk-sources/android-tools.zip - if [ ! -f "$ANDROID_TOOLS_PATH" ]; then - ${CI_RETRY_EXE} curl --location --fail "${ANDROID_TOOLS_URL}" -o "$ANDROID_TOOLS_PATH" - fi - mkdir -p "$ANDROID_HOME" - unzip -o "$ANDROID_TOOLS_PATH" -d "$ANDROID_HOME" - yes | "${ANDROID_HOME}"/cmdline-tools/bin/sdkmanager --sdk_root="${ANDROID_HOME}" --install "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" "platform-tools" "platforms;android-31" "platforms;android-${ANDROID_API_LEVEL}" "ndk;${ANDROID_NDK_VERSION}" -fi - git config --global ${CFG_DONE} "true" diff --git a/ci/test/02_run_container.sh b/ci/test/02_run_container.sh index e6c4a613417f2..86bb856d17ba0 100755 --- a/ci/test/02_run_container.sh +++ b/ci/test/02_run_container.sh @@ -26,7 +26,6 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then docker volume create "${CONTAINER_NAME}_ccache" || true docker volume create "${CONTAINER_NAME}_depends" || true docker volume create "${CONTAINER_NAME}_depends_sources" || true - docker volume create "${CONTAINER_NAME}_depends_SDKs_android" || true docker volume create "${CONTAINER_NAME}_previous_releases" || true if [ -n "${RESTART_CI_DOCKER_BEFORE_RUN}" ] ; then @@ -52,7 +51,6 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then --mount "type=volume,src=${CONTAINER_NAME}_ccache,dst=$CCACHE_DIR" \ --mount "type=volume,src=${CONTAINER_NAME}_depends,dst=$DEPENDS_DIR/built" \ --mount "type=volume,src=${CONTAINER_NAME}_depends_sources,dst=$DEPENDS_DIR/sources" \ - --mount "type=volume,src=${CONTAINER_NAME}_depends_SDKs_android,dst=$DEPENDS_DIR/SDKs/android" \ --mount "type=volume,src=${CONTAINER_NAME}_previous_releases,dst=$PREVIOUS_RELEASES_DIR" \ --env-file /tmp/env-$USER-$CONTAINER_NAME \ --name "$CONTAINER_NAME" \ diff --git a/ci/test/03_test_script.sh b/ci/test/03_test_script.sh old mode 100755 new mode 100644 index a7263c3c2fe07..971adf798da57 --- a/ci/test/03_test_script.sh +++ b/ci/test/03_test_script.sh @@ -95,15 +95,6 @@ fi ccache --zero-stats PRINT_CCACHE_STATISTICS="ccache --version | head -n 1 && ccache --show-stats" -if [ -n "$ANDROID_TOOLS_URL" ]; then - make distclean || true - ./autogen.sh - bash -c "./configure $GROESTLCOIN_CONFIG_ALL $GROESTLCOIN_CONFIG" || ( (cat config.log) && false) - make "${MAKEJOBS}" && cd src/qt && ANDROID_HOME=${ANDROID_HOME} ANDROID_NDK_HOME=${ANDROID_NDK_HOME} make apk - bash -c "${PRINT_CCACHE_STATISTICS}" - exit 0 -fi - GROESTLCOIN_CONFIG_ALL="${GROESTLCOIN_CONFIG_ALL} --enable-external-signer --prefix=$BASE_OUTDIR" if [ -n "$CONFIG_SHELL" ]; then diff --git a/configure.ac b/configure.ac index 672e75a4e2024..64619c38ed00d 100644 --- a/configure.ac +++ b/configure.ac @@ -772,22 +772,6 @@ case $host in dnl "'NSUserNotificationCenter' is deprecated: first deprecated in macOS 11.0". OBJCXXFLAGS="$CXXFLAGS -Wno-deprecated-declarations" ;; - *android*) - dnl make sure android stays above linux for hosts like *linux-android* - TARGET_OS=android - case $host in - *x86_64*) - ANDROID_ARCH=x86_64 - ;; - *aarch64*) - ANDROID_ARCH=arm64-v8a - ;; - *armv7a*) - ANDROID_ARCH=armeabi-v7a - ;; - *) AC_MSG_ERROR([Could not determine Android arch, or it is unsupported]) ;; - esac - ;; *linux*) TARGET_OS=linux ;; @@ -1744,7 +1728,6 @@ AC_SUBST(HAVE_O_CLOEXEC) AC_SUBST(HAVE_BUILTIN_PREFETCH) AC_SUBST(HAVE_MM_PREFETCH) AC_SUBST(HAVE_STRONG_GETAUXVAL) -AC_SUBST(ANDROID_ARCH) AC_SUBST(HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR) AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist test/config.ini]) AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh]) diff --git a/depends/Makefile b/depends/Makefile index 6883c0f971550..fee426d8db040 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -101,10 +101,6 @@ host_os+=$(findstring netbsd,$(full_host_os)) host_os+=$(findstring openbsd,$(full_host_os)) host_os+=$(findstring mingw32,$(full_host_os)) -ifeq (android,$(findstring android,$(full_host_os))) -host_os:=android -endif - host_os:=$(strip $(host_os)) ifeq ($(host_os),) host_os=$(full_host_os) diff --git a/depends/README.md b/depends/README.md index 2b893c1b81f91..47e86ed4accb3 100644 --- a/depends/README.md +++ b/depends/README.md @@ -38,17 +38,18 @@ Common `host-platform-triplet`s for cross compilation are: - `riscv32-linux-gnu` for Linux RISC-V 32 bit - `riscv64-linux-gnu` for Linux RISC-V 64 bit - `s390x-linux-gnu` for Linux S390X -- `armv7a-linux-android` for Android ARM 32 bit -- `aarch64-linux-android` for Android ARM 64 bit -- `x86_64-linux-android` for Android x86 64 bit -The paths are automatically configured and no other options are needed unless targeting [Android](../doc/build-android.md). +The paths are automatically configured and no other options are needed. ### Install the required dependencies: Ubuntu & Debian +#### Common + + apt install automake bison cmake curl libtool make patch pkg-config python3 xz-utils + #### For macOS cross compilation - sudo apt-get install curl bsdmainutils cmake zip + sudo apt-get install g++ zip Note: You must obtain the macOS SDK before proceeding with a cross-compile. Under the depends directory, create a subdirectory named `SDKs`. @@ -63,7 +64,7 @@ For more information, see [SDK Extraction](../contrib/macdeploy/README.md#sdk-ex Common linux dependencies: - sudo apt-get install make automake cmake curl g++-multilib libtool binutils bsdmainutils pkg-config python3 patch bison + sudo apt-get install g++-multilib binutils For linux ARM cross compilation: diff --git a/depends/hosts/android.mk b/depends/hosts/android.mk deleted file mode 100644 index a1c8c56dbafa1..0000000000000 --- a/depends/hosts/android.mk +++ /dev/null @@ -1,15 +0,0 @@ -ifeq ($(HOST),armv7a-linux-android) -android_CXX=$(ANDROID_TOOLCHAIN_BIN)/$(HOST)eabi$(ANDROID_API_LEVEL)-clang++ -android_CC=$(ANDROID_TOOLCHAIN_BIN)/$(HOST)eabi$(ANDROID_API_LEVEL)-clang -else -android_CXX=$(ANDROID_TOOLCHAIN_BIN)/$(HOST)$(ANDROID_API_LEVEL)-clang++ -android_CC=$(ANDROID_TOOLCHAIN_BIN)/$(HOST)$(ANDROID_API_LEVEL)-clang -endif - -android_CFLAGS=-std=$(C_STANDARD) -android_CXXFLAGS=-std=$(CXX_STANDARD) - -android_AR=$(ANDROID_TOOLCHAIN_BIN)/llvm-ar -android_RANLIB=$(ANDROID_TOOLCHAIN_BIN)/llvm-ranlib - -android_cmake_system=Android diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index 6e9180f5468d6..ca5409333983f 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -5,12 +5,10 @@ boost_packages = boost libevent_packages = libevent qrencode_linux_packages = qrencode -qrencode_android_packages = qrencode qrencode_darwin_packages = qrencode qrencode_mingw32_packages = qrencode qt_linux_packages:=qt expat libxcb xcb_proto libXau xproto freetype fontconfig libxkbcommon libxcb_util libxcb_util_render libxcb_util_keysyms libxcb_util_image libxcb_util_wm -qt_android_packages=qt qt_darwin_packages=qt qt_mingw32_packages=qt diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 0bf0c0036aedc..d35139dd2de3e 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -1,9 +1,9 @@ package=qt -$(package)_version=5.15.13 +$(package)_version=5.15.14 $(package)_download_path=https://download.qt.io/official_releases/qt/5.15/$($(package)_version)/submodules $(package)_suffix=everywhere-opensource-src-$($(package)_version).tar.xz $(package)_file_name=qtbase-$($(package)_suffix) -$(package)_sha256_hash=4cca51dcc1f22ceeee6b3e33cd1c3a60b14e85e24644dca3af89a2c2989ab809 +$(package)_sha256_hash=500d3b390048e9538c28b5f523dfea6936f9c2e10d24ab46580ff57d430b98be $(package)_linux_dependencies=freetype fontconfig libxcb libxkbcommon libxcb_util libxcb_util_render libxcb_util_keysyms libxcb_util_image libxcb_util_wm $(package)_qt_libs=corelib network widgets gui plugins testlib $(package)_linguist_tools = lrelease lupdate lconvert @@ -12,7 +12,6 @@ $(package)_patches += qttools_src.pro $(package)_patches += mac-qmake.conf $(package)_patches += fix_qt_pkgconfig.patch $(package)_patches += no-xlib.patch -$(package)_patches += fix_android_jni_static.patch $(package)_patches += dont_hardcode_pwd.patch $(package)_patches += qtbase-moc-ignore-gcc-macro.patch $(package)_patches += no_warnings_for_symbols.patch @@ -21,15 +20,16 @@ $(package)_patches += duplicate_lcqpafonts.patch $(package)_patches += guix_cross_lib_path.patch $(package)_patches += fix-macos-linker.patch $(package)_patches += memory_resource.patch +$(package)_patches += clang_18_libpng.patch $(package)_patches += utc_from_string_no_optimize.patch $(package)_patches += windows_lto.patch $(package)_patches += zlib-timebits64.patch $(package)_qttranslations_file_name=qttranslations-$($(package)_suffix) -$(package)_qttranslations_sha256_hash=24d4c58bc2a40c0f44f59ee64af4192c7d0038c1e45af61646cfc5b65058f271 +$(package)_qttranslations_sha256_hash=5b94d1a11b566908622fcca2f8b799744d2f8a68da20be4caa5953ed63b10489 $(package)_qttools_file_name=qttools-$($(package)_suffix) -$(package)_qttools_sha256_hash=57c9794c572c4e02871f2e7581525752b0cf85ea16cfab23a4ac9ba7b39a5d34 +$(package)_qttools_sha256_hash=12061a85baf5f4de8fbc795e1d3872b706f340211b9e70962caeffc6f5e89563 $(package)_extra_sources = $($(package)_qttranslations_file_name) $(package)_extra_sources += $($(package)_qttools_file_name) @@ -186,24 +186,6 @@ $(package)_config_opts_mingw32 += -pch ifneq ($(LTO),) $(package)_config_opts_mingw32 += -ltcg endif - -$(package)_config_opts_android = -xplatform android-clang -$(package)_config_opts_android += -android-sdk $(ANDROID_SDK) -$(package)_config_opts_android += -android-ndk $(ANDROID_NDK) -$(package)_config_opts_android += -android-ndk-platform android-$(ANDROID_API_LEVEL) -$(package)_config_opts_android += -egl -$(package)_config_opts_android += -no-dbus -$(package)_config_opts_android += -opengl es2 -$(package)_config_opts_android += -qt-freetype -$(package)_config_opts_android += -no-fontconfig -$(package)_config_opts_android += -L $(host_prefix)/lib -$(package)_config_opts_android += -I $(host_prefix)/include -$(package)_config_opts_android += -pch -$(package)_config_opts_android += -no-feature-vulkan - -$(package)_config_opts_aarch64_android += -android-arch arm64-v8a -$(package)_config_opts_armv7a_android += -android-arch armeabi-v7a -$(package)_config_opts_x86_64_android += -android-arch x86_64 endef define $(package)_fetch_cmds @@ -244,11 +226,11 @@ define $(package)_preprocess_cmds patch -p1 -i $($(package)_patch_dir)/fix-macos-linker.patch && \ patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch && \ patch -p1 -i $($(package)_patch_dir)/fix_qt_pkgconfig.patch && \ - patch -p1 -i $($(package)_patch_dir)/fix_android_jni_static.patch && \ patch -p1 -i $($(package)_patch_dir)/no-xlib.patch && \ patch -p1 -i $($(package)_patch_dir)/qtbase-moc-ignore-gcc-macro.patch && \ patch -p1 -i $($(package)_patch_dir)/memory_resource.patch && \ patch -p1 -i $($(package)_patch_dir)/no_warnings_for_symbols.patch && \ + patch -p1 -i $($(package)_patch_dir)/clang_18_libpng.patch && \ 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)/utc_from_string_no_optimize.patch && \ diff --git a/depends/patches/qt/clang_18_libpng.patch b/depends/patches/qt/clang_18_libpng.patch new file mode 100644 index 0000000000000..e807905b321a5 --- /dev/null +++ b/depends/patches/qt/clang_18_libpng.patch @@ -0,0 +1,40 @@ +fix Qt macOS build with Clang 18 + + See: + https://github.com/pnggroup/libpng/commit/893b8113f04d408cc6177c6de19c9889a48faa24. + + In a similar manner as zlib (madler/zlib#895), + libpng contains a header configuration that's no longer valid and + hasn't been exercised for the macOS target. + + - The target OS conditional macros are misused. Specifically + `TARGET_OS_MAC` covers all Apple targets, including iOS, and it + should not be checked with `#if defined` as they would always be + defined (to either 1 or 0) on Apple platforms. + - `#include ` no longer works for the macOS target and results + in a compilation failure. macOS ships all required functions in + `math.h`, and clients should use `math.h` instead. + +--- a/qtbase/src/3rdparty/libpng/pngpriv.h ++++ b/qtbase/src/3rdparty/libpng/pngpriv.h +@@ -514,18 +514,8 @@ + */ + # include + +-# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ +- defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC) +- /* We need to check that hasn't already been included earlier +- * as it seems it doesn't agree with , yet we should really use +- * if possible. +- */ +-# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__) +-# include +-# endif +-# else +-# include +-# endif ++# include ++ + # if defined(_AMIGA) && defined(__SASC) && defined(_M68881) + /* Amiga SAS/C: We must include builtin FPU functions when compiling using + * MATH=68881 diff --git a/depends/patches/qt/fix_android_jni_static.patch b/depends/patches/qt/fix_android_jni_static.patch deleted file mode 100644 index 79824f244aa5f..0000000000000 --- a/depends/patches/qt/fix_android_jni_static.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- old/qtbase/src/plugins/platforms/android/androidjnimain.cpp -+++ new/qtbase/src/plugins/platforms/android/androidjnimain.cpp -@@ -979,6 +979,14 @@ Q_DECL_EXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void */*reserved*/) - __android_log_print(ANDROID_LOG_FATAL, "Qt", "registerNatives failed"); - return -1; - } -+ -+ const jint ret = QT_PREPEND_NAMESPACE(QtAndroidPrivate::initJNI(vm, env)); -+ if (ret != 0) -+ { -+ __android_log_print(ANDROID_LOG_FATAL, "Qt", "initJNI failed"); -+ return ret; -+ } -+ - QWindowSystemInterfacePrivate::TabletEvent::setPlatformSynthesizesMouse(false); - - m_javaVM = vm; diff --git a/doc/README.md b/doc/README.md index 033c6e926eb5d..44ab081239246 100644 --- a/doc/README.md +++ b/doc/README.md @@ -42,7 +42,6 @@ The following are developer notes on how to build Groestlcoin on your native pla - [FreeBSD Build Notes](build-freebsd.md) - [OpenBSD Build Notes](build-openbsd.md) - [NetBSD Build Notes](build-netbsd.md) -- [Android Build Notes](build-android.md) Development --------------------- diff --git a/doc/build-android.md b/doc/build-android.md deleted file mode 100644 index 1f4e121c2e65c..0000000000000 --- a/doc/build-android.md +++ /dev/null @@ -1,25 +0,0 @@ -ANDROID BUILD NOTES -====================== - -This guide describes how to build and package the `groestlcoin-qt` GUI for Android on Linux and macOS. - - -## Dependencies - -Before proceeding with an Android build one needs to get the [Android SDK](https://developer.android.com/studio) and use the "SDK Manager" tool to download the NDK and one or more "Platform packages" (these are Android versions and have a corresponding API level). - -The minimum supported Android NDK version is [r23](https://github.com/android/ndk/wiki/Changelog-r23). - -In order to build `ANDROID_API_LEVEL` (API level corresponding to the Android version targeted, e.g. Android 9.0 Pie is 28 and its "Platform package" needs to be available) and `ANDROID_TOOLCHAIN_BIN` (path to toolchain binaries depending on the platform the build is being performed on) need to be set. - -API levels from 24 to 29 have been tested to work. - -If the build includes Qt, environment variables `ANDROID_SDK` and `ANDROID_NDK` need to be set as well but can otherwise be omitted. -This is an example command for a default build with no disabled dependencies: - - ANDROID_SDK=/home/user/Android/Sdk ANDROID_NDK=/home/user/Android/Sdk/ndk-bundle make HOST=aarch64-linux-android ANDROID_API_LEVEL=28 ANDROID_TOOLCHAIN_BIN=/home/user/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin - - -## Building and packaging - -After the depends are built configure with one of the resulting prefixes and run `make && make apk` in `src/qt`. diff --git a/src/.clang-tidy b/src/.clang-tidy index a00400f0834e8..61adce1d5066d 100644 --- a/src/.clang-tidy +++ b/src/.clang-tidy @@ -2,6 +2,7 @@ Checks: ' -*, bitcoin-*, bugprone-argument-comment, +bugprone-move-forwarding-reference, bugprone-string-constructor, bugprone-use-after-move, bugprone-lambda-function-name, diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 2c0f9d0d845e9..cf42eb1d32452 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -396,20 +396,6 @@ groestlcoin_qt_clean: FORCE groestlcoin_qt : qt/groestlcoin-qt$(EXEEXT) -APK_LIB_DIR = qt/android/libs/$(ANDROID_ARCH) -QT_BASE_VERSION = $(lastword $(shell $(MOC) --version)) -QT_BASE_PATH = $(shell find ../depends/sources/ -maxdepth 1 -type f -regex ".*qtbase.*$(QT_BASE_VERSION)\.tar.xz") -QT_BASE_TLD = $(shell tar tf $(QT_BASE_PATH) --exclude='*/*') - -groestlcoin_qt_apk: FORCE - mkdir -p $(APK_LIB_DIR) - cp $(dir $(lastword $(CC)))../sysroot/usr/lib/$(host_alias)/libc++_shared.so $(APK_LIB_DIR) - tar xf $(QT_BASE_PATH) -C qt/android/src/ $(QT_BASE_TLD)src/android/jar/src --strip-components=5 - tar xf $(QT_BASE_PATH) -C qt/android/src/ $(QT_BASE_TLD)src/android/java/src --strip-components=5 - cp qt/groestlcoin-qt $(APK_LIB_DIR)/libgroestlcoin-qt_$(ANDROID_ARCH).so - cd qt/android && gradle wrapper --gradle-version=6.6.1 - cd qt/android && ./gradlew build - ui_%.h: %.ui @test -f $(UIC) || (echo "uic $(UIC) not found, but is required for generating ui headers"; exit 1) @$(MKDIR_P) $(@D) diff --git a/src/qt/android/.gitignore b/src/qt/android/.gitignore deleted file mode 100644 index c090a2e98ea8d..0000000000000 --- a/src/qt/android/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -/.gradle -/build -/gradle -/gradlew* -/libs -/src/org/kde -/src/org/qtproject diff --git a/src/qt/android/AndroidManifest.xml b/src/qt/android/AndroidManifest.xml deleted file mode 100644 index 4811667c6fe71..0000000000000 --- a/src/qt/android/AndroidManifest.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/qt/android/build.gradle b/src/qt/android/build.gradle deleted file mode 100644 index 4c36e79db8fb4..0000000000000 --- a/src/qt/android/build.gradle +++ /dev/null @@ -1,52 +0,0 @@ -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.1.0' - } -} - -repositories { - google() - jcenter() -} - -apply plugin: 'com.android.application' - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) -} - -android { - compileSdkVersion androidCompileSdkVersion.toInteger() - - buildToolsVersion androidBuildToolsVersion - - sourceSets { - main { - manifest.srcFile 'AndroidManifest.xml' - java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java'] - aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl'] - res.srcDirs = [qt5AndroidDir + '/res', 'res'] - resources.srcDirs = ['src'] - renderscript.srcDirs = ['src'] - assets.srcDirs = ['assets'] - jniLibs.srcDirs = ['libs'] - } - } - - lintOptions { - abortOnError false - } - - dexOptions { - javaMaxHeapSize '4g' - } - - defaultConfig { - minSdkVersion 24 - } -} diff --git a/src/qt/android/gradle.properties b/src/qt/android/gradle.properties deleted file mode 100644 index 468f4757c0006..0000000000000 --- a/src/qt/android/gradle.properties +++ /dev/null @@ -1,4 +0,0 @@ -androidBuildToolsVersion=30.0.3 -androidCompileSdkVersion=30 -qt5AndroidDir=new File(".").absolutePath -org.gradle.jvmargs=-Xmx4608M diff --git a/src/qt/android/res/values/libs.xml b/src/qt/android/res/values/libs.xml deleted file mode 100644 index 976081059d707..0000000000000 --- a/src/qt/android/res/values/libs.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - arm64-v8a;libgroestlcoin-qt_arm64-v8a.so - - - armeabi-v7a;libgroestlcoin-qt_armeabi-v7a.so - - - x86_64;libgroestlcoin-qt_x86_64.so - - - diff --git a/src/qt/android/src/org/groestlcoin/qt/BitcoinQtActivity.java b/src/qt/android/src/org/groestlcoin/qt/BitcoinQtActivity.java deleted file mode 100644 index cdd8f396da895..0000000000000 --- a/src/qt/android/src/org/groestlcoin/qt/BitcoinQtActivity.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.groestlcoin.qt; - -import android.os.Bundle; -import android.system.ErrnoException; -import android.system.Os; - -import org.qtproject.qt5.android.bindings.QtActivity; - -import java.io.File; - -public class BitcoinQtActivity extends QtActivity -{ - @Override - public void onCreate(Bundle savedInstanceState) - { - final File bitcoinDir = new File(getFilesDir().getAbsolutePath() + "/.groestlcoin"); - if (!bitcoinDir.exists()) { - bitcoinDir.mkdir(); - } - - super.onCreate(savedInstanceState); - } -} diff --git a/test/lint/README.md b/test/lint/README.md index 2f3a327252d7c..71721160cc694 100644 --- a/test/lint/README.md +++ b/test/lint/README.md @@ -37,6 +37,7 @@ Then you can use: | [`lint-python-dead-code.py`](/test/lint/lint-python-dead-code.py) | [vulture](https://github.com/jendrikseipp/vulture) | [`lint-shell.py`](/test/lint/lint-shell.py) | [ShellCheck](https://github.com/koalaman/shellcheck) | [`lint-spelling.py`](/test/lint/lint-spelling.py) | [codespell](https://github.com/codespell-project/codespell) +| markdown link check | [mlc](https://github.com/becheran/mlc) In use versions and install instructions are available in the [CI setup](../../ci/lint/04_install.sh). diff --git a/test/lint/test_runner/src/main.rs b/test/lint/test_runner/src/main.rs index d5dd98effe2b7..5f980eb3989a0 100644 --- a/test/lint/test_runner/src/main.rs +++ b/test/lint/test_runner/src/main.rs @@ -4,9 +4,9 @@ use std::env; use std::fs; +use std::io::ErrorKind; use std::path::{Path, PathBuf}; -use std::process::Command; -use std::process::ExitCode; +use std::process::{Command, ExitCode, Stdio}; type LintError = String; type LintResult = Result<(), LintError>; @@ -292,6 +292,51 @@ fn lint_doc() -> LintResult { } } +fn lint_markdown() -> LintResult { + let bin_name = "mlc"; + let mut md_ignore_paths = get_subtrees(); + md_ignore_paths.push("./doc/README_doxygen.md"); + let md_ignore_path_str = md_ignore_paths.join(","); + + let mut cmd = Command::new(bin_name); + cmd.args([ + "--offline", + "--ignore-path", + md_ignore_path_str.as_str(), + "--root-dir", + ".", + ]) + .stdout(Stdio::null()); // Suppress overly-verbose output + + match cmd.output() { + Ok(output) if output.status.success() => Ok(()), + Ok(output) => { + let stderr = String::from_utf8_lossy(&output.stderr); + let filtered_stderr: String = stderr // Filter out this annoying trailing line + .lines() + .filter(|&line| line != "The following links could not be resolved:") + .collect::>() + .join("\n"); + Err(format!( + r#" +One or more markdown links are broken. + +Relative links are preferred (but not required) as jumping to file works natively within Emacs. + +Markdown link errors found: +{} + "#, + filtered_stderr + )) + } + Err(e) if e.kind() == ErrorKind::NotFound => { + println!("`mlc` was not found in $PATH, skipping markdown lint check."); + Ok(()) + } + Err(e) => Err(format!("Error running mlc: {}", e)), // Misc errors + } +} + fn lint_all() -> LintResult { let mut good = true; let lint_dir = get_git_root().join("test/lint"); @@ -325,6 +370,7 @@ fn main() -> ExitCode { ("no-tabs check", lint_tabs_whitespace), ("build config includes check", lint_includes_build_config), ("-help=1 documentation check", lint_doc), + ("markdown hyperlink check", lint_markdown), ("lint-*.py scripts", lint_all), ];