mirror of
https://github.com/logos-messaging/logos-chat.git
synced 2026-03-07 16:03:07 +00:00
35 lines
1017 B
Nix
35 lines
1017 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";
|
||
|
|
# Add outputHashes here for any git/non-registry deps that appear in
|
||
|
|
# rust-bundle/Cargo.lock (run `nix build` once; it will report missing hashes).
|
||
|
|
outputHashes = {};
|
||
|
|
};
|
||
|
|
|
||
|
|
nativeBuildInputs = [ perl pkg-config cmake ];
|
||
|
|
doCheck = false;
|
||
|
|
|
||
|
|
buildAndTestSubdir = "rust-bundle";
|
||
|
|
|
||
|
|
installPhase = ''
|
||
|
|
runHook preInstall
|
||
|
|
mkdir -p $out/lib
|
||
|
|
cp rust-bundle/target/*/release/lib_rust_bundle.a $out/lib/ 2>/dev/null || true
|
||
|
|
cp rust-bundle/target/release/lib_rust_bundle.a $out/lib/ 2>/dev/null || true
|
||
|
|
runHook postInstall
|
||
|
|
'';
|
||
|
|
}
|