From beb99234fec705155267b7c8099a6c888014eece Mon Sep 17 00:00:00 2001 From: Drew Risinger Date: Tue, 24 Nov 2020 09:26:35 -0500 Subject: [PATCH] conda build: allow pname or name convention --- artiq-fast/conda/build.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/artiq-fast/conda/build.nix b/artiq-fast/conda/build.nix index c6b7017..9e3db36 100644 --- a/artiq-fast/conda/build.nix +++ b/artiq-fast/conda/build.nix @@ -2,12 +2,22 @@ # recipe must be a string pointing to a path within the source. { pkgs }: -{ name, src, recipe ? "fake-conda"}: +{ name ? null +, src +, pname ? null +, version ? null +, recipe ? "fake-conda" +}: +# Check that either name is specified or both pname & version are specified. +assert (name == null) -> pname != null && version != null; +assert (name != null) -> pname == null && version == null; let condaBuilderEnv = import ./builder-env.nix { inherit pkgs; }; + realName = if (name != null) then name else "${pname}-${version}"; in pkgs.stdenv.mkDerivation { - inherit name src; + name = realName; + inherit src; buildCommand = '' HOME=`pwd`