tt-flake/pkgs/luwen/default.nix

59 lines
1.2 KiB
Nix
Raw Normal View History

2024-01-31 05:20:40 +00:00
{ pkgs }:
let
# Upstream does not vendor a lock file so one has to created manually
# `cargo generate-lockfile`
# Use verson needed by tt-smi
# https://github.com/tenstorrent/tt-smi/blob/main/pyproject.toml#L30
version = "0.4.9";
src = pkgs.fetchFromGitHub {
owner = "tenstorrent";
repo = "luwen";
rev = "refs/tags/v${version}";
sha256 = "sha256-K68PjccE2fBkU4RvKv8X6jKRPYqsVhKB6jU92aajLgo=";
};
in
2024-01-31 05:20:40 +00:00
{
luwen = pkgs.rustPlatform.buildRustPackage rec {
pname = "luwen";
inherit version src;
2024-01-31 05:20:40 +00:00
postPatch = ''
2024-10-01 18:47:40 +00:00
ln -s ${./Cargo_0_2.lock} Cargo.lock
2024-01-31 05:20:40 +00:00
'';
2024-10-01 18:47:40 +00:00
cargoLock.lockFile = ./Cargo_0_2.lock;
2024-01-31 05:20:40 +00:00
cargoHash = "";
};
pyluwen = pkgs.python3.pkgs.buildPythonPackage rec {
pname = "pyluwen";
inherit version src;
2024-01-31 05:20:40 +00:00
postPatch = ''
ln -s ${./Cargo_0_2.lock} Cargo.lock
'';
buildAndTestSubdir = "crates/pyluwen";
format = "pyproject";
2024-10-01 19:28:28 +00:00
cargoDeps = pkgs.rustPlatform.importCargoLock {
lockFile = ./Cargo_0_2.lock;
2024-01-31 05:20:40 +00:00
};
nativeBuildInputs = [
pkgs.rustPlatform.cargoSetupHook
pkgs.rustPlatform.maturinBuildHook
];
pythonImportsCheck = [
"pyluwen"
];
};
}