Skip to content

Commit d4eac02

Browse files
Peter Hoegfpletz
authored andcommitted
calibre: 2.64.0 -> 2.66.0 (#18311)
A few additional changes: 1. We load patches from debian for improving privacy and security 2. Now with QT 5.6 instead of 5.5 3. We strip bundled python code and use proper upstream instead
1 parent 39e197a commit d4eac02

3 files changed

Lines changed: 36 additions & 31 deletions

File tree

pkgs/applications/misc/calibre/default.nix

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,50 @@
1-
{ stdenv, fetchurl, python, pyqt5, sip, poppler_utils, pkgconfig, libpng
1+
{ stdenv, fetchurl, fetchpatch, python, pyqt5, sip, poppler_utils, pkgconfig, libpng
22
, imagemagick, libjpeg, fontconfig, podofo, qtbase, qmakeHook, icu, sqlite
33
, makeWrapper, unrarSupport ? false, chmlib, pythonPackages, xz, libusb1, libmtp
44
, xdg_utils, makeDesktopItem
55
}:
66

77
stdenv.mkDerivation rec {
8-
version = "2.64.0";
8+
version = "2.66.0";
99
name = "calibre-${version}";
1010

1111
src = fetchurl {
1212
url = "https://download.calibre-ebook.com/${version}/${name}.tar.xz";
13-
sha256 = "0jjbkhd3n7rh5q6cl6yy51hyjbxmgm6xj7i2a1d3h2ggrip1zmr9";
13+
sha256 = "1dbv6p9cq9zj51zvhfy2b7aic2zqa44lmfmq7k7fkqcgb6wmanic";
1414
};
1515

1616
inherit python;
1717

1818
patches = [
19-
# Patch from Debian that switches the version update change from
20-
# enabled by default to disabled by default.
21-
./no_updates_dialog.patch
19+
# Patches from Debian that:
20+
# - disable plugin installation (very insecure)
21+
# - disables loading of web bug for privacy
22+
# - switches the version update from enabled to disabled by default
23+
(fetchpatch {
24+
name = "disable_plugins.patch";
25+
url = "http://bazaar.launchpad.net/~calibre-packagers/calibre/debian/download/head:/disable_plugins.py-20111220183043-dcl08ccfagjxt1dv-1/disable_plugins.py";
26+
sha256 = "19spdx52dhbrfn9lm084yl3cfwm6f90imd51k97sf7flmpl569pk";
27+
})
28+
(fetchpatch {
29+
name = "links_privacy.patch";
30+
url = "http://bazaar.launchpad.net/~calibre-packagers/calibre/debian/download/head:/linksprivacy.patch-20160417214308-6hvive72pc0r4awc-1/links-privacy.patch";
31+
sha256 = "0f6pq2b7q56pxrq2j8yqd7bksc623q2zgq29qcli30f13vga1w60";
32+
})
33+
(fetchpatch {
34+
name = "no_updates_dialog.patch";
35+
url = "http://bazaar.launchpad.net/~calibre-packagers/calibre/debian/download/head:/no_updates_dialog.pa-20081231120426-rzzufl0zo66t3mtc-16/no_updates_dialog.patch";
36+
sha256 = "16xwa2fa47jvs954fjrwr8rhh89aljgi1d1wrfxa40sknlmfwxif";
37+
})
38+
# the unrar patch is not from debian
2239
] ++ stdenv.lib.optional (!unrarSupport) ./dont_build_unrar_plugin.patch;
2340

2441
prePatch = ''
2542
sed -i "/pyqt_sip_dir/ s:=.*:= '${pyqt5}/share/sip/PyQt5':" \
2643
setup/build_environment.py
44+
45+
# Remove unneeded files and libs
46+
rm -rf resources/calibre-portable.* \
47+
src/{chardet,cherrypy,html5lib,odf,routes}
2748
'';
2849

2950
dontUseQmakeConfigure = true;
@@ -34,14 +55,14 @@ stdenv.mkDerivation rec {
3455

3556
nativeBuildInputs = [ makeWrapper pkgconfig qmakeHook ];
3657

37-
buildInputs =
38-
[ python pyqt5 sip poppler_utils libpng imagemagick libjpeg
39-
fontconfig podofo qtbase chmlib icu sqlite libusb1 libmtp xdg_utils
40-
pythonPackages.mechanize pythonPackages.lxml pythonPackages.dateutil
41-
pythonPackages.cssutils pythonPackages.beautifulsoup pythonPackages.pillow
42-
pythonPackages.sqlite3 pythonPackages.netifaces pythonPackages.apsw
43-
pythonPackages.cssselect
44-
];
58+
buildInputs = [
59+
python pyqt5 sip poppler_utils libpng imagemagick libjpeg
60+
fontconfig podofo qtbase chmlib icu sqlite libusb1 libmtp xdg_utils
61+
] ++ (with pythonPackages; [
62+
apsw beautifulsoup cssselect cssutils dateutil lxml mechanize netifaces pillow sqlite3
63+
# the following are distributed with calibre, but we use upstream instead
64+
chardet cherrypy html5lib odfpy routes
65+
]);
4566

4667
installPhase = ''
4768
export HOME=$TMPDIR/fakehome

pkgs/applications/misc/calibre/no_updates_dialog.patch

Lines changed: 0 additions & 16 deletions
This file was deleted.

pkgs/top-level/all-packages.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12527,7 +12527,7 @@ in
1252712527

1252812528
calcurse = callPackage ../applications/misc/calcurse { };
1252912529

12530-
calibre = qt55.callPackage ../applications/misc/calibre {
12530+
calibre = qt5.callPackage ../applications/misc/calibre {
1253112531
inherit (pythonPackages) pyqt5 sip;
1253212532
};
1253312533

0 commit comments

Comments
 (0)