Commit Graph

649 Commits

Author SHA1 Message Date
Hennadii Stepanov
ef81c51f62
build: Use config_opts instead of passing a compiler flag directly
This approach is safer as it allows the configure script to check the
availability of a compiler flag.
2021-12-12 18:08:43 +02:00
Hennadii Stepanov
3b8f4e347b
build, qt: Drop unused CROSS_COMPILE variable for Android builds
Since Qt 5.14.0 the CROSS_COMPILE variable always being overridden by
the Qt build system internally.

See upstream commit: c28b881c98fadcd3415370fad2525b558f6b03e4
2021-12-12 18:08:43 +02:00
Hennadii Stepanov
ef77549000
build: Include native_X.mk before X.mk
This change fixes some weirdness like `make print-capnp_version` output
in depends.
2021-12-10 09:42:50 +02:00
fanquake
7629efcc2c
Merge bitcoin/bitcoin#23603: build: Fix x86_64 <-> arm64 cross-compiling for macOS
19f3896c9a build: Fix x86_64 <-> arm64 cross-compiling for macOS (Hennadii Stepanov)

Pull request description:

  Currently, on master (111c3e06b3), dependencies are built for the build system architecture, not the provided host.

  On Intel-based macOS Big Sur 11.6.1 (20G224):
  ```
  % make -C depends HOST=arm64-apple-darwin20
  % lipo -info depends/arm64-apple-darwin20/lib/libsqlite3.a
  Non-fat file: depends/arm64-apple-darwin20/lib/libsqlite3.a is architecture: x86_64
  ```

  On M1-based macOS Monterey 12.0.1 (21A559) the `boost` package building fails with multiple errors like that:
  ```
  % make -C depends boost HOST=x86_64-apple-darwin19
  ...
  error: option 'cf-protection=return' cannot be specified on this target
  error: option 'cf-protection=branch' cannot be specified on this target
  2 errors generated.
  ```

  This PR allows to cross-compile as follows:
  - on Intel-based macOS Big Sur 11.6.1 (20G224):
  ```
  % make -C depends HOST=arm64-apple-darwin20
  % lipo -info depends/arm64-apple-darwin20/lib/libsqlite3.a
  Non-fat file: depends/arm64-apple-darwin20/lib/libsqlite3.a is architecture: arm64
  % CONFIG_SITE=$PWD/depends/arm64-apple-darwin20/share/config.site ./configure
  % make
  % lipo -info src/qt/bitcoin-qt
  Non-fat file: src/qt/bitcoin-qt is architecture: arm64
  ```

  - on M1-based macOS Monterey 12.0.1 (21A559):
  ```
  % make -C depends HOST=x86_64-apple-darwin19
  % CONFIG_SITE=$PWD/depends/x86_64-apple-darwin19/share/config.site ./configure
  % make
  % lipo -info src/qt/bitcoin-qt
  Non-fat file: src/qt/bitcoin-qt is architecture: x86_64
  ```

  No behavior change for other builder-host pairs.

  This is an alternative to bitcoin/bitcoin#22506.

ACKs for top commit:
  fanquake:
    ACK 19f3896c9a - this is definitely cleaner than the approach in #22506. I've tested the x86_64 -> arm64 and arm64 -> x86_64 cross-compiles. Going to go-ahead and merge this given it's scoped to building for darwin targets, on darwin. Not sure if this is something we'll actually see used very often.

Tree-SHA512: 67a7fed1db79bc43d41aabb5a676f90417a879e5dcffec1384c288b56ee32ba06ae3819abdc7aca85b81af6e782bcfff5c83a67a455560249fa095a807fc1187
2021-12-09 21:22:58 +08:00
fanquake
ae017b8160
Merge bitcoin/bitcoin#23495: build: Bump Fontconfig version up to 2.12.6
6575d354c8 build: Bump Fonconfig version up to 2.12.6 (Hennadii Stepanov)

