From ce676be8e449b21ad73bb8b5be80682562b716dd Mon Sep 17 00:00:00 2001 From: Astro Date: Fri, 15 Jan 2021 16:32:55 +0800 Subject: [PATCH] artiq: add dependency jsonschema (#38) artiq: add dependency jsonschema Support for resolution of https://github.com/m-labs/artiq/issues/1474 Co-authored-by: Stephan Maka Reviewed-on: https://git.m-labs.hk/M-Labs/nix-scripts/pulls/38 Co-Authored-By: Astro Co-Committed-By: Astro --- artiq-full.nix | 5 +++-- artiq-full/artiq-board.nix | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/artiq-full.nix b/artiq-full.nix index f17e929..69d7b22 100644 --- a/artiq-full.nix +++ b/artiq-full.nix @@ -26,6 +26,7 @@ let let artiq-fast = import ./fast { inherit pkgs; }; + ddbDeps = pkgs.python3.withPackages (ps: [ ps.jsonschema ]); target = "kasli"; variants = [ @@ -145,7 +146,7 @@ let } // (pkgs.lib.optionalAttrs ((builtins.fromJSON (builtins.readFile json)).base == "standalone") { "device-db-\''${target}-\''${variant}" = pkgs.stdenv.mkDerivation { name = "device-db-\''${target}-\''${variant}"; - buildInputs = [ artiq-fast.artiq ]; + buildInputs = [ artiq-fast.artiq ddbDeps ]; phases = [ "buildPhase" ]; buildPhase = " mkdir \$out @@ -210,7 +211,7 @@ let (system: crates: pkgs.lib.attrsets.nameValuePair ("device-db-" + system) (pkgs.stdenv.mkDerivation { name = "device-db-\''${system}"; - buildInputs = [ artiq-fast.artiq ]; + buildInputs = [ artiq-fast.artiq ddbDeps ]; phases = [ "buildPhase" ]; buildPhase = " mkdir \$out diff --git a/artiq-full/artiq-board.nix b/artiq-full/artiq-board.nix index 90b2d24..81c36e4 100644 --- a/artiq-full/artiq-board.nix +++ b/artiq-full/artiq-board.nix @@ -78,7 +78,11 @@ let installPath = builtins.unsafeDiscardStringContext "${pkgs.python3Packages.python.sitePackages}/artiq/board-support/${target}-${variant}"; pythonEnv = pkgs.python3.withPackages (ps: with ps; [ jinja2 numpy artiqpkgs.migen artiqpkgs.microscope artiqpkgs.misoc artiqpkgs.jesd204b artiqpkgs.artiq - ]); + ] ++ + (if target == "kasli" + then [ jsonschema ] + else [] + )); generatedSources = pkgs.stdenv.mkDerivation {