From 072ef02f4890957c957c4fae3d247e71f924ac6a Mon Sep 17 00:00:00 2001 From: Stephan Maka Date: Tue, 29 Dec 2020 19:47:34 +0100 Subject: [PATCH] pkgs: add json-schema-for-humans --- artiq-fast/default.nix | 4 +-- artiq-fast/pkgs/python-deps.nix | 46 ++++++++++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/artiq-fast/default.nix b/artiq-fast/default.nix index 3db6843..4a22f7c 100644 --- a/artiq-fast/default.nix +++ b/artiq-fast/default.nix @@ -2,7 +2,7 @@ with pkgs; let artiq6 = pkgs.lib.strings.versionAtLeast mainPackages.artiq.version "6.0"; - pythonDeps = import ./pkgs/python-deps.nix { inherit (pkgs) stdenv fetchgit fetchFromGitHub python3Packages; misoc-new = artiq6; }; + pythonDeps = import ./pkgs/python-deps.nix { inherit (pkgs) stdenv fetchgit fetchFromGitHub fetchurl python3Packages; misoc-new = artiq6; }; boards = [ { target = "kasli"; variant = "tester"; } @@ -20,7 +20,7 @@ let }) {} boards; mainPackages = rec { - inherit (pythonDeps) sipyco asyncserial pythonparser pyqtgraph-qt5 artiq-netboot misoc migen microscope jesd204b migen-axi lit outputcheck; + inherit (pythonDeps) sipyco asyncserial pythonparser pyqtgraph-qt5 artiq-netboot misoc migen microscope jesd204b migen-axi lit outputcheck json-schema-for-humans; binutils-or1k = callPackage ./pkgs/binutils.nix { platform = "or1k"; target = "or1k-linux"; }; binutils-arm = callPackage ./pkgs/binutils.nix { platform = "arm"; target = "armv7-unknown-linux-gnueabihf"; }; llvm-or1k = callPackage ./pkgs/llvm-or1k.nix {}; diff --git a/artiq-fast/pkgs/python-deps.nix b/artiq-fast/pkgs/python-deps.nix index 85d7645..dbb442d 100644 --- a/artiq-fast/pkgs/python-deps.nix +++ b/artiq-fast/pkgs/python-deps.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchgit, fetchFromGitHub, python3Packages, misoc-new }: +{ stdenv, fetchgit, fetchFromGitHub, fetchurl, python3Packages, misoc-new }: rec { # User dependencies @@ -305,4 +305,48 @@ rec { license = licenses.bsd3; }; }; + + # JSON schema tools + json-schema-for-humans = python3Packages.buildPythonApplication rec { + pname = "json-schema-for-humans"; + version = "0.27.0"; + src = fetchFromGitHub { + owner = "coveooss"; + repo = pname; + rev = "v${version}"; + sha256 = "1r40i192z6aasil5vsgcgp5yvx392dhhqnfc2qxbxvpja6l3p6p2"; + }; + patches = [ (fetchurl { + url = "https://github.com/coveooss/json-schema-for-humans/commit/1fe2e2391da5a796204fd1889e4a11a53f83f7c9.patch"; + sha256 = "0kpydpddlg0rib9snl8albhbrrs6d3ds292gpgpg7bdpqrwamdib"; + }) (fetchurl { + url = "https://github.com/coveooss/json-schema-for-humans/pull/66.patch"; + sha256 = "142a07v8bn1j20b7177yb60f4944kbx4cdqqq2nz6xkxmamw704d"; + }) ]; + + nativeBuildInputs = [ python3Packages.pbr ]; + propagatedBuildInputs = with python3Packages; [ + click + dataclasses-json + htmlmin + jinja2 + markdown2 + pygments + pytz + pyyaml + requests + ]; + preBuild = '' + export PBR_VERSION=0.0.1 + ''; + checkInputs = with python3Packages; [ + pytest beautifulsoup4 + ]; + + meta = with stdenv.lib; { + description = "Quickly generate HTML documentation from a JSON schema"; + homepage = "https://github.com/coveooss/json-schema-for-humans"; + license = licenses.asl20; + }; + }; }