diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-03-08 14:40:45 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-04-25 00:04:51 +0200 |
commit | f7d64613e7c2908854778adc81dc21a7763fb91b (patch) | |
tree | 4d7f6cc90da0495433e6cbc3cdf71859fb663b1d /overlays | |
parent | 76f014e9de89a963e40ed109d860cd15e54d582b (diff) | |
download | NUR-f7d64613e7c2908854778adc81dc21a7763fb91b.tar.gz NUR-f7d64613e7c2908854778adc81dc21a7763fb91b.tar.zst NUR-f7d64613e7c2908854778adc81dc21a7763fb91b.zip |
Upgrade weboob
Diffstat (limited to 'overlays')
-rw-r--r-- | overlays/weboob/default.nix | 19 | ||||
-rw-r--r-- | overlays/weboob/weboob.nix | 67 |
2 files changed, 73 insertions, 13 deletions
diff --git a/overlays/weboob/default.nix b/overlays/weboob/default.nix index d0a15a7d..6e5656b7 100644 --- a/overlays/weboob/default.nix +++ b/overlays/weboob/default.nix | |||
@@ -1,15 +1,8 @@ | |||
1 | self: super: { | 1 | self: super: { |
2 | weboob = (self.pythonPackages.weboob.overridePythonAttrs { | 2 | weboob = self.callPackage ./weboob.nix { |
3 | setupPyBuildFlags = [ "--no-qt" "--xdg" ]; | 3 | inherit (super.python3Packages) buildPythonPackage fetchPypi nose |
4 | }).overrideAttrs (old: rec { | 4 | pillow prettytable pyyaml dateutil gdata requests feedparser lxml |
5 | version = "1.5"; | 5 | pyqt5 simplejson cssselect pdfminer termcolor |
6 | src = self.fetchurl { | 6 | google_api_python_client unidecode Babel html5lib html2text; |
7 | url = "https://git.weboob.org/weboob/weboob/-/archive/${version}/${old.pname}-${version}.tar.gz"; | 7 | }; |
8 | sha256 = "0l6q5nm5g0zn6gmf809059kddrbds27wgygxsfkqja9blks5vq7z"; | ||
9 | }; | ||
10 | postInstall = ''${old.postInstall or ""} | ||
11 | mkdir -p $out/share/bash-completion/completions/ | ||
12 | cp tools/weboob_bash_completion $out/share/bash-completion/completions/weboob | ||
13 | ''; | ||
14 | }); | ||
15 | } | 8 | } |
diff --git a/overlays/weboob/weboob.nix b/overlays/weboob/weboob.nix new file mode 100644 index 00000000..faafbc4a --- /dev/null +++ b/overlays/weboob/weboob.nix | |||
@@ -0,0 +1,67 @@ | |||
1 | { buildPythonPackage, fetchurl, fetchPypi, stdenv | ||
2 | , nose, pillow, prettytable, pyyaml, dateutil, gdata | ||
3 | , requests, feedparser, lxml, gnupg, pyqt5 | ||
4 | , libyaml, simplejson, cssselect, pdfminer | ||
5 | , termcolor, google_api_python_client, html2text | ||
6 | , unidecode, html5lib, Babel | ||
7 | }: | ||
8 | let | ||
9 | mechanize = buildPythonPackage rec { | ||
10 | pname = "mechanize"; | ||
11 | version = "0.4.4"; | ||
12 | src = fetchPypi { | ||
13 | inherit version pname; | ||
14 | sha256 = "9fff89e973bdf1aee75a351bd4dde53ca51a7e76944ddeae3ea3b6ad6c46045c"; | ||
15 | }; | ||
16 | propagatedBuildInputs = [ html5lib ]; | ||
17 | doCheck = false; | ||
18 | }; | ||
19 | in | ||
20 | |||
21 | buildPythonPackage rec { | ||
22 | pname = "weboob"; | ||
23 | version = "2.0"; | ||
24 | |||
25 | src = fetchurl { | ||
26 | url = "https://symlink.me/attachments/download/356/${pname}-${version}.tar.gz"; | ||
27 | sha256 = "1p0wd6k28s0cdxkrj5s6vmi120w6v5vfxxyddqg7s2xjxv6mbbbm"; | ||
28 | }; | ||
29 | |||
30 | postPatch = '' | ||
31 | # Disable doctests that require networking: | ||
32 | sed -i -n -e '/^ *def \+pagination *(.*: *$/ { | ||
33 | p; n; p; /"""\|'\'\'\'''/!b | ||
34 | |||
35 | :loop | ||
36 | n; /^ *\(>>>\|\.\.\.\)/ { h; bloop } | ||
37 | x; /^ *\(>>>\|\.\.\.\)/bloop; x | ||
38 | p; /"""\|'\'\'\'''/b | ||
39 | bloop | ||
40 | }; p' weboob/browser/browsers.py weboob/browser/pages.py | ||
41 | ''; | ||
42 | |||
43 | postInstall = '' | ||
44 | mkdir -p $out/share/bash-completion/completions/ | ||
45 | cp tools/weboob_bash_completion $out/share/bash-completion/completions/weboob | ||
46 | ''; | ||
47 | |||
48 | checkInputs = [ nose ]; | ||
49 | |||
50 | nativeBuildInputs = [ pyqt5 ]; | ||
51 | |||
52 | propagatedBuildInputs = [ pillow prettytable pyyaml dateutil | ||
53 | gdata requests feedparser lxml gnupg pyqt5 libyaml | ||
54 | simplejson cssselect mechanize pdfminer termcolor | ||
55 | google_api_python_client html2text unidecode Babel ]; | ||
56 | |||
57 | checkPhase = '' | ||
58 | nosetests | ||
59 | ''; | ||
60 | |||
61 | meta = { | ||
62 | homepage = http://weboob.org; | ||
63 | description = "Collection of applications and APIs to interact with websites without requiring the user to open a browser"; | ||
64 | license = stdenv.lib.licenses.agpl3; | ||
65 | }; | ||
66 | } | ||
67 | |||