about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/smugline/default.nix
blob: ac625cf1fa04c5501e8f880c2f35a8db35381791 (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
33
34
35
36
37
38
39
40
41
{ stdenv
, fetchFromGitHub
, docopt
, requests
, smugpy
, python
, pkgs
}:

stdenv.mkDerivation rec {
  name = "${pname}-${version}";
  pname   = "smugline";
  version = "20160106";

  src = fetchFromGitHub {
    owner  = "gingerlime";
    repo   = pname;
    rev    = "134554c574c2d282112ba60165a8c5ffe0f16fd4";
    sha256 = "00n012ijkdrx8wsl8x3ghdcxcdp29s4kwr3yxvlyj79g5yhfvaj6";
  };

  phases = [ "unpackPhase" "installPhase" ];

  buildInputs = [ python pkgs.makeWrapper ];
  propagatedBuildInputs = [ docopt requests smugpy ];

  installPhase = ''
    mkdir -p $out/bin $out/libexec
    cp smugline.py $out/libexec
    makeWrapper ${python.interpreter} $out/bin/smugline \
      --add-flags "$out/libexec/smugline.py" \
      --prefix PYTHONPATH : "$PYTHONPATH"
  '';

  meta = with stdenv.lib; {
    homepage = https://github.com/gingerlime/smugline;
    description = "A simple command line tool for smugmug ";
    license = licenses.mit;
  };

}