@@ -4,40 +4,45 @@
44, autoconf
55, automake
66, fontconfig
7−, gmp
7+, gmp-static
88, gperf
99, libX11
1010, libpoly
1111, perl
12+, flex
13+, bison
1214, pkgconfig
15+, itktcl
16+, incrtcl
17+, tcl
18+, tk
1319, verilog
1420, xorg
21+, yices
1522, zlib
1623, ghc
1724}:
1825
1926let
20− # yices wants a libgmp.a and fails otherwise
21− gmpStatic = gmp.override { withStatic = true; };
22−
23− ghcWithPackages = ghc.withPackages (g: (with g; [old-time regex-compat syb]));
27+ ghcWithPackages = ghc.withPackages (g: (with g; [old-time regex-compat syb split ]));
2428in stdenv.mkDerivation rec {
2529 pname = "bluespec";
26− version = "unstable-2020.02.09";
30+ version = "unstable-2020.11.04";
2731
2832 src = fetchFromGitHub {
29− owner = "B-Lang-org";
30− repo = "bsc";
31− rev = "05c8afb08078e437c635b9c708124b428ac51b3d";
32− sha256 = "06yhpkz7wga1a0p9031cfjqbzw7205bj2jxgdghhfzmllaiphniy";
33− fetchSubmodules = true;
34− };
33+ owner = "B-Lang-org";
34+ repo = "bsc";
35+ rev = "103357f32cf63f2ca2b16ebc8e2c675ec5562464";
36+ sha256 = "0iikzx0fxky0fmc31lyxfldy1wixr2mayzcn24b8d76wd4ix1vk3";
37+ };
3538
3639 enableParallelBuilding = true;
3740
38− buildInputs = [
41+ patches = [ ./libstp_stub_makefile.patch ];
42+
43+ buildInputs = yices.buildInputs ++ [
3944 zlib
40− gmpStatic gperf libpoly # yices
45+ tcl tk
4146 libX11 # tcltk
4247 xorg.libXft
4348 fontconfig
@@ -46,6 +51,8 @@ in stdenv.mkDerivation rec {
4651 nativeBuildInputs = [
4752 automake autoconf
4853 perl
54+ flex
55+ bison
4956 pkgconfig
5057 ghcWithPackages
5158 ];
@@ -54,13 +61,13 @@ in stdenv.mkDerivation rec {
5461 verilog
5562 ];
5663
57− patches = [
58− # drop stp support https://github.com/B-Lang-org/bsc/pull/31
59− (fetchpatch {
60− url = "https://github.com/flokli/bsc/commit/0bd48ecc2561541dc1368918863c0b2f4915006f.patch";
61− sha256 = "0bam9anld33zfi9d4gs502g94w49zhl5iqmbs2d1p5i19aqpy38l";
62− })
63− ];
64+
65+ postUnpack = ''
66+ mkdir -p $sourceRoot/src/vendor/yices/v2.6/yices2
67+ # XXX: only works because yices.src isn't a tarball.
68+ cp -av ${yices.src}/* $sourceRoot/src/vendor/yices/v2.6/yices2
69+ chmod -R +rwX $sourceRoot/src/vendor/yices/v2.6/yices2
70+ '';
6471
6572 preBuild = ''
6673 patchShebangs \
@@ -72,11 +79,15 @@ in stdenv.mkDerivation rec {
7279 substituteInPlace src/comp/Makefile \
7380 --replace 'BINDDIR' 'BINDIR' \
7481 --replace 'install-bsc install-bluetcl' 'install-bsc install-bluetcl $(UTILEXES) install-utils'
82+ # allow running bsc to bootstrap
83+ export LD_LIBRARY_PATH=/build/source/inst/lib/SAT
7584 '';
7685
7786 makeFlags = [
87+ "NO_DEPS_CHECKS=1" # skip the subrepo check (this deriviation uses yices.src instead of the subrepo)
7888 "NOGIT=1" # https://github.com/B-Lang-org/bsc/issues/12
7989 "LDCONFIG=ldconfig" # https://github.com/B-Lang-org/bsc/pull/43
90+ "STP_STUB=1"
8091 ];
8192
8293 installPhase = "mv inst $out";