From 7ab028deb65c66fdd4d2f1724349d6c9b2c6c549 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 9 Jun 2020 15:43:18 +0800 Subject: [PATCH] conda: build pythonparser --- artiq-fast/conda/fake-source.nix | 3 ++- artiq-fast/default.nix | 9 +++++++++ artiq-fast/pkgs/python-deps.nix | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/artiq-fast/conda/fake-source.nix b/artiq-fast/conda/fake-source.nix index 0f09760..32fe4af 100644 --- a/artiq-fast/conda/fake-source.nix +++ b/artiq-fast/conda/fake-source.nix @@ -1,5 +1,5 @@ { pkgs }: -{ name, version, src, dependencies ? [], extraYaml ? ""}: +{ name, version, src, extraSrcCommands ? "", dependencies ? [], extraYaml ? ""}: pkgs.runCommand "conda-fake-source-${name}" { } '' mkdir -p $out/fake-conda; @@ -7,6 +7,7 @@ pkgs.runCommand "conda-fake-source-${name}" { } # work around yet more idiotic conda behavior - build breaks if write permissions aren't set on source files. cp --no-preserve=mode,ownership -R ${src} workaround-conda pushd workaround-conda + ${extraSrcCommands} tar cf $out/src.tar . popd rm -rf workaround-conda diff --git a/artiq-fast/default.nix b/artiq-fast/default.nix index e18ffe7..9280844 100644 --- a/artiq-fast/default.nix +++ b/artiq-fast/default.nix @@ -35,6 +35,15 @@ let artiq-env = (pkgs.python3.withPackages(ps: [ artiq ])).overrideAttrs (oldAttrs: { name = "${pkgs.python3.name}-artiq-env-${artiq.version}"; }); openocd = callPackage ./pkgs/openocd.nix {}; + conda-pythonparser = import ./conda/build.nix { inherit pkgs; } { + name = "conda-pythonparser"; + src = import ./conda/fake-source.nix { inherit pkgs; } { + name = "pythonparser"; + inherit (pythonDeps.pythonparser) version src; + extraSrcCommands = "patch -p1 < ${./pkgs/python37hack.patch}"; + dependencies = ["regex"]; + }; + }; conda-sipyco = import ./conda/build.nix { inherit pkgs; } { name = "conda-sipyco"; src = import ./conda/fake-source.nix { inherit pkgs; } { diff --git a/artiq-fast/pkgs/python-deps.nix b/artiq-fast/pkgs/python-deps.nix index e2906b0..f8e07d1 100644 --- a/artiq-fast/pkgs/python-deps.nix +++ b/artiq-fast/pkgs/python-deps.nix @@ -37,6 +37,7 @@ rec { pythonparser = python3Packages.buildPythonPackage rec { name = "pythonparser"; + version = "1.3"; src = fetchFromGitHub { owner = "m-labs"; repo = "pythonparser";