Skip to content

Commit

Permalink
build: remove dmg dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
fanquake committed Feb 14, 2023
1 parent 92945d4 commit 49336b1
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 52 deletions.
3 changes: 1 addition & 2 deletions contrib/guix/manifest.scm
Expand Up @@ -5,7 +5,6 @@
(gnu packages bash)
(gnu packages bison)
(gnu packages certs)
(gnu packages cdrom)
(gnu packages check)
(gnu packages cmake)
(gnu packages commencement)
Expand Down Expand Up @@ -634,5 +633,5 @@ inspecting signatures in Mach-O binaries.")
(else
(make-bitcoin-cross-toolchain target)))))
((string-contains target "darwin")
(list clang-toolchain-10 binutils cmake xorriso python-signapple))
(list clang-toolchain-10 binutils cmake python-signapple))
(else '())))))
16 changes: 6 additions & 10 deletions contrib/macdeploy/README.md
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,16 @@ 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.
- 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
Expand Up @@ -47,7 +47,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 libtinfo5 xorriso
sudo apt-get install curl bsdmainutils cmake libz-dev libtinfo5

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
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
10 changes: 2 additions & 8 deletions doc/build-osx.md
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

0 comments on commit 49336b1

Please sign in to comment.