3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/tools/build-managers/gup/build.nix

33 lines
1,018 B
Nix
Raw Normal View History

# NOTE: the `nixpkgs` version of this file is copied from the upstream repository
# for this package. Please make any changes to https://github.com/timbertson/gup/
2015-09-05 11:37:45 +01:00
{ stdenv, lib, pythonPackages }:
{ src, version, meta ? {}, passthru ? {}, forceTests ? false }:
let
testInputs = [
pythonPackages.mocktest or null
pythonPackages.whichcraft
pythonPackages.nose
pythonPackages.nose_progressive
];
pychecker = pythonPackages.pychecker or null;
usePychecker = forceTests || pychecker != null;
enableTests = forceTests || (lib.all (dep: dep != null) testInputs);
in
2015-09-05 11:37:45 +01:00
stdenv.mkDerivation {
inherit src meta passthru;
2015-09-05 11:37:45 +01:00
name = "gup-${version}";
buildInputs = [ pythonPackages.python ]
++ (lib.optionals enableTests testInputs)
++ (lib.optional usePychecker pychecker)
;
SKIP_PYCHECKER = !usePychecker;
2015-09-05 11:37:45 +01:00
buildPhase = "make python";
inherit pychecker;
testPhase = if enableTests then "make test" else "true";
2015-09-05 11:37:45 +01:00
installPhase = ''
mkdir $out
cp -r python/bin $out/bin
'';
}