Files
nixpkgs/pkgs/by-name/cx/cxx-rs/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

64 lines
1.1 KiB
Nix

{
cxx-rs,
fetchFromGitHub,
lib,
rustPlatform,
testers,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "cxx-rs";
version = "1.0.175";
src = fetchFromGitHub {
owner = "dtolnay";
repo = "cxx";
tag = finalAttrs.version;
sha256 = "sha256-haAcBBI5ol+gcqKzasyHU43ewGA0L4FlL4o1QlJJukc=";
};
cargoLock.lockFile = ./Cargo.lock;
postPatch = ''
cp ${./Cargo.lock} Cargo.lock
'';
cargoBuildFlags = [
"--workspace"
"--exclude=demo"
];
postBuild = ''
cargo doc --release
'';
cargoTestFlags = [ "--workspace" ];
outputs = [
"out"
"doc"
"dev"
];
postInstall = ''
mkdir -p $doc
cp -r ./target/doc/* $doc
mkdir -p $dev/include/rust
install -D -m 0644 ./include/cxx.h $dev/include/rust
'';
passthru.tests.version = testers.testVersion {
package = cxx-rs;
command = "cxxbridge --version";
};
meta = with lib; {
description = "Safe FFI between Rust and C++";
mainProgram = "cxxbridge";
homepage = "https://github.com/dtolnay/cxx";
license = licenses.mit;
maintainers = with maintainers; [ centromere ];
};
})