Pull request description:

  This PR gets rid of `remove_char_width_usage.patch`.

  Some additional observations:

  1. Newer Fontconfig versions (2.13.0 and 2.13.1) introduce a new dependency, `uuid`, in the [`7b48fd3dd406b926f0e5240b211f72197ed538a9`](7b48fd3dd4) commit
  2. In Fonconfig 2.13.1 (the current stable) excludes the `fcobjshash.h` from the distributive archive (see [`31269e3589e0e6432d12f55db316f4c720a090b5`](31269e3589)), that makes our `gperf_header_regen.patch` unusable, and requires `gperf` as a dependency.

ACKs for top commit:
  fanquake:
    ACK 6575d354c8 - from the best I can determine this doesn't have any versioning / ABI implications. The ABI difference between 2.12.1 and 2.12.6 is two symbol additions, neither of which are used by Qt. Fontconfig seems to be better at maintaining backwards compatibility compared to a library like Freetype.

Tree-SHA512: 36780a0c5a658469697e524d682ebab56c320cb04f8297bc215f4552f183d4f560501fb0a869982fd9053d4a2d571c7fd971d8f5e96c9da9a9d142c485e3baa4
2021-12-09 20:52:01 +08:00
fanquake
1b76b18f8a
Merge bitcoin/bitcoin#23585: scripted-diff: Drop Darwin version for better maintainability
2f356a0ca8 scripted-diff: Drop Darwin version for better maintainability (Hennadii Stepanov)

Pull request description:

  After this PR, any macOS tools version bumping in the future will touch fewer files in the repo.

  Pointing a Darwin version for the `--host` system does not matter for the following reasons:

  - in terms of the resulted binaries, we should only care about the minimum supported macOS version which is a separated parameter in our build system.

  - in terms of the build system itself, the usage of the `$(host)` variable is self-consistent enough. Btw `$(host_os)` value already has the version dropped:
  ```
  $ make -C depends --no-print-directory print-host_os HOST=x86_64-apple-darwin19
  host_os=darwin
  ```

ACKs for top commit:
  gruve-p:
    ACK 2f356a0ca8
  promag:
    ACK 2f356a0ca8.
  fanquake:
    ACK 2f356a0ca8

Tree-SHA512: 374896ab0ba02b0d8b4b21431fe963bd213b0d09586e0898c13a4c5fa294c1b693f1b2c92880c245c4157c14217b4825b36522f461930477f4d2a727086ebb2a
2021-12-09 16:13:33 +08:00
fanquake
0d101050ef
Merge bitcoin/bitcoin#23678: build: Fix build for Android x86_64
ac9e4bc1e2 build: Fix build for Android x86_64 (Hennadii Stepanov)

Pull request description:

  bitcoin/bitcoin#23489 [introduced](https://github.com/bitcoin/bitcoin/pull/23489#issuecomment-985457915) a regression making build for `HOST=x86_64-linux-android` broken due to the [QTBUG-86785](https://bugreports.qt.io/browse/QTBUG-86785).

  This PR fixes this regression.

ACKs for top commit:
  fanquake:
    ACK ac9e4bc1e2

Tree-SHA512: c841a56d745c4b4a75e1bc4d89752de153aa6328752a8fd7df614363ed046a291a9eb58605d82fcba21f3c8b0f0bf47786ed0a63c29f81f5d4ad9c0b12304100
2021-12-08 09:29:39 +08:00
fanquake
6db7e43d42
Merge bitcoin/bitcoin#23677: build, qt: Use Android NDK r23 LTS
78a6bc6919 build, qt: Use Android NDK r23 LTS (Hennadii Stepanov)

Pull request description:

  This is a continuation of bitcoin/bitcoin#23478, and, thanks to bitcoin/bitcoin#23489, a oneline patch is only required to be able build the `qt` package in depends with Android NDK r23 LTS.

ACKs for top commit:
  fanquake:
    ACK 78a6bc6919

