Skip to content

Commit 1e2276e

Browse files
committed
Merge branch 'develop' into chore/ddw-596-webpack-5-upgrade
2 parents 1ed44ea + 4de5d2c commit 1e2276e

23 files changed

+410
-108
lines changed

.buildkite/pipeline.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@ env:
22
ARTIFACT_BUCKET: s3://ci-output-sink
33
steps:
44
- label: 'daedalus-x86_64-darwin'
5-
command: 'scripts/build-installer-unix.sh --build-id $BUILDKITE_BUILD_NUMBER'
5+
command: 'scripts/build-installer-unix.sh--nix-2.5 --build-id $BUILDKITE_BUILD_NUMBER'
66
env:
77
NIX_SSL_CERT_FILE: /nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt
88
agents:
99
queue: daedalus
1010
system: x86_64-darwin
11+
- label: 'daedalus-aarch64-darwin'
12+
command: 'scripts/build-installer-unix.sh--nix-2.5 --build-id $BUILDKITE_BUILD_NUMBER'
13+
env:
14+
NIX_SSL_CERT_FILE: /nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt
15+
UPLOAD_DIR_OVERRIDE: UNSAFE-internal-build
16+
agents:
17+
queue: daedalus
18+
system: aarch64-darwin
1119
- label: 'daedalus-x86_64-linux-nix'
1220
command: 'scripts/build-installer-nix.sh $BUILDKITE_BUILD_NUMBER'
1321
agents:

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
### Features
1111

