27 ghcWithPackages = ghc.withPackages (g: (with g; [ old-time regex-compat syb split ]));
29 in stdenv.mkDerivation rec {
33 src = fetchFromGitHub {
37 sha256 = "sha256-ivTua3MLa8akma3MGkhsqwSdwswYX916kywKdlj7TqY=";
40 yices-src = fetchurl {
41 url = "https://github.com/B-Lang-org/bsc/releases/download/${version}/yices-src-for-bsc-${version}.tar.gz";
42 sha256 = "sha256-ey5yIIVFZyG4EnYGqbIJqmxK1rZ70FWM0Jz+2hIoGXE=";
45 enableParallelBuilding = true;
47 outputs = [ "out" "doc" ];
49 # https://github.com/B-Lang-org/bsc/pull/278
50 patches = [ ./libstp_stub_makefile.patch ];
53 mkdir -p $sourceRoot/src/vendor/yices/v2.6/yices2
54 tar -C $sourceRoot/src/vendor/yices/v2.6/yices2 -xf ${yices-src}
55 chmod -R +rwX $sourceRoot/src/vendor/yices/v2.6/yices2
60 src/Verilog/copy_module.pl \
61 src/comp/update-build-version.sh \
62 src/comp/update-build-system.sh \
65 substituteInPlace src/comp/Makefile \
66 --replace 'BINDDIR' 'BINDIR' \
67 --replace 'install-bsc install-bluetcl' 'install-bsc install-bluetcl $(UTILEXES) install-utils'
69 # allow running bsc to bootstrap
70 export LD_LIBRARY_PATH=$PWD/inst/lib/SAT
73 buildInputs = yices.buildInputs ++ [
97 "NO_DEPS_CHECKS=1" # skip the subrepo check (this deriviation uses yices.src instead of the subrepo)
98 "NOGIT=1" # https://github.com/B-Lang-org/bsc/issues/12
99 "LDCONFIG=ldconfig" # https://github.com/B-Lang-org/bsc/pull/43
110 checkTarget = "check-smoke";
118 mkdir -p $doc/share/doc/bsc
119 mv inst/README $doc/share/doc/bsc
120 mv inst/ReleaseNotes.* $doc/share/doc/bsc
121 mv inst/doc/*.pdf $doc/share/doc/bsc
125 description = "Toolchain for the Bluespec Hardware Definition Language";
126 homepage = "https://github.com/B-Lang-org/bsc";
127 license = lib.licenses.bsd3;
128 platforms = [ "x86_64-linux" ];
130 # darwin fails at https://github.com/B-Lang-org/bsc/pull/35#issuecomment-583731562
131 # aarch64 fails, as GHC fails with "ghc: could not execute: opt"
132 maintainers = with lib.maintainers; [ jcumming thoughtpolice ];