about summary refs log tree commit diff
path: root/pkgs/development/tools/build-managers/gup/build.nix
blob: b2a60c309b32c0be34b3b5fb42941aadce6edf9b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# 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/

{ 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
stdenv.mkDerivation {
  inherit src meta passthru;
  name = "gup-${version}";
  buildInputs = [ pythonPackages.python ]
    ++ (lib.optionals enableTests testInputs)
    ++ (lib.optional usePychecker pychecker)
  ;
  SKIP_PYCHECKER = !usePychecker;
  buildPhase = "make python";
  inherit pychecker;
  testPhase = if enableTests then "make test" else "true";
  installPhase = ''
    mkdir $out
    cp -r python/bin $out/bin
  '';
}