Skip to content

Commit

Permalink
flake: add experimental feature support
Browse files Browse the repository at this point in the history
  • Loading branch information
sbourdeauducq committed Sep 5, 2022
1 parent 3c7ab49 commit b4287ac
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
doCheck = false; # FIXME
};

artiq = pkgs.python3Packages.buildPythonPackage rec {
artiq-upstream = pkgs.python3Packages.buildPythonPackage rec {
pname = "artiq";
version = artiqVersion;
src = self;
Expand Down Expand Up @@ -175,6 +175,11 @@
'';
};

artiq = artiq-upstream // {
withExperimentalFeatures = features: artiq-upstream.overrideAttrs(oa:
{ patches = map (f: ./experimental-features/${f}.diff) features; });
};

migen = pkgs.python3Packages.buildPythonPackage rec {
name = "migen";
src = src-migen;
Expand Down Expand Up @@ -250,7 +255,7 @@
runScript = "vivado";
};

makeArtiqBoardPackage = { target, variant, buildCommand ? "python -m artiq.gateware.targets.${target} -V ${variant}" }:
makeArtiqBoardPackage = { target, variant, buildCommand ? "python -m artiq.gateware.targets.${target} -V ${variant}", experimentalFeatures ? [] }:
pkgs.stdenv.mkDerivation {
name = "artiq-board-${target}-${variant}";
phases = [ "buildPhase" "checkPhase" "installPhase" ];
Expand All @@ -261,7 +266,7 @@
};
};
nativeBuildInputs = [
(pkgs.python3.withPackages(ps: [ ps.jsonschema migen misoc artiq]))
(pkgs.python3.withPackages(ps: [ ps.jsonschema migen misoc (artiq.withExperimentalFeatures experimentalFeatures) ]))
rustPlatform.rust.rustc
rustPlatform.rust.cargo
pkgs.llvmPackages_11.clang-unwrapped
Expand Down

0 comments on commit b4287ac

Please sign in to comment.