This commit is contained in:
ziguana 2024-01-30 22:20:40 -07:00
commit 0e4e4b0979
19 changed files with 3185 additions and 0 deletions

30
pkgs/sfpi/default.nix Normal file
View file

@ -0,0 +1,30 @@
{ pkgs }:
rec {
sfpi = pkgs.stdenv.mkDerivation {
pname = "sfpi";
version = "master-01-30-24";
src = pkgs.fetchFromGitHub {
owner = "tenstorrent-metal";
repo = "sfpi";
rev = "aa4e71d";
hash = "sha256-JWSEDx7CCAfuhEhrmcrZunEwWdrsXl71pLJA4Fqme0s=";
};
postPatch = ''
ln -s ${tt-gcc} compiler
'';
buildPhase = ''
make -C tests all
'';
installPhase = ''
mkdir -p $out/compiler/libexec
bin/release.sh $out
'';
};
tt-gcc = import ./tt-gcc.nix { inherit pkgs; };
}

57
pkgs/sfpi/tt-gcc.nix Normal file
View file

@ -0,0 +1,57 @@
{ pkgs }:
pkgs.stdenv.mkDerivation rec {
pname = "tt-gcc";
version = "master-01-30-24";
src = pkgs.fetchFromGitHub {
owner = "tenstorrent-metal";
repo = "sfpi-tt-gcc";
rev = "94a51a7";
# this takes a while and we don't need all of them
fetchSubmodules = true;
leaveDotGit = true;
hash = "sha256-VliX4Npw8FqTq3vmdsDFRThXFfDgaTomJ+egCEyhOyU=";
};
nativeBuildInputs = with pkgs; [
python3
util-linux
git
cacert
autoconf
automake
curl
gawk
bison
flex
texinfo
gperf
bc
];
buildInputs = with pkgs; [
libmpc
mpfr
gmp
zlib
expat
];
configureFlags = [
"-disable-multilib"
"-with-abi=ilp32"
"-with-arch=rv32i"
"--prefix=${placeholder "out"}"
];
hardeningDisable = [
"format"
];
enableParallelBuilding = true;
# this is an absolute travesty, but i'm not about to
# properly repackage all of riscv-gnu-toolchain
__noChroot = true;
}