Tree-SHA512: 09c6e8739ecbcbf5fdd6c2103577be2676eb448941f97c781f476918056c8405d2531d5cef8f240e4d1205c2d49f879edbba74dd5e77799a887b76a5c76ebe5b
2021-12-07 19:42:35 +08:00
Hennadii Stepanov
ac9e4bc1e2
build: Fix build for Android x86_64 2021-12-05 15:41:08 +02:00
Hennadii Stepanov
78a6bc6919
build, qt: Use Android NDK r23 LTS 2021-12-05 03:00:02 +02:00
Hennadii Stepanov
6575d354c8
build: Bump Fonconfig version up to 2.12.6 2021-12-03 17:39:17 +02:00
fanquake
d6d402bd2b
build: remove x-prefix comparisons
Very old shells suffered from bugs which meant that prefixing variables
with an "x" to ensure that the lefthand side of a comparison always
started with an alphanumeric character was needed. Modern shells don't
suffer from this issue (i.e Bash was fixed in 1996).

In any case, we've already got unprefixed checks used in our codebase,
i.e https://github.com/bitcoin/bitcoin/blob/master/configure.ac#L292,
and have dependencies (in depends) that also use unprefixed comparisons.

I think it's time that we can consolidate on not using the x-prefix
workaround. At best it's mostly just confusing.

More info:
https://github.com/koalaman/shellcheck/wiki/SC2268
https://www.vidarholen.net/contents/blog/?p=1035
2021-12-03 21:03:35 +08:00
Hennadii Stepanov
1732eaba4f
build, qt: Fix regression in rendering on macOS Big Sur 2021-12-03 14:07:12 +08:00
fanquake
c870027cc2
build: qt 5.15.2 2021-12-03 14:07:12 +08:00
fanquake
904ba2aa40
build: add libxcb_util_wm 0.4.1
Required for xcb_icccm.
2021-12-03 14:07:12 +08:00
fanquake
0e2ca89a78
build: add libxcb_util_image 0.4.0 2021-12-03 14:07:11 +08:00
fanquake
36af9b6c94
build: add libxcb_util_keysyms 0.4.0 2021-12-03 14:07:11 +08:00
fanquake
b3cfbf5af2
build: add libxcb_util_render 0.3.9 2021-12-03 14:07:11 +08:00
fanquake
e545b56dc5
build: add libxcb_util 0.4.0 2021-12-03 14:07:11 +08:00
fanquake
937b36b5f0
build: libxcb 1.14
Minimum required libxcb to build qt 5.15.x is 1.11.

https://codereview.qt.nokia.com/c/qt/qtbase/+/253905

Some plugins have been re-enabled as they are required by Qt.
2021-12-03 14:07:10 +08:00
fanquake
01544dd78c
build: freetype 2.11.0
Co-authored-by: mammix2 <mammix2@hotmail.com>
2021-12-03 14:07:10 +08:00
fanquake
10ac182f4c
build: expat 2.4.1 2021-12-03 14:07:10 +08:00
fanquake
d3d547c545
build: xcb_proto 1.14.1 2021-12-03 14:07:10 +08:00
fanquake
fc65127244
build: libXau 1.0.9 2021-12-03 14:07:10 +08:00
fanquake
0697557321
build: xproto 7.0.31 2021-12-03 14:07:09 +08:00
fanquake
29074ba836
Merge bitcoin/bitcoin#23618: build, qt: Ditch no_sdk_version_check.patch
855bd75503 build, qt: Ditch `no_sdk_version_check.patch` (Hennadii Stepanov)

Pull request description:

  Since Qt 5.12.2 (see 5d181961ea) it is possible to control whether to check macOS SDK with the `QT_MAC_SDK_NO_VERSION_CHECK` variable.

ACKs for top commit:
  fanquake:
    ACK 855bd75503

