Skip to content

Commit

Permalink
build: remove dmg dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
fanquake authored and hebasto committed Sep 15, 2023
1 parent 33ae0bd commit b5790c3
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 58 deletions.
2 changes: 1 addition & 1 deletion ci/test/00_setup_env_mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export SDK_URL=${SDK_URL:-https://bitcoincore.org/depends-sources/sdks}
export CONTAINER_NAME=ci_macos_cross
export CI_IMAGE_NAME_TAG="docker.io/ubuntu:22.04"
export HOST=x86_64-apple-darwin
export PACKAGES="cmake libz-dev python3-setuptools xorriso zip"
export PACKAGES="cmake libz-dev python3-setuptools zip"
export XCODE_VERSION=12.2
export XCODE_BUILD_ID=12B45b
export RUN_UNIT_TESTS=false
Expand Down
1 change: 0 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,6 @@ case $host in
AC_PATH_TOOL([DSYMUTIL], [dsymutil], [dsymutil])
AC_PATH_TOOL([INSTALL_NAME_TOOL], [install_name_tool], [install_name_tool])
AC_PATH_TOOL([OTOOL], [otool], [otool])
AC_PATH_PROGS([XORRISOFS], [xorrisofs], [xorrisofs])
AC_PATH_PROG([ZIP], [zip], [zip])

dnl libtool will try to strip the static lib, which is a problem for
Expand Down
3 changes: 1 addition & 2 deletions contrib/guix/manifest.scm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
((gnu packages bash) #:select (bash-minimal))
(gnu packages bison)
((gnu packages certs) #:select (nss-certs))
((gnu packages cdrom) #:select (xorriso))
((gnu packages cmake) #:select (cmake-minimal))
(gnu packages commencement)
(gnu packages compression)
Expand Down Expand Up @@ -606,5 +605,5 @@ inspecting signatures in Mach-O binaries.")
((string-contains target "-linux-")
(list (make-bitcoin-cross-toolchain target)))
((string-contains target "darwin")
(list clang-toolchain-15 binutils cmake-minimal xorriso python-signapple zip))
(list clang-toolchain-15 binutils cmake-minimal python-signapple zip))
(else '())))))
19 changes: 7 additions & 12 deletions contrib/macdeploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The `macdeployqtplus` script should not be run manually. Instead, after building
make deploy
```

When complete, it will have produced `Bitcoin-Core.dmg`.
When complete, it will have produced `Bitcoin-Core.zip`.

## SDK Extraction

Expand Down Expand Up @@ -60,10 +60,10 @@ previous stage) as the first argument.

The `sha256sum` of the generated TAR.GZ archive should be `df75d30ecafc429e905134333aeae56ac65fac67cb4182622398fd717df77619`.

## Deterministic macOS DMG Notes
## Deterministic macOS App Notes

Working macOS DMGs are created in Linux by combining a recent `clang`, the Apple
`binutils` (`ld`, `ar`, etc) and DMG authoring tools.
macOS Applications are created in Linux by combining a recent `clang` and the Apple
`binutils` (`ld`, `ar`, etc).

Apple uses `clang` extensively for development and has upstreamed the necessary
functionality so that a vanilla clang can take advantage. It supports the use of `-F`,
Expand Down Expand Up @@ -93,20 +93,15 @@ created using these tools. The build process has been designed to avoid includin
SDK's files in Guix's outputs. All interim tarballs are fully deterministic and may be freely
redistributed.

[`xorrisofs`](https://www.gnu.org/software/xorriso/) is used to create the DMG.

A background image is added to DMG files by inserting a `.DS_Store` during creation.

As of OS X 10.9 Mavericks, using an Apple-blessed key to sign binaries is a requirement in
order to satisfy the new Gatekeeper requirements. Because this private key cannot be
shared, we'll have to be a bit creative in order for the build process to remain somewhat
deterministic. Here's how it works:

- Builders use Guix to create an unsigned release. This outputs an unsigned DMG which
- Builders use Guix to create an unsigned release. This outputs an unsigned ZIP which
users may choose to bless and run. It also outputs an unsigned app structure in the form
of a tarball, which also contains all of the tools that have been previously (deterministically)
built in order to create a final DMG.
of a tarball.
- The Apple keyholder uses this unsigned app to create a detached signature, using the
script that is also included there. Detached signatures are available from this [repository](https://github.com/bitcoin-core/bitcoin-detached-sigs).
- Builders feed the unsigned app + detached signature back into Guix. It uses the
pre-built tools to recombine the pieces into a deterministic DMG.
pre-built tools to recombine the pieces into a deterministic ZIP.
2 changes: 1 addition & 1 deletion depends/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ The paths are automatically configured and no other options are needed unless ta

#### For macOS cross compilation

sudo apt-get install curl bsdmainutils cmake libz-dev python3-setuptools xorriso zip
sudo apt-get install curl bsdmainutils cmake libz-dev python3-setuptools zip

Note: You must obtain the macOS SDK before proceeding with a cross-compile.
Under the depends directory, create a subdirectory named `SDKs`.
Expand Down
15 changes: 0 additions & 15 deletions depends/packages/native_ds_store.mk

This file was deleted.

15 changes: 0 additions & 15 deletions depends/packages/native_mac_alias.mk

This file was deleted.

2 changes: 1 addition & 1 deletion depends/packages/packages.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ multiprocess_native_packages = native_libmultiprocess native_capnp

usdt_linux_packages=systemtap

darwin_native_packages = native_ds_store native_mac_alias
darwin_native_packages =

ifneq ($(build_os),darwin)
darwin_native_packages += native_cctools native_libtapi
Expand Down
12 changes: 3 additions & 9 deletions doc/build-osx.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,8 @@ brew install python

#### Deploy Dependencies

You can deploy a `.dmg` containing the Bitcoin Core application using `make deploy`.
This command depends on a couple of python packages, so it is required that you have `python` installed.

Ensuring that `python` is installed, you can install the deploy dependencies by running the following commands in your terminal:

``` bash
pip3 install ds_store mac_alias
```
You can deploy a `.zip` containing the Bitcoin Core application using `make deploy`.
It is required that you have `python` installed.

## Building Bitcoin Core

Expand Down Expand Up @@ -230,7 +224,7 @@ make check # Run tests if Python 3 is available

### 3. Deploy (optional)

You can also create a `.dmg` containing the `.app` bundle by running the following command:
You can also create a `.zip` containing the `.app` bundle by running the following command:

``` bash
make deploy
Expand Down
2 changes: 1 addition & 1 deletion doc/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ git -C ./guix.sigs pull
### Create the macOS SDK tarball (first time, or when SDK version changes)

Create the macOS SDK tarball, see the [macdeploy
instructions](/contrib/macdeploy/README.md#deterministic-macos-dmg-notes) for
instructions](/contrib/macdeploy/README.md#deterministic-macos-app-notes) for
details.

### Build and attest to build outputs
Expand Down

0 comments on commit b5790c3

Please sign in to comment.