diff options
author | Daniel Hill <daniel@gluo.nz> | 2022-11-25 12:47:29 +1300 |
---|---|---|
committer | Daniel Hill <daniel@gluo.nz> | 2023-01-03 16:58:55 +1300 |
commit | 9a44c6d4d020035f25baf74b1f7986b3221a274e (patch) | |
tree | 5d40fc996aa15176c9f75e45fc738200f25eb27a /rust-src/bch_bindgen | |
parent | 9d6040c8b60d10f901141df9d739005f3fe0326e (diff) |
nix: overhaul build system.
Removed outdated overlay.
Simply build tooling using bingenHook and propagated*Inputs
Signed-off-by: Daniel Hill <daniel@gluo.nz>
Diffstat (limited to 'rust-src/bch_bindgen')
-rw-r--r-- | rust-src/bch_bindgen/default.nix | 83 |
1 files changed, 28 insertions, 55 deletions
diff --git a/rust-src/bch_bindgen/default.nix b/rust-src/bch_bindgen/default.nix index f6053d56..b7ad502a 100644 --- a/rust-src/bch_bindgen/default.nix +++ b/rust-src/bch_bindgen/default.nix @@ -4,73 +4,46 @@ , llvmPackages , bcachefs , pkg-config - , udev , liburcu , zstd , keyutils , libaio - -, lz4 # liblz4 +, lz4 # liblz4 , libsodium , libuuid -, zlib # zlib1g +, zlib # zlib1g , libscrypt - , rustfmt - , glibc , ... -}: let - include = { - glibc = "${glibc.dev}/include"; - clang = let libc = llvmPackages.libclang; in - "${libc.lib}/lib/clang/${libc.version}/include"; - urcu = "${liburcu}/include"; - zstd = "${zstd.dev}/include"; - }; - cargo = lib.trivial.importTOML ./Cargo.toml; -in rustPlatform.buildRustPackage { - pname = cargo.package.name; - version = cargo.package.version; - - src = builtins.path { path = ./.; name = "bch_bindgen"; }; +}: +let + cargo = lib.trivial.importTOML ./Cargo.toml; +in +rustPlatform.buildRustPackage { + pname = cargo.package.name; + version = cargo.package.version; + + src = builtins.path { + path = ./.; + name = "bch_bindgen"; + }; + + cargoLock = { lockFile = ./Cargo.lock; }; + + propagatedNativeBuildInputs = [ rustPlatform.bindgenHook ]; - cargoLock = { lockFile = ./Cargo.lock; }; + propagatedBuildInputs = [ + bcachefs.tools + ]; - nativeBuildInputs = [ rustfmt pkg-config ]; - buildInputs = [ - - # libaio - keyutils # libkeyutils - lz4 # liblz4 - libsodium - liburcu - libuuid - zstd # libzstd - zlib # zlib1g - udev - libscrypt - libaio - ]; - - LIBBCACHEFS_LIB ="${bcachefs.tools}/lib"; - LIBBCACHEFS_INCLUDE = bcachefs.tools.src; - LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; - BINDGEN_EXTRA_CLANG_ARGS = lib.replaceStrings ["\n" "\t"] [" " ""] '' - -std=gnu99 - -I${include.glibc} - -I${include.clang} - -I${include.urcu} - -I${include.zstd} - ''; + LIBBCACHEFS_LIB ="${bcachefs.tools}/lib"; + LIBBCACHEFS_INCLUDE = bcachefs.tools.src; - postPatch = '' - cp ${./Cargo.lock} Cargo.lock - ''; - + postPatch = '' + cp ${./Cargo.lock} Cargo.lock + ''; - doCheck = true; - - # NIX_DEBUG = 4; -}
\ No newline at end of file + doCheck = true; +} |