nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 yosys,
6 python3,
7}:
8
9let
10 python = python3.withPackages (p: with p; [ flask ]);
11in
12stdenv.mkDerivation {
13 pname = "mcy";
14 version = "2020.08.03";
15
16 src = fetchFromGitHub {
17 owner = "YosysHQ";
18 repo = "mcy";
19 rev = "62048e69df13f8e03670424626755ae8ef4c36ff";
20 sha256 = "15xxgzx1zxzx5kshqyrxnfx33cz6cjzxcdcn6z98jhs9bwyvf96f";
21 };
22
23 buildInputs = [ python ];
24 patchPhase = ''
25 chmod +x scripts/create_mutated.sh
26 patchShebangs .
27
28 substituteInPlace mcy.py \
29 --replace yosys '${lib.getExe yosys}' \
30 --replace 'os.execvp("mcy-dash"' "os.execvp(\"$out/bin/mcy-dash\""
31 substituteInPlace mcy-dash.py \
32 --replace 'app.run(debug=True)' 'app.run(host="0.0.0.0",debug=True)' \
33 --replace 'subprocess.Popen(["mcy"' "subprocess.Popen([\"$out/bin/mcy\""
34 substituteInPlace scripts/create_mutated.sh \
35 --replace yosys '${lib.getExe yosys}'
36 '';
37
38 # the build needs a bit of work...
39 dontBuild = true;
40 installPhase = ''
41 mkdir -p $out/bin $out/share/mcy/{dash,scripts}
42 install mcy.py $out/bin/mcy && chmod +x $out/bin/mcy
43 install mcy-dash.py $out/bin/mcy-dash && chmod +x $out/bin/mcy-dash
44 cp -r dash/. $out/share/mcy/dash/.
45 cp -r scripts/. $out/share/mcy/scripts/.
46 '';
47
48 meta = {
49 description = "Mutation-based coverage testing for hardware designs, with Yosys";
50 homepage = "https://github.com/YosysHQ/mcy";
51 license = lib.licenses.isc;
52 maintainers = with lib.maintainers; [ thoughtpolice ];
53 platforms = lib.platforms.all;
54 };
55}