From 28948a13cab7eb358b18db5e5d30e03f0add1dca Mon Sep 17 00:00:00 2001 From: Luiz Irber Date: Wed, 29 Mar 2023 18:52:30 -0700 Subject: [PATCH] flake cleanup --- flake.lock | 39 +++++++++------------------------------ flake.nix | 32 ++++++++------------------------ 2 files changed, 17 insertions(+), 54 deletions(-) diff --git a/flake.lock b/flake.lock index 3c65bd275c..f800a8b4f7 100644 --- a/flake.lock +++ b/flake.lock @@ -1,32 +1,12 @@ { "nodes": { - "naersk": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1671096816, - "narHash": "sha256-ezQCsNgmpUHdZANDCILm3RvtO1xH8uujk/+EqNvzIOg=", - "owner": "nix-community", - "repo": "naersk", - "rev": "d998160d6a076cfe8f9741e56aeec7e267e3e114", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "naersk", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1677852945, - "narHash": "sha256-liiVJjkBTuBTAkRW3hrI8MbPD2ImYzwUpa7kvteiKhM=", + "lastModified": 1679198465, + "narHash": "sha256-VfXpHpniNWgg7pBzxb20pRX7kqn80LApPDQYTReiFCw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f5ffd5787786dde3a8bf648c7a1b5f78c4e01abb", + "rev": "5a05160f7671434e1c833b1b01284b876e04eca4", "type": "github" }, "original": { @@ -38,7 +18,6 @@ }, "root": { "inputs": { - "naersk": "naersk", "nixpkgs": "nixpkgs", "rust-overlay": "rust-overlay", "utils": "utils" @@ -54,11 +33,11 @@ ] }, "locked": { - "lastModified": 1677983714, - "narHash": "sha256-2A5uDpF0vN4w9tvo5N+918bK0yRYfg4FdNZ/qccgH6s=", + "lastModified": 1679192997, + "narHash": "sha256-OZxPSyEDJTy4IATwFxUGDEEUYL6ZkgKn2FhlRlcLE08=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "1a9f6285d441ff438a6a1422dc3fde109d8615bf", + "rev": "32e4b1bf80cf99b7c72d2892198d40558828e6a1", "type": "github" }, "original": { @@ -69,11 +48,11 @@ }, "utils": { "locked": { - "lastModified": 1676283394, - "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=", + "lastModified": 1678901627, + "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", "owner": "numtide", "repo": "flake-utils", - "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073", + "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 8f0b6ea7e5..593050d34f 100644 --- a/flake.nix +++ b/flake.nix @@ -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) ]; @@ -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; @@ -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 { @@ -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 ]; @@ -93,9 +85,7 @@ defaultPackage = self.packages.${system}.sourmash; devShell = mkShell { - nativeBuildInputs = [ - clang_13 - ]; + nativeBuildInputs = [ rustPlatform.bindgenHook ]; buildInputs = [ rustPlatform.rust.cargo @@ -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";