From 26b15df99de9984ade134c3c896b7c1c32c089e4 Mon Sep 17 00:00:00 2001 From: fanquake Date: Mon, 9 Jul 2018 00:15:46 +0800 Subject: [PATCH 1/6] depends: set OSX_MIN_VERSION to 10.10 --- .travis.yml | 2 +- contrib/gitian-descriptors/gitian-osx.yml | 2 +- depends/Makefile | 2 +- depends/README.md | 2 +- depends/hosts/darwin.mk | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2e03511a6..19e717447 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,7 +40,7 @@ env: # x86_64 Linux, No wallet - HOST=x86_64-unknown-linux-gnu PACKAGES="python3" DEP_OPTS="NO_WALLET=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports" # Cross-Mac - - HOST=x86_64-apple-darwin11 PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python-dev python3-setuptools-git" BITCOIN_CONFIG="--enable-gui --enable-reduce-exports --enable-werror" OSX_SDK=10.11 GOAL="all deploy" + - HOST=x86_64-apple-darwin14 PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python-dev python3-setuptools-git" BITCOIN_CONFIG="--enable-gui --enable-reduce-exports --enable-werror" OSX_SDK=10.11 GOAL="all deploy" before_install: - export PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g") diff --git a/contrib/gitian-descriptors/gitian-osx.yml b/contrib/gitian-descriptors/gitian-osx.yml index 7d4793b97..e2695b6f7 100644 --- a/contrib/gitian-descriptors/gitian-osx.yml +++ b/contrib/gitian-descriptors/gitian-osx.yml @@ -34,7 +34,7 @@ files: - "MacOSX10.11.sdk.tar.gz" script: | WRAP_DIR=$HOME/wrapped - HOSTS="x86_64-apple-darwin11" + HOSTS="x86_64-apple-darwin14" CONFIGFLAGS="--enable-reduce-exports --disable-bench --disable-gui-tests GENISOIMAGE=$WRAP_DIR/genisoimage" FAKETIME_HOST_PROGS="" FAKETIME_PROGS="ar ranlib date dmg genisoimage" diff --git a/depends/Makefile b/depends/Makefile index c73ea0f73..3686aaf1f 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -178,7 +178,7 @@ install: check-packages $(host_prefix)/share/config.site download-one: check-sources $(all_sources) download-osx: - @$(MAKE) -s HOST=x86_64-apple-darwin11 download-one + @$(MAKE) -s HOST=x86_64-apple-darwin14 download-one download-linux: @$(MAKE) -s HOST=x86_64-unknown-linux-gnu download-one download-win: diff --git a/depends/README.md b/depends/README.md index 226a1cc93..fd343f701 100644 --- a/depends/README.md +++ b/depends/README.md @@ -22,7 +22,7 @@ Common `host-platform-triplets` for cross compilation are: - `i686-w64-mingw32` for Win32 - `x86_64-w64-mingw32` for Win64 -- `x86_64-apple-darwin11` for macOS +- `x86_64-apple-darwin14` for macOS - `arm-linux-gnueabihf` for Linux ARM 32 bit - `aarch64-linux-gnu` for Linux ARM 64 bit - `riscv32-linux-gnu` for Linux RISC-V 32 bit diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index 4e58bec74..a1c943d60 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -1,4 +1,4 @@ -OSX_MIN_VERSION=10.8 +OSX_MIN_VERSION=10.10 OSX_SDK_VERSION=10.11 OSX_SDK=$(SDK_PATH)/MacOSX$(OSX_SDK_VERSION).sdk LD64_VERSION=253.9 From 84b0cfa8b6859822bd964ef42b03832990d2ec03 Mon Sep 17 00:00:00 2001 From: fanquake Date: Mon, 9 Jul 2018 00:26:52 +0800 Subject: [PATCH 2/6] release: bump minimum required macOS to 10.10 --- share/qt/Info.plist.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qt/Info.plist.in b/share/qt/Info.plist.in index 5ca6d9d01..17b4ee47d 100644 --- a/share/qt/Info.plist.in +++ b/share/qt/Info.plist.in @@ -3,7 +3,7 @@ LSMinimumSystemVersion - 10.8.0 + 10.10.0 LSArchitecturePriority From 6c6dbd8af5a348bd2d9d14aa8f48f512e418eae6 Mon Sep 17 00:00:00 2001 From: fanquake Date: Mon, 9 Jul 2018 00:28:20 +0800 Subject: [PATCH 3/6] doc: mention that macOS 10.10 is now required --- doc/build-osx.md | 2 +- doc/release-notes.md | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/build-osx.md b/doc/build-osx.md index a07dbd1e1..486a505b6 100644 --- a/doc/build-osx.md +++ b/doc/build-osx.md @@ -91,6 +91,6 @@ Other commands: Notes ----- -* Tested on OS X 10.8 Mountain Lion through macOS 10.13 High Sierra on 64-bit Intel processors only. +* Tested on OS X 10.10 Yosemite through macOS 10.13 High Sierra on 64-bit Intel processors only. * Building with downloaded Qt binaries is not officially supported. See the notes in [#7714](https://github.com/bitcoin/bitcoin/issues/7714) diff --git a/doc/release-notes.md b/doc/release-notes.md index b7eaa6eaf..ad0c42ab3 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -48,11 +48,14 @@ Compatibility ============== Bitcoin Core is extensively tested on multiple operating systems using -the Linux kernel, macOS 10.8+, and Windows 7 and newer (Windows XP is not supported). +the Linux kernel, macOS 10.10+, and Windows 7 and newer (Windows XP is not supported). Bitcoin Core should also work on most other Unix-like systems but is not frequently tested on them. +From 0.17.0 onwards macOS <10.10 is no longer supported. 0.17.0 is built using Qt 5.9.x, which doesn't +support versions of macOS older than 10.10. + Notable changes =============== From 68c272527f8eb9cc8e7699bbb8956512e5b2e42d Mon Sep 17 00:00:00 2001 From: fanquake Date: Mon, 9 Jul 2018 09:33:57 +0800 Subject: [PATCH 4/6] gui: remove SubstituteFonts --- src/qt/bitcoin.cpp | 1 - src/qt/guiutil.cpp | 46 ---------------------------------------------- src/qt/guiutil.h | 3 --- 3 files changed, 50 deletions(-) diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 3454d3421..5d0e384cf 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -614,7 +614,6 @@ int main(int argc, char *argv[]) QApplication::setOrganizationName(QAPP_ORG_NAME); QApplication::setOrganizationDomain(QAPP_ORG_DOMAIN); QApplication::setApplicationName(QAPP_APP_NAME_DEFAULT); - GUIUtil::SubstituteFonts(GetLangTerritory()); /// 4. Initialization of translations, so that intro dialog is in user's language // Now that QSettings are accessible, initialize translations diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index acd9f7b35..3ec8c340b 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -63,16 +63,6 @@ static fs::detail::utf8_codecvt_facet utf8; -#if defined(Q_OS_MAC) -extern double NSAppKitVersionNumber; -#if !defined(NSAppKitVersionNumber10_8) -#define NSAppKitVersionNumber10_8 1187 -#endif -#if !defined(NSAppKitVersionNumber10_9) -#define NSAppKitVersionNumber10_9 1265 -#endif -#endif - namespace GUIUtil { QString dateTimeStr(const QDateTime &date) @@ -391,42 +381,6 @@ bool openBitcoinConf() return QDesktopServices::openUrl(QUrl::fromLocalFile(boostPathToQString(pathConfig))); } -void SubstituteFonts(const QString& language) -{ -#if defined(Q_OS_MAC) -// Background: -// OSX's default font changed in 10.9 and Qt is unable to find it with its -// usual fallback methods when building against the 10.7 sdk or lower. -// The 10.8 SDK added a function to let it find the correct fallback font. -// If this fallback is not properly loaded, some characters may fail to -// render correctly. -// -// The same thing happened with 10.10. .Helvetica Neue DeskInterface is now default. -// -// Solution: If building with the 10.7 SDK or lower and the user's platform -// is 10.9 or higher at runtime, substitute the correct font. This needs to -// happen before the QApplication is created. -#if defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8 - if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_8) - { - if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_9) - /* On a 10.9 - 10.9.x system */ - QFont::insertSubstitution(".Lucida Grande UI", "Lucida Grande"); - else - { - /* 10.10 or later system */ - if (language == "zh_CN" || language == "zh_TW" || language == "zh_HK") // traditional or simplified Chinese - QFont::insertSubstitution(".Helvetica Neue DeskInterface", "Heiti SC"); - else if (language == "ja") // Japanese - QFont::insertSubstitution(".Helvetica Neue DeskInterface", "Songti SC"); - else - QFont::insertSubstitution(".Helvetica Neue DeskInterface", "Lucida Grande"); - } - } -#endif -#endif -} - ToolTipToRichTextFilter::ToolTipToRichTextFilter(int _size_threshold, QObject *parent) : QObject(parent), size_threshold(_size_threshold) diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index e965a91d1..651b96e3f 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -120,9 +120,6 @@ namespace GUIUtil // Open the config file bool openBitcoinConf(); - // Replace invalid default fonts with known good ones - void SubstituteFonts(const QString& language); - /** Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text representation if needed. This assures that Qt can word-wrap long tooltip messages. Tooltips longer than the provided size threshold (in characters) are wrapped. From fa6e841e89d164850dcfb6efe5b03992594c1ca3 Mon Sep 17 00:00:00 2001 From: fanquake Date: Mon, 9 Jul 2018 10:05:00 +0800 Subject: [PATCH 5/6] gui: remove macOS ProgressBar workaround --- src/qt/guiutil.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index 651b96e3f..199aa9474 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -230,19 +230,7 @@ namespace GUIUtil void mouseReleaseEvent(QMouseEvent *event); }; -#if defined(Q_OS_MAC) - // workaround for Qt OSX Bug: - // https://bugreports.qt-project.org/browse/QTBUG-15631 - // QProgressBar uses around 10% CPU even when app is in background - class ProgressBar : public ClickableProgressBar - { - bool event(QEvent *e) { - return (e->type() != QEvent::StyleAnimationUpdate) ? QProgressBar::event(e) : false; - } - }; -#else typedef ClickableProgressBar ProgressBar; -#endif } // namespace GUIUtil From 3828a797115a879705085ccbb373e607def61234 Mon Sep 17 00:00:00 2001 From: fanquake Date: Wed, 11 Jul 2018 15:14:29 +0800 Subject: [PATCH 6/6] scripted-diff: prefer MAC_OSX over __APPLE__ -BEGIN VERIFY SCRIPT- sed -i 's/__APPLE__/MAC_OSX/g' src/compat/byteswap.h src/util.cpp -END VERIFY SCRIPT- --- src/compat/byteswap.h | 4 ++-- src/util.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compat/byteswap.h b/src/compat/byteswap.h index c331af2b5..bfb80bd63 100644 --- a/src/compat/byteswap.h +++ b/src/compat/byteswap.h @@ -15,7 +15,7 @@ #include #endif -#if defined(__APPLE__) +#if defined(MAC_OSX) #if !defined(bswap_16) @@ -61,6 +61,6 @@ inline uint64_t bswap_64(uint64_t x) } #endif // HAVE_DECL_BSWAP64 == 0 -#endif // defined(__APPLE__) +#endif // defined(MAC_OSX) #endif // BITCOIN_COMPAT_BYTESWAP_H diff --git a/src/util.cpp b/src/util.cpp index 8df23dd08..2f81f50a7 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1021,7 +1021,7 @@ bool FileCommit(FILE *file) LogPrintf("%s: fdatasync failed: %d\n", __func__, errno); return false; } - #elif defined(__APPLE__) && defined(F_FULLFSYNC) + #elif defined(MAC_OSX) && defined(F_FULLFSYNC) if (fcntl(fileno(file), F_FULLFSYNC, 0) == -1) { // Manpage says "value other than -1" is returned on success LogPrintf("%s: fcntl F_FULLFSYNC failed: %d\n", __func__, errno); return false;