mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-02 14:03:06 +00:00
nix: add wakucanary Flake package (#3599)
Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
e54851d9d6
commit
31e1a81552
1
Makefile
1
Makefile
@ -543,4 +543,3 @@ release-notes:
|
|||||||
sed -E 's@#([0-9]+)@[#\1](https://github.com/waku-org/nwaku/issues/\1)@g'
|
sed -E 's@#([0-9]+)@[#\1](https://github.com/waku-org/nwaku/issues/\1)@g'
|
||||||
# I could not get the tool to replace issue ids with links, so using sed for now,
|
# I could not get the tool to replace issue ids with links, so using sed for now,
|
||||||
# asked here: https://github.com/bvieira/sv4git/discussions/101
|
# asked here: https://github.com/bvieira/sv4git/discussions/101
|
||||||
|
|
||||||
|
|||||||
32
flake.lock
generated
32
flake.lock
generated
@ -22,24 +22,46 @@
|
|||||||
"zerokit": "zerokit"
|
"zerokit": "zerokit"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"zerokit": {
|
"rust-overlay": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
"zerokit",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1743756626,
|
"lastModified": 1748399823,
|
||||||
"narHash": "sha256-SvhfEl0bJcRsCd79jYvZbxQecGV2aT+TXjJ57WVv7Aw=",
|
"narHash": "sha256-kahD8D5hOXOsGbNdoLLnqCL887cjHkx98Izc37nDjlA=",
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"rev": "d68a69dc71bc19beb3479800392112c2f6218159",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zerokit": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"rust-overlay": "rust-overlay"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1749115386,
|
||||||
|
"narHash": "sha256-UexIE2D7zr6aRajwnKongXwCZCeRZDXOL0kfjhqUFSU=",
|
||||||
"owner": "vacp2p",
|
"owner": "vacp2p",
|
||||||
"repo": "zerokit",
|
"repo": "zerokit",
|
||||||
"rev": "c60e0c33fc6350a4b1c20e6b6727c44317129582",
|
"rev": "dc0b31752c91e7b4fefc441cfa6a8210ad7dba7b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "vacp2p",
|
"owner": "vacp2p",
|
||||||
"repo": "zerokit",
|
"repo": "zerokit",
|
||||||
"rev": "c60e0c33fc6350a4b1c20e6b6727c44317129582",
|
"rev": "dc0b31752c91e7b4fefc441cfa6a8210ad7dba7b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
13
flake.nix
13
flake.nix
@ -9,7 +9,7 @@
|
|||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs?rev=f44bd8ca21e026135061a0a57dcf3d0775b67a49";
|
nixpkgs.url = "github:NixOS/nixpkgs?rev=f44bd8ca21e026135061a0a57dcf3d0775b67a49";
|
||||||
zerokit = {
|
zerokit = {
|
||||||
url = "github:vacp2p/zerokit?rev=c60e0c33fc6350a4b1c20e6b6727c44317129582";
|
url = "github:vacp2p/zerokit?rev=dc0b31752c91e7b4fefc441cfa6a8210ad7dba7b";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -50,10 +50,17 @@
|
|||||||
inherit stableSystems;
|
inherit stableSystems;
|
||||||
src = self;
|
src = self;
|
||||||
targets = ["libwaku-android-arm64"];
|
targets = ["libwaku-android-arm64"];
|
||||||
androidArch = "aarch64-linux-android";
|
|
||||||
abidir = "arm64-v8a";
|
abidir = "arm64-v8a";
|
||||||
zerokitPkg = zerokit.packages.${system}.zerokit-android-arm64;
|
zerokitRln = zerokit.packages.${system}.rln-android-arm64;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
wakucanary = pkgs.callPackage ./nix/default.nix {
|
||||||
|
inherit stableSystems;
|
||||||
|
src = self;
|
||||||
|
targets = ["wakucanary"];
|
||||||
|
zerokitRln = zerokit.packages.${system}.rln;
|
||||||
|
};
|
||||||
|
|
||||||
default = libwaku-android-arm64;
|
default = libwaku-android-arm64;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1,12 +0,0 @@
|
|||||||
{ pkgs ? import <nixpkgs> { } }:
|
|
||||||
|
|
||||||
let
|
|
||||||
tools = pkgs.callPackage ./tools.nix {};
|
|
||||||
sourceFile = ../vendor/nimbus-build-system/vendor/Nim/koch.nim;
|
|
||||||
in pkgs.fetchFromGitHub {
|
|
||||||
owner = "nim-lang";
|
|
||||||
repo = "atlas";
|
|
||||||
rev = tools.findKeyValue "^ +AtlasStableCommit = \"([a-f0-9]+)\"$" sourceFile;
|
|
||||||
# WARNING: Requires manual updates when Nim compiler version changes.
|
|
||||||
hash = "sha256-G1TZdgbRPSgxXZ3VsBP2+XFCLHXVb3an65MuQx67o/k=";
|
|
||||||
}
|
|
||||||
@ -6,7 +6,7 @@ let
|
|||||||
in pkgs.fetchFromGitHub {
|
in pkgs.fetchFromGitHub {
|
||||||
owner = "nim-lang";
|
owner = "nim-lang";
|
||||||
repo = "checksums";
|
repo = "checksums";
|
||||||
rev = tools.findKeyValue "^ +ChecksumsStableCommit = \"([a-f0-9]+)\"$" sourceFile;
|
rev = tools.findKeyValue "^ +ChecksumsStableCommit = \"([a-f0-9]+)\".*$" sourceFile;
|
||||||
# WARNING: Requires manual updates when Nim compiler version changes.
|
# WARNING: Requires manual updates when Nim compiler version changes.
|
||||||
hash = "sha256-Bm5iJoT2kAvcTexiLMFBa9oU5gf7d4rWjo3OiN7obWQ=";
|
hash = "sha256-Bm5iJoT2kAvcTexiLMFBa9oU5gf7d4rWjo3OiN7obWQ=";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,9 +9,8 @@
|
|||||||
stableSystems ? [
|
stableSystems ? [
|
||||||
"x86_64-linux" "aarch64-linux"
|
"x86_64-linux" "aarch64-linux"
|
||||||
],
|
],
|
||||||
androidArch,
|
abidir ? null,
|
||||||
abidir,
|
zerokitRln,
|
||||||
zerokitPkg,
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert pkgs.lib.assertMsg ((src.submodules or true) == true)
|
assert pkgs.lib.assertMsg ((src.submodules or true) == true)
|
||||||
@ -51,7 +50,7 @@ in stdenv.mkDerivation rec {
|
|||||||
cmake
|
cmake
|
||||||
which
|
which
|
||||||
lsb-release
|
lsb-release
|
||||||
zerokitPkg
|
zerokitRln
|
||||||
nim-unwrapped-2_0
|
nim-unwrapped-2_0
|
||||||
fakeGit
|
fakeGit
|
||||||
fakeCargo
|
fakeCargo
|
||||||
@ -84,27 +83,24 @@ in stdenv.mkDerivation rec {
|
|||||||
pushd vendor/nimbus-build-system/vendor/Nim
|
pushd vendor/nimbus-build-system/vendor/Nim
|
||||||
mkdir dist
|
mkdir dist
|
||||||
cp -r ${callPackage ./nimble.nix {}} dist/nimble
|
cp -r ${callPackage ./nimble.nix {}} dist/nimble
|
||||||
chmod 777 -R dist/nimble
|
cp -r ${callPackage ./checksums.nix {}} dist/checksums
|
||||||
mkdir -p dist/nimble/dist
|
|
||||||
cp -r ${callPackage ./checksums.nix {}} dist/checksums # need both
|
|
||||||
cp -r ${callPackage ./checksums.nix {}} dist/nimble/dist/checksums
|
|
||||||
cp -r ${callPackage ./atlas.nix {}} dist/atlas
|
|
||||||
chmod 777 -R dist/atlas
|
|
||||||
mkdir dist/atlas/dist
|
|
||||||
cp -r ${callPackage ./sat.nix {}} dist/nimble/dist/sat
|
|
||||||
cp -r ${callPackage ./sat.nix {}} dist/atlas/dist/sat
|
|
||||||
cp -r ${callPackage ./csources.nix {}} csources_v2
|
cp -r ${callPackage ./csources.nix {}} csources_v2
|
||||||
chmod 777 -R dist/nimble csources_v2
|
chmod 777 -R dist/nimble csources_v2
|
||||||
popd
|
popd
|
||||||
mkdir -p vendor/zerokit/target/${androidArch}/release
|
cp -r ${zerokitRln}/target vendor/zerokit/
|
||||||
cp ${zerokitPkg}/librln.so vendor/zerokit/target/${androidArch}/release/
|
find vendor/zerokit/target
|
||||||
|
# FIXME
|
||||||
|
cp vendor/zerokit/target/*/release/librln.a librln_v${zerokitRln.version}.a
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = if abidir != null then ''
|
||||||
mkdir -p $out/jni
|
mkdir -p $out/jni
|
||||||
cp -r ./build/android/${abidir}/* $out/jni/
|
cp -r ./build/android/${abidir}/* $out/jni/
|
||||||
echo '${androidManifest}' > $out/jni/AndroidManifest.xml
|
echo '${androidManifest}' > $out/jni/AndroidManifest.xml
|
||||||
cd $out && zip -r libwaku.aar *
|
cd $out && zip -r libwaku.aar *
|
||||||
|
'' else ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
cp -r build/* $out/bin
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with pkgs.lib; {
|
meta = with pkgs.lib; {
|
||||||
|
|||||||
@ -6,7 +6,7 @@ let
|
|||||||
in pkgs.fetchFromGitHub {
|
in pkgs.fetchFromGitHub {
|
||||||
owner = "nim-lang";
|
owner = "nim-lang";
|
||||||
repo = "nimble";
|
repo = "nimble";
|
||||||
rev = tools.findKeyValue "^ +NimbleStableCommit = \"([a-f0-9]+)\".+" sourceFile;
|
rev = tools.findKeyValue "^ +NimbleStableCommit = \"([a-f0-9]+)\".*$" sourceFile;
|
||||||
# WARNING: Requires manual updates when Nim compiler version changes.
|
# WARNING: Requires manual updates when Nim compiler version changes.
|
||||||
hash = "sha256-MVHf19UbOWk8Zba2scj06PxdYYOJA6OXrVyDQ9Ku6Us=";
|
hash = "sha256-MVHf19UbOWk8Zba2scj06PxdYYOJA6OXrVyDQ9Ku6Us=";
|
||||||
}
|
}
|
||||||
@ -6,7 +6,8 @@ let
|
|||||||
in pkgs.fetchFromGitHub {
|
in pkgs.fetchFromGitHub {
|
||||||
owner = "nim-lang";
|
owner = "nim-lang";
|
||||||
repo = "sat";
|
repo = "sat";
|
||||||
rev = tools.findKeyValue "^ +SatStableCommit = \"([a-f0-9]+)\"$" sourceFile;
|
rev = tools.findKeyValue "^ +SatStableCommit = \"([a-f0-9]+)\".*$" sourceFile;
|
||||||
|
# WARNING: Requires manual updates when Nim compiler version changes.
|
||||||
# WARNING: Requires manual updates when Nim compiler version changes.
|
# WARNING: Requires manual updates when Nim compiler version changes.
|
||||||
hash = "sha256-JFrrSV+mehG0gP7NiQ8hYthL0cjh44HNbXfuxQNhq7c=";
|
hash = "sha256-JFrrSV+mehG0gP7NiQ8hYthL0cjh44HNbXfuxQNhq7c=";
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user