1 { lib, stdenv, jre, setJavaClassPath, coursier, makeWrapper }:
3 stdenv.mkDerivation rec {
6 scalaVersion = "2.13"; # pin, for determinism
8 deps = stdenv.mkDerivation {
9 pname = "${pname}-deps";
11 nativeBuildInputs = [ coursier ];
13 export COURSIER_CACHE=$(pwd)
14 cs fetch edu.berkeley.cs:${pname}_${scalaVersion}:${version} > deps
15 mkdir -p $out/share/java
16 cp $(< deps) $out/share/java
18 outputHashMode = "recursive";
19 outputHash = "sha256-xy3zdJZk6Q2HbEn5tRQ9Z0AjyXEteXepoWDaATjiUUw=";
22 nativeBuildInputs = [ makeWrapper setJavaClassPath ];
23 buildInputs = [ deps ];
30 makeWrapper ${jre}/bin/java $out/bin/${pname} \
31 --add-flags "-cp $CLASSPATH firrtl.stage.FirrtlMain"
36 doInstallCheck = true;
37 installCheckPhase = ''
38 $out/bin/firrtl --firrtl-source "${''
47 grep -qFe "module test" -e "endmodule" test.v
51 description = "Flexible Intermediate Representation for RTL";
52 mainProgram = "firrtl";
54 Firrtl is an intermediate representation (IR) for digital circuits
55 designed as a platform for writing circuit-level transformations.
57 homepage = "https://www.chisel-lang.org/firrtl/";
58 license = licenses.asl20;