Skip to content

Commit 7b294ae

Browse files
committed
feat: add launcher for aarch64-darwin platform
1 parent 7e8b7b8 commit 7b294ae

File tree

4 files changed

+86
-50
lines changed

4 files changed

+86
-50
lines changed

.github/workflows/build-and-cache.yaml

+5-33
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ concurrency:
77
cancel-in-progress: true
88

99
jobs:
10-
build-holochain:
10+
build:
1111
strategy:
1212
matrix:
13-
os: [ubuntu-latest, macos-latest, macos-13]
13+
os: [macos-latest]
14+
package: [launcher]
15+
# package: [holochain, lair-keystore, launcher]
1416
fail-fast: false
1517

1618
runs-on: ${{ matrix.os }}
@@ -31,37 +33,7 @@ jobs:
3133
uses: DeterminateSystems/magic-nix-cache-action@main
3234

3335
- name: Build nix package
34-
run: nix build -L .#holochain
35-
36-
- name: Setup tmate session
37-
if: failure()
38-
uses: mxschmitt/action-tmate@v3
39-
40-
build-lair:
41-
strategy:
42-
matrix:
43-
os: [ubuntu-latest, macos-latest, macos-13]
44-
fail-fast: false
45-
46-
runs-on: ${{ matrix.os }}
47-
48-
steps:
49-
- name: Print platform information
50-
run: uname -ms
51-
52-
- name: Check out source code
53-
uses: actions/checkout@v4
54-
55-
- name: Install nix
56-
uses: cachix/install-nix-action@v25
57-
with:
58-
install_url: https://releases.nixos.org/nix/nix-2.18.0/install
59-
60-
- name: Use GitHub cache
61-
uses: DeterminateSystems/magic-nix-cache-action@main
62-
63-
- name: Build nix package
64-
run: nix build -L .#lair-keystore
36+
run: nix build -L .#${{ matrix.package }}
6537

6638
- name: Setup tmate session
6739
if: failure()

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
result

flake.lock

+27-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+53-8
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,16 @@
3232
url = "github:holochain/lair/lair_keystore-v0.4.4";
3333
flake = false;
3434
};
35+
36+
# Holochain Launcher CLI
37+
launcher-src = {
38+
url = "github:holochain/launcher/holochain-0.3";
39+
flake = false;
40+
};
3541
};
3642

3743
# outputs that this flake should produce
38-
outputs = inputs @ { self, nixpkgs, flake-parts, rust-overlay, crane, holochain-src, lair-keystore-src, ... }:
44+
outputs = inputs @ { self, nixpkgs, flake-parts, rust-overlay, crane, holochain-src, lair-keystore-src, launcher-src, ... }:
3945
# refer to flake-parts docs https://flake.parts/
4046
flake-parts.lib.mkFlake { inherit inputs; } {
4147
# systems that his flake can be used on
@@ -78,8 +84,8 @@
7884
};
7985
# additional packages needed for build
8086
buildInputs = [
81-
pkgs.perl
8287
pkgs.go
88+
pkgs.perl
8389
];
8490
# do not check built package as it either builds successfully or not
8591
doCheck = false;
@@ -115,20 +121,59 @@
115121
# do not check built package as it either builds successfully or not
116122
doCheck = false;
117123
};
124+
125+
# define how to build Holochain Launcher binary
126+
launcher =
127+
let
128+
# Crane filters out all non-cargo related files. Define include filter with files needed for build.
129+
includeFilesFilter = path: type: (craneLib.filterCargoSources path type);
130+
in
131+
craneLib.buildPackage {
132+
pname = "hc-launch";
133+
version = "workspace";
134+
# only build hc-launch command
135+
cargoExtraArgs = "--bin hc-launch";
136+
# Use Launcher sources as defined in input dependencies and include only those files defined in the
137+
# filter previously.
138+
src = pkgs.lib.cleanSourceWith {
139+
src = launcher-src;
140+
filter = includeFilesFilter;
141+
};
142+
# additional packages needed for build
143+
# perl needed for openssl on all platforms
144+
buildInputs = [
145+
pkgs.go
146+
pkgs.perl
147+
]
148+
++ (pkgs.lib.optionals pkgs.stdenv.isDarwin [
149+
# additional packages needed for darwin platforms
150+
pkgs.darwin.apple_sdk.frameworks.AppKit
151+
pkgs.darwin.apple_sdk.frameworks.WebKit
152+
# pkgs.darwin.apple_sdk.frameworks.CoreFoundation
153+
# pkgs.darwin.apple_sdk.frameworks.CoreServices
154+
# pkgs.darwin.apple_sdk.frameworks.Security
155+
# pkgs.darwin.apple_sdk.frameworks.IOKit
156+
# # additional packages needed for darwin platforms on x86_64
157+
# pkgs.darwin.apple_sdk_11_0.frameworks.CoreFoundation
158+
]);
159+
# do not check built package as it either builds successfully or not
160+
doCheck = false;
161+
};
118162
in
119163
{
120164
packages = {
121-
inherit holochain;
122-
inherit lair-keystore;
123-
inherit rust;
165+
# inherit holochain;
166+
# inherit lair-keystore;
167+
# inherit rust;
168+
inherit launcher;
124169
};
125170

126171
devShells = {
127172
default = pkgs.mkShell {
128173
packages = [
129-
holochain
130-
lair-keystore
131-
rust
174+
# holochain
175+
# lair-keystore
176+
# rust
132177
];
133178
};
134179
};

0 commit comments

Comments
 (0)