2019-01-08 22:56:16 +00:00
|
|
|
{ stdenv, fetchFromGitHub
|
|
|
|
, python3, boost
|
|
|
|
, cmake
|
|
|
|
}:
|
2018-08-02 09:18:47 +01:00
|
|
|
|
|
|
|
let
|
2019-01-08 22:56:16 +00:00
|
|
|
boostWithPython3 = boost.override { python = python3; enablePython = true; };
|
2018-08-02 09:18:47 +01:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-14 00:39:13 +01:00
|
|
|
pname = "trellis";
|
2020-08-23 16:39:18 +01:00
|
|
|
version = "2020.07.27";
|
2020-03-25 11:45:57 +00:00
|
|
|
|
2019-09-27 15:06:56 +01:00
|
|
|
# git describe --tags
|
2019-08-31 15:04:42 +01:00
|
|
|
realVersion = with stdenv.lib; with builtins;
|
2020-08-23 16:39:18 +01:00
|
|
|
"1.0-182-g${substring 0 7 (elemAt srcs 0).rev}";
|
2018-08-02 09:18:47 +01:00
|
|
|
|
2019-01-08 22:56:16 +00:00
|
|
|
srcs = [
|
|
|
|
(fetchFromGitHub {
|
2019-10-13 17:28:14 +01:00
|
|
|
owner = "SymbiFlow";
|
2019-01-08 22:56:16 +00:00
|
|
|
repo = "prjtrellis";
|
2020-08-23 16:39:18 +01:00
|
|
|
rev = "8c0a6382e11b160ed88d17af8493c12a897617ed";
|
|
|
|
sha256 = "1g0ppjfw8dq5cg5kl2p1p87grb0i88apaim4f5b6wj4sfqz8iln8";
|
2019-01-08 22:56:16 +00:00
|
|
|
name = "trellis";
|
|
|
|
})
|
2020-03-25 11:45:57 +00:00
|
|
|
|
2019-01-08 22:56:16 +00:00
|
|
|
(fetchFromGitHub {
|
2019-10-13 17:28:14 +01:00
|
|
|
owner = "SymbiFlow";
|
2019-01-08 22:56:16 +00:00
|
|
|
repo = "prjtrellis-db";
|
2020-03-25 11:45:57 +00:00
|
|
|
rev = "c137076fdd8bfca3d2bf9cdacda9983dbbec599a";
|
|
|
|
sha256 = "1br0vw8wwcn2qhs8kxkis5xqlr2nw7r3mf1qwjp8xckd6fa1wlcw";
|
2019-10-13 17:28:14 +01:00
|
|
|
name = "trellis-database";
|
2019-01-08 22:56:16 +00:00
|
|
|
})
|
2018-08-02 09:18:47 +01:00
|
|
|
];
|
2019-01-08 22:56:16 +00:00
|
|
|
sourceRoot = "trellis";
|
2018-08-02 09:18:47 +01:00
|
|
|
|
2019-01-08 22:56:16 +00:00
|
|
|
buildInputs = [ boostWithPython3 ];
|
|
|
|
nativeBuildInputs = [ cmake python3 ];
|
2020-02-08 15:32:03 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DCURRENT_GIT_VERSION=${realVersion}"
|
|
|
|
# TODO: should this be in stdenv instead?
|
|
|
|
"-DCMAKE_INSTALL_DATADIR=${placeholder "out"}/share"
|
|
|
|
];
|
|
|
|
enableParallelBuilding = true;
|
2018-08-02 09:18:47 +01:00
|
|
|
|
2019-01-08 22:56:16 +00:00
|
|
|
preConfigure = with builtins; ''
|
|
|
|
rmdir database && ln -sfv ${elemAt srcs 1} ./database
|
2018-08-02 09:18:47 +01:00
|
|
|
|
|
|
|
source environment.sh
|
|
|
|
cd libtrellis
|
|
|
|
'';
|
|
|
|
|
2019-01-08 22:56:16 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Documentation and bitstream tools for Lattice ECP5 FPGAs";
|
2018-08-02 09:18:47 +01:00
|
|
|
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.
|
|
|
|
'';
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/SymbiFlow/prjtrellis";
|
2019-01-08 22:56:16 +00:00
|
|
|
license = stdenv.lib.licenses.isc;
|
2019-08-20 06:02:29 +01:00
|
|
|
maintainers = with maintainers; [ q3k thoughtpolice emily ];
|
|
|
|
platforms = stdenv.lib.platforms.all;
|
2018-08-02 09:18:47 +01:00
|
|
|
};
|
|
|
|
}
|