Skip to content

Commit aa234a9

Browse files
committed
nix: add wakucanary Flake package
Signed-off-by: Jakub Sokołowski <jakub@status.im>
1 parent 1ad5512 commit aa234a9

File tree

4 files changed

+50
-18
lines changed

4 files changed

+50
-18
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,4 +517,3 @@ release-notes:
517517
sed -E 's@#([0-9]+)@[#\1](https://github.com/waku-org/nwaku/issues/\1)@g'
518518
# I could not get the tool to replace issue ids with links, so using sed for now,
519519
# asked here: https://github.com/bvieira/sv4git/discussions/101
520-

flake.lock

Lines changed: 27 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
inputs = {
1010
nixpkgs.url = "github:NixOS/nixpkgs?rev=f44bd8ca21e026135061a0a57dcf3d0775b67a49";
1111
zerokit = {
12-
url = "github:vacp2p/zerokit?rev=c60e0c33fc6350a4b1c20e6b6727c44317129582";
12+
url = "github:vacp2p/zerokit?rev=9a5d421ceabb09263eae9f1455e98737fe35fb4b";
1313
inputs.nixpkgs.follows = "nixpkgs";
1414
};
1515
};
@@ -49,16 +49,23 @@
4949
libwaku-android-arm64 = pkgs.callPackage ./nix/default.nix {
5050
inherit stableSystems;
5151
src = self;
52-
targets = ["libwaku-android-arm64"];
53-
androidArch = "aarch64-linux-android";
52+
targets = ["libwaku-android-arm64"];
5453
abidir = "arm64-v8a";
55-
zerokitPkg = zerokit.packages.${system}.zerokit-android-arm64;
54+
zerokitRln = zerokit.packages.${system}.rln-android-arm64;
5655
};
56+
57+
wakucanary = pkgs.callPackage ./nix/default.nix {
58+
inherit stableSystems;
59+
src = self;
60+
targets = ["wakucanary"];
61+
zerokitRln = zerokit.packages.${system}.rln-native;
62+
};
63+
5764
default = libwaku-android-arm64;
5865
});
5966

6067
devShells = forAllSystems (system: {
6168
default = pkgsFor.${system}.callPackage ./nix/shell.nix {};
6269
});
6370
};
64-
}
71+
}

nix/default.nix

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
stableSystems ? [
1010
"x86_64-linux" "aarch64-linux"
1111
],
12-
androidArch,
13-
abidir,
14-
zerokitPkg,
12+
abidir ? null,
13+
zerokitRln,
1514
}:
1615

1716
assert pkgs.lib.assertMsg ((src.submodules or true) == true)
@@ -51,7 +50,7 @@ in stdenv.mkDerivation rec {
5150
cmake
5251
which
5352
lsb-release
54-
zerokitPkg
53+
zerokitRln
5554
nim-unwrapped-2_0
5655
fakeGit
5756
fakeCargo
@@ -96,15 +95,20 @@ in stdenv.mkDerivation rec {
9695
cp -r ${callPackage ./csources.nix {}} csources_v2
9796
chmod 777 -R dist/nimble csources_v2
9897
popd
99-
mkdir -p vendor/zerokit/target/${androidArch}/release
100-
cp ${zerokitPkg}/librln.so vendor/zerokit/target/${androidArch}/release/
98+
cp -r ${zerokitRln}/target vendor/zerokit/
99+
find vendor/zerokit/target
100+
# TODO
101+
#cp vendor/zerokit/target/release/librln.a librln_v0.7.0.a
101102
'';
102103

103-
installPhase = ''
104+
installPhase = if abidir != null then ''
104105
mkdir -p $out/jni
105106
cp -r ./build/android/${abidir}/* $out/jni/
106107
echo '${androidManifest}' > $out/jni/AndroidManifest.xml
107108
cd $out && zip -r libwaku.aar *
109+
'' else ''
110+
mkdir -p $out/bin
111+
cp -r build/* $out/bin
108112
'';
109113

110114
meta = with pkgs.lib; {

0 commit comments

Comments
 (0)