logos-chat/nix/bundle.nix
osmaczko f9331976d4
wip
2026-02-27 19:42:40 +01:00

35 lines
898 B
Nix

{ lib, stdenv, rust-bin, makeRustPlatform, perl, pkg-config, cmake, src }:
let
rustToolchain = rust-bin.fromRustupToolchainFile (src + "/vendor/libchat/rust_toolchain.toml");
rPlatform = makeRustPlatform {
cargo = rustToolchain;
rustc = rustToolchain;
};
in rPlatform.buildRustPackage {
pname = "rust-bundle";
version = "0.1.0";
inherit src;
cargoRoot = "rust-bundle";
cargoLock = {
lockFile = src + "/rust-bundle/Cargo.lock";
outputHashes = {
"chat-proto-0.1.0" = "sha256-aCl80VOIkd/GK3gnmRuFoSAvPBfeE/FKCaNlLt5AbUU=";
};
};
nativeBuildInputs = [ perl pkg-config cmake ];
doCheck = false;
buildAndTestSubdir = "rust-bundle";
installPhase = ''
runHook preInstall
mkdir -p $out/lib
find . -name "librust_bundle.a" -path "*/release/*" -exec cp {} $out/lib/ \;
test -f $out/lib/librust_bundle.a
runHook postInstall
'';
}