2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
2019-01-08 23:56:16 +01:00
|
|
|
, python3, boost
|
|
|
|
, cmake
|
|
|
|
}:
|
2018-08-02 10:18:47 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-14 01:39:13 +02:00
|
|
|
pname = "trellis";
|
2021-01-03 11:53:21 +01:00
|
|
|
version = "2021.01.02";
|
2020-03-25 12:45:57 +01:00
|
|
|
|
2019-09-27 16:06:56 +02:00
|
|
|
# git describe --tags
|
2021-01-23 13:26:19 +01:00
|
|
|
realVersion = with lib; with builtins;
|
2021-01-03 11:53:21 +01:00
|
|
|
"1.0-482-g${substring 0 7 (elemAt srcs 0).rev}";
|
2018-08-02 10:18:47 +02:00
|
|
|
|
2019-01-08 23:56:16 +01:00
|
|
|
srcs = [
|
|
|
|
(fetchFromGitHub {
|
2021-01-26 15:02:17 +01:00
|
|
|
owner = "YosysHQ";
|
2019-01-08 23:56:16 +01:00
|
|
|
repo = "prjtrellis";
|
2021-01-03 11:53:21 +01:00
|
|
|
rev = "60c05b3f4e71fd78d4fba5c31f9974694245199e";
|
|
|
|
sha256 = "1k37mxwxv9fpm6xnrxlqqap7zqh2dvgqncphj3asi2rz0kh07ppf";
|
2019-01-08 23:56:16 +01:00
|
|
|
name = "trellis";
|
|
|
|
})
|
2020-03-25 12:45:57 +01:00
|
|
|
|
2019-01-08 23:56:16 +01:00
|
|
|
(fetchFromGitHub {
|
2021-01-26 15:02:17 +01:00
|
|
|
owner = "YosysHQ";
|
2019-01-08 23:56:16 +01:00
|
|
|
repo = "prjtrellis-db";
|
2020-11-12 21:14:08 +01:00
|
|
|
rev = "2cf058e7a3ba36134d21e34823e9b2ecaaceac2c";
|
|
|
|
sha256 = "1hjaw5jkwiaiznm2z0smy88m2cdz63cd51z4nibajfih7ikvkj6g";
|
2019-10-13 18:28:14 +02:00
|
|
|
name = "trellis-database";
|
2019-01-08 23:56:16 +01:00
|
|
|
})
|
2018-08-02 10:18:47 +02:00
|
|
|
];
|
2019-01-08 23:56:16 +01:00
|
|
|
sourceRoot = "trellis";
|
2018-08-02 10:18:47 +02:00
|
|
|
|
2020-12-02 13:52:53 +01:00
|
|
|
buildInputs = [ boost ];
|
2019-01-08 23:56:16 +01:00
|
|
|
nativeBuildInputs = [ cmake python3 ];
|
2020-02-08 16:32:03 +01:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DCURRENT_GIT_VERSION=${realVersion}"
|
|
|
|
# TODO: should this be in stdenv instead?
|
|
|
|
"-DCMAKE_INSTALL_DATADIR=${placeholder "out"}/share"
|
|
|
|
];
|
2018-08-02 10:18:47 +02:00
|
|
|
|
2019-01-08 23:56:16 +01:00
|
|
|
preConfigure = with builtins; ''
|
|
|
|
rmdir database && ln -sfv ${elemAt srcs 1} ./database
|
2018-08-02 10:18:47 +02:00
|
|
|
|
|
|
|
source environment.sh
|
|
|
|
cd libtrellis
|
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2019-01-08 23:56:16 +01:00
|
|
|
description = "Documentation and bitstream tools for Lattice ECP5 FPGAs";
|
2018-08-02 10:18:47 +02: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 03:11:51 +02:00
|
|
|
homepage = "https://github.com/SymbiFlow/prjtrellis";
|
2021-01-23 13:26:19 +01:00
|
|
|
license = lib.licenses.isc;
|
2019-08-20 07:02:29 +02:00
|
|
|
maintainers = with maintainers; [ q3k thoughtpolice emily ];
|
2021-01-23 13:26:19 +01:00
|
|
|
platforms = lib.platforms.all;
|
2018-08-02 10:18:47 +02:00
|
|
|
};
|
|
|
|
}
|