Tree-SHA512: e490f22da9c37d25b58418ca62e65d2303cfbd83139f4abea4b67c37fa97e9a882ccc9d484b49cd2bb3a8851ea35e63123d3c6db7f804d6b50f41b10bd10c10b
2021-11-30 16:50:50 +08:00
Hennadii Stepanov
855bd75503
build, qt: Ditch no_sdk_version_check.patch 2021-11-28 20:56:54 +02:00
Hennadii Stepanov
83c08ba0c9
doc: Fix typos in packages.md 2021-11-28 18:13:52 +02:00
Hennadii Stepanov
19f3896c9a
build: Fix x86_64 <-> arm64 cross-compiling for macOS 2021-11-26 14:19:27 +02:00
fanquake
05cdceb19d
build: don't set PORT=no in config.site
This should have been a part of dropping macports support in #15175.
2021-11-25 21:40:50 +08:00
Hennadii Stepanov
d0204199d6
Revert "doc: Install Rosetta on M1-macOS for qt in depends"
This reverts commit cdb41d5573.

It is no longer required because of the previous commit.
2021-11-25 09:35:25 +02:00
Hennadii Stepanov
f6e2781675
build, qt, macOS: Don't pass -device-option when building natively 2021-11-25 09:35:24 +02:00
Hennadii Stepanov
667f0689ca
build, qt, macOS: Don't hard-code x86_64 as the arch when using qmake
This change fixes qt build on M1 Apple Silicon
2021-11-25 09:35:17 +02:00
Hennadii Stepanov
2f356a0ca8
scripted-diff: Drop Darwin version for better maintainability
-BEGIN VERIFY SCRIPT-
sed -i 's/darwin19/darwin/g' $(git grep --files-with-matches 'darwin19')
-END VERIFY SCRIPT-
2021-11-25 01:12:46 +02:00
Kittywhiskers Van Gogh
8196b0a2bc build: patch qt to explicitly define previously implicit header include
macOS Monterey has refactored some includes such that implicitly defined headers were no longer exposed and that in turns breaks building Qt on macOS 12.

Additional Resources:
 - https://bugreports.qt.io/browse/QTBUG-97855
 - https://codereview.qt-project.org/c/qt/qtbase/+/378706
 - https://code.qt.io/cgit/qt/qtbase.git/commit/src/plugins/platforms/cocoa?id=dece6f5840463ae2ddf927d65eb1b3680e34a547
2021-11-24 14:03:12 +05:30
fanquake
0445e1a1a5
build: use -fcf-protection=full when building Windows Boost in depends 2021-11-17 16:12:47 +08:00
fanquake
6780759a01
Merge bitcoin/bitcoin#23478: build: Add support for Android NDK r23 LTS
4ba492052e doc: Add minimum supported Android NDK version (Hennadii Stepanov)
6393bdcd53 doc: Move Android dependencies guide into `build-android.md` (Hennadii Stepanov)
ac323a7222 build: Switch to llvm buinutils for Android builds (Hennadii Stepanov)

