2017-01-25 11:25:14 +00:00
|
|
|
# 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
|
|
|
|
2017-01-25 11:25:14 +00: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 {
|
2017-01-25 11:25:14 +00:00
|
|
|
inherit src meta passthru;
|
2015-09-05 11:37:45 +01:00
|
|
|
name = "gup-${version}";
|
2017-01-25 11:25:14 +00:00
|
|
|
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";
|
2017-01-25 11:25:14 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
}
|