1212
- Added support for Ledger Nano S Plus ([PR 2975](https://github.com/input-output-hk/daedalus/pull/2975))
13+
- Support of Apple AArch64 chip ([PR 2684](https://github.com/input-output-hk/daedalus/pull/2684))
1314

1415
### Chores
1516

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@ Daedalus - Cryptocurrency Wallet
4444
extra-sandbox-paths = /System/Library/Frameworks /System/Library/PrivateFrameworks /usr/lib
4545
experimental-features = nix-command flakes
4646
47-
# If you are running on a Mac with M1 chip please uncomment 'system' setting to enforce running on Rosetta2
48-
# system = x86_64-darwin
47+
# If you are running on a Mac with Intel chip
48+
system = x86_64-darwin
49+
50+
# If you are running on a Mac with M1 chip
51+
system = aarch64-darwin
4952
```
5053

5154
3. Run `nix-shell` with correct list of arguments or by using existing `package.json` scripts to load a shell with all the correct versions of all the required dependencies for development.

default.nix

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ let
3232
};
3333
pkgs = import sources.nixpkgs { inherit system config; };
3434
sources = localLib.sources;
35+
haskellNix = import sources."haskell.nix" {};
36+
inherit (import haskellNix.sources.nixpkgs-unstable haskellNix.nixpkgsArgs) haskell-nix;
3537
flake-compat = import sources.flake-compat;
3638
walletFlake = flake-compat { src = sources.cardano-wallet; };
3739
walletPackages = with walletFlake.defaultNix.hydraJobs; {
@@ -56,13 +58,14 @@ let
5658
ostable.x86_64-windows = "windows";
5759
ostable.x86_64-linux = "linux";
5860
ostable.x86_64-darwin = "macos64";
61+
ostable.aarch64-darwin = "macos64-arm";
62+
5963
packages = self: {
6064
inherit cluster pkgs version target nodeImplementation;
61-
inherit (pkgs) hello cabal2nix;
6265
cardanoLib = localLib.iohkNix.cardanoLib;
6366
daedalus-bridge = self.bridgeTable.${nodeImplementation};
6467

65-
nodejs = pkgs.nodejs-14_x;
68+
nodejs = pkgs.nodejs-16_x;
6669
nodePackages = pkgs.nodePackages.override { nodejs = self.nodejs; };
6770
yarnInfo = {
6871
version = "1.22.4";
@@ -316,7 +319,11 @@ let
316319
};
317320
rawapp-win64 = self.rawapp.override { win64 = true; };
318321
source = builtins.filterSource localLib.cleanSourceFilter ./.;
319-
yaml2json = pkgs.haskell.lib.addExtraLibrary (pkgs.haskell.lib.disableCabalFlag pkgs.haskellPackages.yaml "no-exe") pkgs.haskellPackages.optparse-applicative;
322+
inherit ((haskell-nix.hackage-package { name = "yaml"; compiler-nix-name = "ghc8107"; cabalProject = ''
323+
packages: .
324+
package yaml
325+
flags: -no-exe
326+
''; }).components.exes) yaml2json;
320327

321328
electron = pkgs.callPackage ./installers/nix/electron.nix {};
322329

installers/Installer.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ genSignedInstaller os options'= do
4646
export "NETWORK" (clusterNetwork $ oCluster options')
4747
case os of
4848
Linux64 -> putStrLn ("Use default.nix, please." :: String)
49-
Macos64 -> MacInstaller.main options'
49+
Macos64 -> MacInstaller.main options'
5050
Win64 -> WindowsInstaller.main options'

installers/Spec.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ macBuildSpec = do
5050
liftIO $ do
5151
withDir installersDir $ do
5252
mktree "../release/darwin-x64/Daedalus-darwin-x64/Daedalus.app/Contents/Resources/app"
53+
mktree "../release/darwin-arm64/Daedalus-darwin-arm64/Daedalus.app/Contents/Resources/app"
5354
writeFile "../release/darwin-x64/Daedalus-darwin-x64/Daedalus.app/Contents/Resources/app/package.json" "{}"
55+
writeFile "../release/darwin-arm64/Daedalus-darwin-arm64/Daedalus.app/Contents/Resources/app/package.json" "{}"
5456
Mac.main opts
5557

5658
-- there should be an installer file at the end

installers/common/MacInstaller.hs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import Text.RawString.QQ
2525
import System.IO (BufferMode (NoBuffering),
2626
hSetBuffering)
2727
import System.IO.Error (IOError, isDoesNotExistError)
28+
import qualified System.Info
2829
import System.Environment (getEnv)
2930
import System.Posix.Files
3031
import Turtle hiding (e, prefix, stdout)
@@ -151,15 +152,21 @@ sign_cmd "$ABS_PATH/Contents/Resources/app/build/usb_bindings.node"
151152
sign_cmd "$ABS_PATH/Contents/Resources/app/build/HID.node"
152153
sign_cmd "$ABS_PATH/Contents/Resources/app/build/detection.node"
153154
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/keccak/bin/darwin-x64-"*"/keccak.node"
155+
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/keccak/bin/darwin-arm64-"*"/keccak.node"
154156
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/keccak/build/Release/addon.node"
155157
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/keccak/prebuilds/darwin-x64/node.napi.node"
158+
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/keccak/prebuilds/darwin-arm64/node.napi.node"
156159
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/blake-hash/prebuilds/darwin-x64/node.napi.node"
160+
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/blake-hash/prebuilds/darwin-arm64/node.napi.node"
157161
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/blake-hash/bin/darwin-x64-"*"/blake-hash.node"
162+
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/blake-hash/bin/darwin-arm64-"*"/blake-hash.node"
158163
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/blake-hash/build/Release/addon.node"
159164
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/blake2/build/Release/binding.node"
160165
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/blake2/bin/darwin-x64-"*"/blake2.node"
166+
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/blake2/bin/darwin-arm64-"*"/blake2.node"
161167
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/tiny-secp256k1/build/Release/secp256k1.node"
162168
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/tiny-secp256k1/bin/darwin-x64-"*"/tiny-secp256k1.node"
169+
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/tiny-secp256k1/bin/darwin-arm64-"*"/tiny-secp256k1.node"
163170

164171
# Sign the whole component deeply
165172
sign_cmd "$ABS_PATH"
@@ -213,7 +220,10 @@ buildElectronApp darwinConfig@DarwinConfig{dcAppName, dcAppNameApp} installerCon
213220

214221
let
215222
formatter :: Format r (Text -> Text -> r)
216-
formatter = "../release/darwin-x64/" % s % "-darwin-x64/" % s
223+
formatter =
224+
if System.Info.arch == "aarch64"
225+
then "../release/darwin-arm64/" % s % "-darwin-arm64/" % s
226+
else "../release/darwin-x64/" % s % "-darwin-x64/" % s
217227
pathtoapp :: Text
218228
pathtoapp = format formatter dcAppName dcAppNameApp
219229
externalYarn :: [FilePath]
@@ -325,6 +335,8 @@ npmPackage DarwinConfig{dcAppName} = do
325335
procs "yarn" ["install", "--frozen-lockfile"] empty
326336
echo "Running electron packager script..."
327337
export "NODE_ENV" "production"
338+
homeDir <- home
339+
export "TMPDIR" . tt $ homeDir </> "electron-rebuild-tmp-dir" -- else, new `electron-rebuild` fails with EACCESS
328340
procs "yarn" ["run", "package", "--", "--name", dcAppName ] empty
329341
procs "node_modules/.bin/electron-rebuild" ["-w", "usb-detection", "--useCache", "-s"] empty -- <https://github.com/MadLittleMods/node-usb-detection#install-for-electron>
330342
size <- inproc "du" ["-sh", "release"] empty

installers/common/WindowsInstaller.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ writeInstallerNSIS outName (Version fullVersion') InstallerConfig{installDirecto
217217
file [Recursive] "test\\"
218218
file [] "token-metadata.json"
219219
file [] "cardano-launcher.exe"
220-
file [] "libffi-7.dll"
221220
file [] "libffi-8.dll"
222221
file [] "libgmp-10.dll"
223222
--file [] "cardano-x509-certificates.exe"

installers/daedalus-installer.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,5 @@ mkDerivation {
3030
system-filepath temporary text turtle universum yaml
3131
];
3232
description = "Daedalus Installer Builder";
33-
3433
license = lib.licenses.asl20;
3534
}

installers/nix/electron.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ let
1212
homepage = https://github.com/electron/electron;
1313
license = licenses.mit;
1414
maintainers = with maintainers; [ travisbhartwell manveru ];
15-
platforms = [ "x86_64-darwin" "x86_64-linux" "i686-linux" "armv7l-linux" "aarch64-linux" ];
15+
platforms = [ "x86_64-darwin" "aarch64-darwin" "x86_64-linux" "i686-linux" "armv7l-linux" "aarch64-linux" ];
1616
};
1717

1818
linux = {

0 commit comments

Comments
 (0)