conda build: allow pname or name convention
This commit is contained in:
parent
f072c46ee3
commit
beb99234fe
|
@ -2,12 +2,22 @@
|
||||||
# recipe must be a string pointing to a path within the source.
|
# recipe must be a string pointing to a path within the source.
|
||||||
|
|
||||||
{ pkgs }:
|
{ 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
|
let
|
||||||
condaBuilderEnv = import ./builder-env.nix { inherit pkgs; };
|
condaBuilderEnv = import ./builder-env.nix { inherit pkgs; };
|
||||||
|
realName = if (name != null) then name else "${pname}-${version}";
|
||||||
in pkgs.stdenv.mkDerivation {
|
in pkgs.stdenv.mkDerivation {
|
||||||
inherit name src;
|
name = realName;
|
||||||
|
inherit src;
|
||||||
buildCommand =
|
buildCommand =
|
||||||
''
|
''
|
||||||
HOME=`pwd`
|
HOME=`pwd`
|
||||||
|
|
Loading…
Reference in New Issue