Pull request description:

  The new Long Term Support release of the Android NDK is [available](https://groups.google.com/g/android-ndk-announce/c/MS6Qoub0DKE/m/Zfp5Ys8eAAAJ) since 2021-08-11:

  > As r23 is the new LTS, the support windows for r21 and r22 have now ended.

  On master (8ae4ba481c), dependency build fails because it expects GNU Binutils are present in the Android NDK. In [fact](https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md#binutils):
  > GNU Binutils remains available up to and including r22. All binutils tools with the exception of the assembler (GAS) were removed in r23. GAS was removed in r24.

  This PR switches our depends build system to llvm binutils. The usage of `llvm-ar` and `llvm-ranlib` tools effectively makes r21 the minimum supported version of NDK.

  With this PR:
  - building depends against NDK r23 LTS now is possible with `NO_QT=1`
  - building the `qt` package in depends against NDK r23 LTS still fails:
  ```
  Creating qmake...
  ...

  ERROR: Cannot detect Android NDK toolchain.
  Please use -android-toolchain-version to specify it.
  ```

  The issue with the `qt` package is going to be addressed in another PR.

ACKs for top commit:
  fanquake:
    ACK 4ba492052e

Tree-SHA512: cdc8f95ff9a3ad7f12eb55b9ea18b6b6b800d4cceff7e0321985be6e39d15a2b2ea5b1592972307d76d111292a0ed58fd287e5ca285e2f6868b42a286536d310
2021-11-16 10:05:17 +08:00
MarcoFalke
9d2895157e
Merge bitcoin/bitcoin#23500: doc: fix typos
2de1ceb2e9 depends, wallet: fix typos (Dimitris Apostolou)

Pull request description:

ACKs for top commit:
  hebasto:
    ACK 2de1ceb2e9

Tree-SHA512: e33deef3ebd8cda69dd0f2c0e8d0fd5c39375eb014685318b2f131c7a700584d9b9e173e95ff290b1fe3b2dc88922583f2607750445baedf0c97a330a9ff35f2
2021-11-14 08:38:28 +01:00
Dimitris Apostolou
2de1ceb2e9
depends, wallet: fix typos 2021-11-13 20:05:56 +02:00
fanquake
e734847c1f
build: remove duplicate -fvisibility=hidden from Boost build
Boost already sets this by default.
2021-11-12 19:04:35 +08:00
fanquake
32659e5897
build: don't install Boost cmake config files 2021-11-12 19:04:22 +08:00
Hennadii Stepanov
6393bdcd53
doc: Move Android dependencies guide into build-android.md 2021-11-10 18:51:33 +02:00
Hennadii Stepanov
ac323a7222
build: Switch to llvm buinutils for Android builds
GNU Binutils with the exception of the assembler were removed in NDK r23
LTS.
2021-11-10 18:51:33 +02:00
fanquake
927c2c4f87
Merge bitcoin/bitcoin#22783: build: Cleanup depends build system
539ca409c9 build: Remove unneeded share/man directory from libXau package (Hennadii Stepanov)
6c25c83050 build: Remove unneeded share/man directory from freetype package (Hennadii Stepanov)
9067c6c451 build: Remove empty var/cache/fontconfig directory from fontconfig (Hennadii Stepanov)
4a37c268db build: Remove unneeded share/doc directory from expat package (Hennadii Stepanov)
acb9400ab6 build: Drop non-existent share/pkgconfig directory (Hennadii Stepanov)

Pull request description:

  This PR:
  - removes non-existent `share/pkgconfig` path from `PKG_CONFIG_PATH`. This change, actually, make `PKG_CONFIG_PATH` unused in the depends build system
  - removes `doc`,  `man` and empty directories from the built packages

ACKs for top commit:
  fanquake:
    ACK 539ca409c9

Tree-SHA512: 41ffd5cea962f7533cb5d66ff9e8fd71a3dd7a8d9568b1bb63fc68e7070d7e416f6db02a0f8ab4d94063ee7f6370f00d62a5791b44f0d21c10666af590268c36
2021-10-19 15:51:41 +08:00
Hennadii Stepanov
539ca409c9
build: Remove unneeded share/man directory from libXau package 2021-10-18 14:43:26 +03:00
Hennadii Stepanov
6c25c83050
build: Remove unneeded share/man directory from freetype package 2021-10-18 14:43:26 +03:00
Hennadii Stepanov
9067c6c451
build: Remove empty var/cache/fontconfig directory from fontconfig 2021-10-18 14:43:26 +03:00
Hennadii Stepanov
4a37c268db
build: Remove unneeded share/doc directory from expat package 2021-10-18 14:43:25 +03:00
Hennadii Stepanov
acb9400ab6
build: Drop non-existent share/pkgconfig directory 2021-10-18 14:43:13 +03:00
fanquake
a43b8e9555
build: set OSX_MIN_VERSION to 10.15
This is required to use std::filesystem on macOS as support for it only
landed in the libc++ dylib shipped with 10.15.

See also: https://developer.apple.com/documentation/xcode-release-notes/xcode-11-release-notes

Clang now supports the C++17 <filesystem> library for iOS 13, macOS 10.15, watchOS 6, and tvOS 13.
2021-09-16 17:50:19 +08:00