tt-flake/pkgs/sfpi/default.nix

59 lines
1.1 KiB
Nix
Raw Normal View History

2024-01-31 05:20:40 +00:00
{ pkgs }:
rec {
sfpi = pkgs.stdenv.mkDerivation {
pname = "sfpi";
2024-11-20 20:19:43 +00:00
version = "unstable-2024-09-25";
2024-01-31 05:20:40 +00:00
src = pkgs.fetchFromGitHub {
owner = "tenstorrent-metal";
repo = "sfpi";
2024-11-20 20:19:43 +00:00
# One commit before they started to use gcc 12
rev = "08d39202f283ab9122e162bcead5b7c90014fa86";
hash = "sha256-EZHUhAqn9/r02IC+TVoxfIyzEctYQKd5azcrXE5DIgg=";
2024-01-31 05:20:40 +00:00
};
postPatch = ''
ln -s ${tt-gcc} compiler
'';
buildPhase = ''
make -C tests all
'';
installPhase = ''
mkdir -p $out/compiler/libexec
bin/release.sh $out
'';
};
prebuilt = pkgs.stdenv.mkDerivation rec {
pname = "tt-gcc";
version = "5.0.0";
src = pkgs.fetchzip {
url = "https://github.com/tenstorrent/sfpi/releases/download/v5.0.0/sfpi-release.tgz";
hash = "sha256-RBhJ6BWmvB06zWoELTumpzroHDMpNXU0/WC6elgAkW0=";
};
nativeBuildInputs = with pkgs; [
autoPatchelfHook
];
buildInputs = with pkgs; [
libmpc
mpfr
gmp
zlib
expat
];
installPhase = ''
cp -r . $out
'';
};
2024-01-31 05:20:40 +00:00
tt-gcc = import ./tt-gcc.nix { inherit pkgs; };
}