summary refs log tree commit diff
path: root/pkgs/development/python-modules/subdownloader/default.nix
blob: c4d57bef0ea9f69ec839b917f0f6eaea76fe31b3 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{ stdenv
, buildPythonPackage
, fetchurl
, mmpython
, pyqt4
}:

buildPythonPackage rec {
  version = "2.0.18";
  pname = "subdownloader";

  src = fetchurl {
    url = "https://launchpad.net/subdownloader/trunk/2.0.18/+download/subdownloader_2.0.18.orig.tar.gz";
    sha256 = "0manlfdpb585niw23ibb8n21mindd1bazp0pnxvmdjrp2mnw97ig";
  };

  propagatedBuildInputs = [ mmpython pyqt4 ];

  setup = ''
    import os
    import sys

    try:
        if os.environ.get("NO_SETUPTOOLS"):
            raise ImportError()
        from setuptools import setup, Extension
        SETUPTOOLS = True
    except ImportError:
        SETUPTOOLS = False
        # Use distutils.core as a fallback.
        # We won t be able to build the Wheel file on Windows.
        from distutils.core import setup, Extension

    with open("README") as fp:
        long_description = fp.read()

    requirements = [ ]

    install_options = {
        "name": "subdownloader",
        "version": "2.0.18",
        "description": "Tool for automatic download/upload subtitles for videofiles using fast hashing",
        "long_description": long_description,
        "url": "http://www.subdownloader.net",

        "scripts": ["run.py"],
        "packages": ["cli", "FileManagement", "gui", "languages", "modules"],

    }
    if SETUPTOOLS:
        install_options["install_requires"] = requirements

    setup(**install_options)
  '';

  postUnpack = ''
    echo '${setup}' > $sourceRoot/setup.py
  '';

  meta = with stdenv.lib; {
    description = "Tool for automatic download/upload subtitles for videofiles using fast hashing";
    homepage = "https://www.subdownloader.net";
    license = licenses.gpl3;
  };

}