Skip to content

Commit 2a440a1

Browse files
committed
Fixes #33, #53.
Added tests for real crates depending on workspace_member = null.
1 parent 075fe14 commit 2a440a1

File tree

12 files changed

+3203
-798
lines changed

12 files changed

+3203
-798
lines changed

sample_projects/codegen/Cargo.nix

Lines changed: 996 additions & 0 deletions
Large diffs are not rendered by default.

sample_projects/rocksdb/Cargo.lock

Lines changed: 433 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sample_projects/rocksdb/Cargo.nix

Lines changed: 1727 additions & 0 deletions
Large diffs are not rendered by default.

sample_projects/rocksdb/Cargo.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[package]
2+
name = "rocksdb"
3+
version = "0.1.0"
4+
authors = ["Peter Kolloch <[email protected]>"]
5+
edition = "2018"
6+
7+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8+
9+
# https://github.com/kolloch/crate2nix/issues/33
10+
[dependencies.rocksdb]
11+
git = "https://github.com/rust-rocksdb/rust-rocksdb"
12+
rev = "bc8520a86e96c38f79caac0d09349a01cbd113e9"
13+
branch = "0.12.2"
14+
default-features = false
15+
features = ["lz4"]

sample_projects/rocksdb/default.nix

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{ pkgs ? import ../../nix/nixpkgs.nix { config = {}; }
2+
, generatedCargoNix ? ./Cargo.nix {}
3+
}:
4+
5+
let
6+
cargoNix = pkgs.callPackage generatedCargoNix {
7+
defaultCrateOverrides = {
8+
librocksdb-sys = attrs: {
9+
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang}/lib";
10+
buildInputs = with pkgs; [ clang ];
11+
};
12+
};
13+
};
14+
in
15+
cargoNix.rootCrate.build

sample_projects/rocksdb/src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
println!("Hello, world!");
3+
}

0 commit comments

Comments
 (0)