Skip to content

Commit

Permalink
test out reusing default package from nixpkgs
Browse files Browse the repository at this point in the history
  • Loading branch information
luizirber committed Dec 23, 2024
1 parent d299311 commit 7d2b9f2
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,11 @@

python = pkgs.python311Packages;

stdenv = if pkgs.stdenv.isDarwin then pkgs.overrideSDK pkgs.stdenv "11.0" else pkgs.stdenv;
stdenv = if pkgs.stdenv.isDarwin then pkgs.overrideSDK pkgs.stdenv { darwinMinVersion = "10.14"; } else pkgs.stdenv;

commonArgs = {
src = ./.;
stdenv = stdenv;
preConfigure = lib.optionalString stdenv.isDarwin ''
export MACOSX_DEPLOYMENT_TARGET=10.14
'';

buildInputs = lib.optionals stdenv.isDarwin [ pkgs.libiconv pkgs.darwin.apple_sdk.frameworks.Security ];

Expand All @@ -57,21 +54,16 @@
name = "libsourmash";
copyLibs = true;
cargoLock.lockFile = ./Cargo.lock;
nativeBuildInputs = with rustPlatform; [ bindgenHook ];
});

sourmash = python.buildPythonPackage ( commonArgs // rec {
pname = "sourmash";
version = "4.8.12";
format = "pyproject";
sourmash = python.sourmash.overrideAttrs (oldAttrs: commonArgs // rec {
version = "4.8.12-dev";

src = ./.;

cargoDeps = rustPlatform.importCargoLock {
lockFile = ./Cargo.lock;
};

propagatedBuildInputs = with python; [ cffi deprecation cachetools bitstring numpy scipy matplotlib screed ];

DYLD_LIBRARY_PATH = "${self.packages.${system}.lib}/lib";
});

docker =
Expand Down Expand Up @@ -128,10 +120,6 @@
nixpkgs-fmt
];

shellHook = ''
export MACOSX_DEPLOYMENT_TARGET=10.14
'';

# Needed for matplotlib
LD_LIBRARY_PATH = lib.makeLibraryPath [ pkgs.stdenv.cc.cc.lib ];

Expand Down

0 comments on commit 7d2b9f2

Please sign in to comment.