Skip to content

Commit

Permalink
flake cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
luizirber committed Mar 30, 2023
1 parent 25099e6 commit 28948a1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 54 deletions.
39 changes: 9 additions & 30 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 8 additions & 24 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,9 @@
flake-utils.follows = "utils";
};
};

naersk = {
url = "github:nix-community/naersk";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
};

outputs = { self, nixpkgs, naersk, rust-overlay, utils }:
outputs = { self, nixpkgs, rust-overlay, utils }:
utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
Expand All @@ -36,10 +29,6 @@
cargo = rustVersion;
rustc = rustVersion;
};
naersk-lib = naersk.lib."${system}".override {
cargo = rustPlatform.rust.cargo;
rustc = rustPlatform.rust.rustc;
};

python = pkgs.python310Packages;

Expand All @@ -49,10 +38,13 @@
{
packages = {

lib = naersk-lib.buildPackage {
lib = rustPlatform.buildRustPackage {
name = "libsourmash";
pname = "libsourmash";
root = ./.;
src = lib.cleanSource ./.;
copyLibs = true;
cargoLock.lockFile = ./Cargo.lock;
nativeBuildInputs = with rustPlatform; [ bindgenHook ];
};

sourmash = python.buildPythonPackage rec {
Expand All @@ -66,7 +58,7 @@
lockFile = ./Cargo.lock;
};

nativeBuildInputs = with rustPlatform; [ cargoSetupHook maturinBuildHook ];
nativeBuildInputs = with rustPlatform; [ cargoSetupHook maturinBuildHook bindgenHook ];

buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
propagatedBuildInputs = with python; [ cffi deprecation cachetools bitstring numpy scipy matplotlib screed ];
Expand All @@ -93,9 +85,7 @@
defaultPackage = self.packages.${system}.sourmash;

devShell = mkShell {
nativeBuildInputs = [
clang_13
];
nativeBuildInputs = [ rustPlatform.bindgenHook ];

buildInputs = [
rustPlatform.rust.cargo
Expand Down Expand Up @@ -124,14 +114,8 @@
cargo-udeps
nixpkgs-fmt
cargo-deny

llvmPackages_13.libclang
llvmPackages_13.libcxxClang
];

BINDGEN_EXTRA_CLANG_ARGS = "-isystem ${llvmPackages_13.libclang.lib}/lib/clang/${lib.getVersion clang}/include";
LIBCLANG_PATH = "${llvmPackages_13.libclang.lib}/lib";

# Needed for matplotlib
LD_LIBRARY_PATH = "${stdenv.cc.cc.lib}/lib64:$LD_LIBRARY_PATH";

Expand Down

0 comments on commit 28948a1

Please sign in to comment.