1
0
Fork 0
nix-scripts/cpld/default.nix

60 lines
1.9 KiB
Nix
Raw Normal View History

2019-07-03 23:01:31 +08:00
{ pkgs ? import <nixpkgs> {} }:
let
2019-07-26 15:58:01 +08:00
migen = (pkgs.callPackage ../artiq-fast/pkgs/python-deps.nix {}).migen;
2019-07-03 23:01:31 +08:00
ise = import ./ise.nix { inherit pkgs; };
2019-11-14 16:34:25 +08:00
buildUrukulCpld = {version, src}: pkgs.stdenv.mkDerivation {
name = "urukul-cpld-${version}";
inherit src;
buildInputs = [(pkgs.python3.withPackages(ps: [migen]))] ++ (builtins.attrValues ise);
phases = ["buildPhase" "installPhase"];
buildPhase = "python $src/urukul_impl.py";
installPhase =
''
mkdir -p $out $out/nix-support
cp build/urukul.jed $out
echo file binary-dist $out/urukul.jed >> $out/nix-support/hydra-build-products
'';
};
2019-12-19 12:51:52 +08:00
buildMirnyCpld = {version, src}: pkgs.stdenv.mkDerivation {
name = "mirny-cpld-${version}";
inherit src;
buildInputs = [(pkgs.python3.withPackages(ps: [migen]))] ++ (builtins.attrValues ise);
phases = ["buildPhase" "installPhase"];
buildPhase = "python $src/mirny_impl.py";
installPhase =
''
mkdir -p $out $out/nix-support
cp build/mirny.jed $out
echo file binary-dist $out/mirny.jed >> $out/nix-support/hydra-build-products
'';
};
2019-07-03 23:01:31 +08:00
in
{
2019-11-14 16:34:25 +08:00
urukul-cpld-master = buildUrukulCpld {
version = "master";
2019-07-03 23:01:31 +08:00
src = <urukulSrc>;
2019-11-14 16:34:25 +08:00
};
urukul-cpld-release = buildUrukulCpld rec {
2020-04-03 17:30:00 +08:00
version = "1.4.0";
2019-11-14 16:34:25 +08:00
src = pkgs.fetchFromGitHub {
owner = "quartiq";
repo = "urukul";
rev = "v${version}";
2020-04-03 17:30:00 +08:00
sha256 = "1962jpzqzn22cwkcmfnvwqlj5i89pljhgfk64n6pk73clir9mp0w";
2019-11-14 16:34:25 +08:00
};
2019-07-03 23:01:31 +08:00
};
2019-12-19 12:51:52 +08:00
mirny-cpld-master = buildMirnyCpld {
version = "master";
src = <mirnySrc>;
};
mirny-cpld-release = buildMirnyCpld rec {
version = "0.2.4";
src = pkgs.fetchFromGitHub {
owner = "quartiq";
repo = "mirny";
rev = "v${version}";
sha256 = "0fyz0g1h1s54zdivkfqhgyhpq7gjkl9kxkcfy3104p2f889l1vgw";
};
};
2019-07-03 23:01:31 +08:00
}