From bd25053bf28eab9423844438c6b4ec9ad1aea2ab Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Wed, 24 Apr 2024 14:48:20 +0200 Subject: [PATCH] build: Start defining the Python package --- flake.nix | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index f5c9b1fb..94631836 100644 --- a/flake.nix +++ b/flake.nix @@ -74,7 +74,25 @@ } ); # TODO: build with maturin - py = null; + py = + (craneLib.buildPackage (commonArgs + // { + pname = "pineappl-py"; + inherit cargoArtifacts; + })) + .overrideAttrs (old: { + nativeBuildInputs = old.nativeBuildInputs ++ [pkgs.maturin]; + buildPhase = + old.buildPhase + + '' + maturin build --offline --target-dir ./target + ''; + installPhase = + old.installPhase + + '' + cp target/wheels/pineappl $out/ + ''; + }); in { packages = {