3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/compilers/bluespec/default.nix

107 lines
2.4 KiB
Nix
Raw Normal View History

{ lib, stdenv
2020-02-05 21:56:03 +00:00
, fetchFromGitHub
, fetchpatch
, autoconf
, automake
, fontconfig
, gmp-static
2020-02-05 21:56:03 +00:00
, gperf
, libX11
, libpoly
, perl
, flex
, bison
, pkg-config
, itktcl
, incrtcl
, tcl
, tk
2020-02-05 21:56:03 +00:00
, verilog
, xorg
, yices
2020-02-05 21:56:03 +00:00
, zlib
, ghc
2020-02-05 21:56:03 +00:00
}:
let
ghcWithPackages = ghc.withPackages (g: (with g; [old-time regex-compat syb split ]));
2020-02-05 21:56:03 +00:00
in stdenv.mkDerivation rec {
pname = "bluespec";
version = "unstable-2021.03.29";
2020-02-05 21:56:03 +00:00
src = fetchFromGitHub {
owner = "B-Lang-org";
repo = "bsc";
rev = "00185f7960bd1bd5554a1167be9f37e1f18ac454";
sha256 = "1bcdhql4cla137d8xr8m2h21dyxv0jpjpalpr5mgj2jxqfsmkbrn";
};
2020-02-05 21:56:03 +00:00
enableParallelBuilding = true;
patches = [ ./libstp_stub_makefile.patch ];
buildInputs = yices.buildInputs ++ [
2020-02-05 21:56:03 +00:00
zlib
tcl tk
2020-02-05 21:56:03 +00:00
libX11 # tcltk
xorg.libXft
fontconfig
];
nativeBuildInputs = [
automake autoconf
perl
flex
bison
pkg-config
2020-02-05 21:56:03 +00:00
ghcWithPackages
];
checkInputs = [
verilog
];
postUnpack = ''
mkdir -p $sourceRoot/src/vendor/yices/v2.6/yices2
# XXX: only works because yices.src isn't a tarball.
cp -av ${yices.src}/* $sourceRoot/src/vendor/yices/v2.6/yices2
chmod -R +rwX $sourceRoot/src/vendor/yices/v2.6/yices2
'';
2020-02-05 21:56:03 +00:00
preBuild = ''
patchShebangs \
src/Verilog/copy_module.pl \
src/comp/update-build-version.sh \
src/comp/update-build-system.sh \
src/comp/wrapper.sh
substituteInPlace src/comp/Makefile \
--replace 'BINDDIR' 'BINDIR' \
--replace 'install-bsc install-bluetcl' 'install-bsc install-bluetcl $(UTILEXES) install-utils'
# allow running bsc to bootstrap
export LD_LIBRARY_PATH=/build/source/inst/lib/SAT
2020-02-05 21:56:03 +00:00
'';
makeFlags = [
"NO_DEPS_CHECKS=1" # skip the subrepo check (this deriviation uses yices.src instead of the subrepo)
2020-02-05 21:56:03 +00:00
"NOGIT=1" # https://github.com/B-Lang-org/bsc/issues/12
"LDCONFIG=ldconfig" # https://github.com/B-Lang-org/bsc/pull/43
"STP_STUB=1"
2020-02-05 21:56:03 +00:00
];
installPhase = "mv inst $out";
doCheck = true;
meta = {
description = "Toolchain for the Bluespec Hardware Definition Language";
homepage = "https://github.com/B-Lang-org/bsc";
license = lib.licenses.bsd3;
2020-02-05 21:56:03 +00:00
platforms = [ "x86_64-linux" ];
# darwin fails at https://github.com/B-Lang-org/bsc/pull/35#issuecomment-583731562
# aarch64 fails, as GHC fails with "ghc: could not execute: opt"
maintainers = with lib.maintainers; [ jcumming thoughtpolice ];
2020-02-05 21:56:03 +00:00
};
}