nixpkgs/pkgs/development/tools/trellis/default.nix
Austin Seipp bf094b11b8
trellis: 2020.07.27 -> 2020.11.07
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2020-11-12 15:23:03 -06:00

66 lines
1.9 KiB
Nix

{ stdenv, fetchFromGitHub
, python3, boost
, cmake
}:
let
boostWithPython3 = boost.override { python = python3; enablePython = true; };
in
stdenv.mkDerivation rec {
pname = "trellis";
version = "2020.11.07";
# git describe --tags
realVersion = with stdenv.lib; with builtins;
"1.0-469-g${substring 0 7 (elemAt srcs 0).rev}";
srcs = [
(fetchFromGitHub {
owner = "SymbiFlow";
repo = "prjtrellis";
rev = "b013a135a9b95c18ece559e19aa73ad6c84446c9";
sha256 = "09bx30jm9bgdxmbxf49a27spg4yd1nk5r5mympq7xi28hq1xwjnf";
name = "trellis";
})
(fetchFromGitHub {
owner = "SymbiFlow";
repo = "prjtrellis-db";
rev = "2cf058e7a3ba36134d21e34823e9b2ecaaceac2c";
sha256 = "1hjaw5jkwiaiznm2z0smy88m2cdz63cd51z4nibajfih7ikvkj6g";
name = "trellis-database";
})
];
sourceRoot = "trellis";
buildInputs = [ boostWithPython3 ];
nativeBuildInputs = [ cmake python3 ];
cmakeFlags = [
"-DCURRENT_GIT_VERSION=${realVersion}"
# TODO: should this be in stdenv instead?
"-DCMAKE_INSTALL_DATADIR=${placeholder "out"}/share"
];
enableParallelBuilding = true;
preConfigure = with builtins; ''
rmdir database && ln -sfv ${elemAt srcs 1} ./database
source environment.sh
cd libtrellis
'';
meta = with stdenv.lib; {
description = "Documentation and bitstream tools for Lattice ECP5 FPGAs";
longDescription = ''
Project Trellis documents the Lattice ECP5 architecture
to enable development of open-source tools. Its goal is
to provide sufficient information to develop a free and
open Verilog to bitstream toolchain for these devices.
'';
homepage = "https://github.com/SymbiFlow/prjtrellis";
license = stdenv.lib.licenses.isc;
maintainers = with maintainers; [ q3k thoughtpolice emily ];
platforms = stdenv.lib.platforms.all;
};
}