aboutsummaryrefslogtreecommitdiff
path: root/overlays
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2020-03-08 14:40:45 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2020-03-08 14:40:45 +0100
commite77c7882968645ab066dc3d69b3eba83a3ff3e0b (patch)
tree485add51dc3868e1243e278cea83b64f0bbe61a5 /overlays
parente42f8192b965bc5b6fa929e7ec52804a907f4091 (diff)
downloadNix-e77c7882968645ab066dc3d69b3eba83a3ff3e0b.tar.gz
Nix-e77c7882968645ab066dc3d69b3eba83a3ff3e0b.tar.zst
Nix-e77c7882968645ab066dc3d69b3eba83a3ff3e0b.zip
Upgrade weboob
Diffstat (limited to 'overlays')
-rw-r--r--overlays/weboob/default.nix19
-rw-r--r--overlays/weboob/weboob.nix67
2 files changed, 73 insertions, 13 deletions
diff --git a/overlays/weboob/default.nix b/overlays/weboob/default.nix
index d0a15a7..6e5656b 100644
--- a/overlays/weboob/default.nix
+++ b/overlays/weboob/default.nix
@@ -1,15 +1,8 @@
1self: super: { 1self: 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 0000000..faafbc4
--- /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}:
8let
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 };
19in
20
21buildPythonPackage 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