zeroclaw: 0.8.0 -> 0.8.2 (#538435)
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
{
|
||||
lib,
|
||||
callPackage,
|
||||
rustPlatform,
|
||||
fetchFromGitHub,
|
||||
fetchNpmDeps,
|
||||
npmHooks,
|
||||
nodejs,
|
||||
pkg-config,
|
||||
protobuf,
|
||||
sqlite,
|
||||
@@ -11,38 +13,55 @@
|
||||
versionCheckHook,
|
||||
nix-update-script,
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "zeroclaw";
|
||||
version = "0.8.0";
|
||||
version = "0.8.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "zeroclaw-labs";
|
||||
repo = "zeroclaw";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-dB/M5QdAyql/WXxwkX9V/bkiRsAv0J+tIbQN0wKLJpM=";
|
||||
hash = "sha256-mTH7DRaCHmYw3m9DguceP+nGGMYff7vsoIe3J0XNb/Q=";
|
||||
};
|
||||
|
||||
postPatch =
|
||||
let
|
||||
zeroclaw-web = callPackage ./zeroclaw-web { inherit (finalAttrs) src version; };
|
||||
in
|
||||
''
|
||||
mkdir -p web
|
||||
ln -s ${zeroclaw-web} web/dist
|
||||
'';
|
||||
cargoHash = "sha256-6tLLt8cblYABOTli1LrrWbyTOJYGmmewHJgTxBAhJlE=";
|
||||
|
||||
cargoHash = "sha256-ZBmz877jEkTGopa5QxNUguxxKO45aZ6K5GXXAv4Ii4s=";
|
||||
npmDeps = fetchNpmDeps {
|
||||
inherit (finalAttrs) src;
|
||||
sourceRoot = "${finalAttrs.src.name}/web";
|
||||
hash = "sha256-SKltlDJm39ZzVaEt1bbnoiXy+wlbq+fC3bO4mW5V15o=";
|
||||
};
|
||||
npmRoot = "web";
|
||||
|
||||
postPatch = ''
|
||||
# build.rs runs `npm ci && npm run build` during compilation,
|
||||
# skip and handle it ourselves in postBuild
|
||||
substituteInPlace crates/zeroclaw-gateway/build.rs \
|
||||
--replace-fail 'build_web_dashboard();' '// dashboard built via postBuild'
|
||||
|
||||
# upstream hardcodes a Debian cross toolchain name that doesn't exist in the Nix sandbox
|
||||
substituteInPlace .cargo/config.toml \
|
||||
--replace-fail 'linker = "aarch64-linux-gnu-gcc"' ""
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
protobuf
|
||||
nodejs
|
||||
npmHooks.npmConfigHook
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
sqlite
|
||||
];
|
||||
|
||||
postBuild = ''
|
||||
cargo run --frozen --release --package xtask --bin web -- gen-api
|
||||
pushd web
|
||||
npm run build
|
||||
popd
|
||||
'';
|
||||
|
||||
nativeCheckInputs = [
|
||||
writableTmpDirAsHomeHook
|
||||
gitMinimal
|
||||
@@ -55,19 +74,17 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||
"--skip=commands::update::tests::download_binary_verifies_checksum_before_writing"
|
||||
"--skip=tests::exchange_pairing_code_posts_code_and_returns_token"
|
||||
"--skip=tests::fetch_pairing_code_reads_gateway_pair_code_response"
|
||||
"--skip=tests::gateway_addr_in_use_message_skips_occupied_restart_hint_port"
|
||||
"--skip=tests::gateway_restart_hint_uses_gateway_bind_fallback_for_hostnames"
|
||||
"--skip=integration::telegram_attachment_fallback::"
|
||||
"--skip=integration::telegram_finalize_draft::"
|
||||
];
|
||||
|
||||
# The gateway serves the web dashboard from <binary_dir>/web/dist at runtime
|
||||
postInstall =
|
||||
let
|
||||
zeroclaw-web = callPackage ./zeroclaw-web { inherit (finalAttrs) src version; };
|
||||
in
|
||||
''
|
||||
mkdir -p $out/bin/web
|
||||
ln -s ${zeroclaw-web} $out/bin/web/dist
|
||||
'';
|
||||
postInstall = ''
|
||||
mkdir -p $out/bin/web
|
||||
cp -r web/dist $out/bin/web/dist
|
||||
'';
|
||||
|
||||
doInstallCheck = true;
|
||||
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
{
|
||||
buildNpmPackage,
|
||||
src,
|
||||
version,
|
||||
...
|
||||
}:
|
||||
buildNpmPackage (finalAttrs: {
|
||||
pname = "zeroclaw-web";
|
||||
inherit src version;
|
||||
|
||||
sourceRoot = "${finalAttrs.src.name}/web";
|
||||
|
||||
npmDepsHash = "sha256-mwi93ZgXxb3xQnPPQHesR8YxQOxH8YaKBLGi/nEM8D4=";
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
cp -r dist $out
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
})
|
||||
Reference in New Issue
Block a user