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
This commit is contained in:
Peter Hoeg 2016-09-07 10:32:06 +08:00 committed by Franz Pletz
parent 39e197ab1c
commit d4eac0278c
3 changed files with 36 additions and 31 deletions

View File

@ -1,29 +1,50 @@
{ stdenv, fetchurl, python, pyqt5, sip, poppler_utils, pkgconfig, libpng { stdenv, fetchurl, fetchpatch, python, pyqt5, sip, poppler_utils, pkgconfig, libpng
, imagemagick, libjpeg, fontconfig, podofo, qtbase, qmakeHook, icu, sqlite , imagemagick, libjpeg, fontconfig, podofo, qtbase, qmakeHook, icu, sqlite
, makeWrapper, unrarSupport ? false, chmlib, pythonPackages, xz, libusb1, libmtp , makeWrapper, unrarSupport ? false, chmlib, pythonPackages, xz, libusb1, libmtp
, xdg_utils, makeDesktopItem , xdg_utils, makeDesktopItem
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "2.64.0"; version = "2.66.0";
name = "calibre-${version}"; name = "calibre-${version}";
src = fetchurl { src = fetchurl {
url = "https://download.calibre-ebook.com/${version}/${name}.tar.xz"; url = "https://download.calibre-ebook.com/${version}/${name}.tar.xz";
sha256 = "0jjbkhd3n7rh5q6cl6yy51hyjbxmgm6xj7i2a1d3h2ggrip1zmr9"; sha256 = "1dbv6p9cq9zj51zvhfy2b7aic2zqa44lmfmq7k7fkqcgb6wmanic";
}; };
inherit python; inherit python;
patches = [ patches = [
# Patch from Debian that switches the version update change from # Patches from Debian that:
# enabled by default to disabled by default. # - disable plugin installation (very insecure)
./no_updates_dialog.patch # - disables loading of web bug for privacy
# - switches the version update from enabled to disabled by default
(fetchpatch {
name = "disable_plugins.patch";
url = "http://bazaar.launchpad.net/~calibre-packagers/calibre/debian/download/head:/disable_plugins.py-20111220183043-dcl08ccfagjxt1dv-1/disable_plugins.py";
sha256 = "19spdx52dhbrfn9lm084yl3cfwm6f90imd51k97sf7flmpl569pk";
})
(fetchpatch {
name = "links_privacy.patch";
url = "http://bazaar.launchpad.net/~calibre-packagers/calibre/debian/download/head:/linksprivacy.patch-20160417214308-6hvive72pc0r4awc-1/links-privacy.patch";
sha256 = "0f6pq2b7q56pxrq2j8yqd7bksc623q2zgq29qcli30f13vga1w60";
})
(fetchpatch {
name = "no_updates_dialog.patch";
url = "http://bazaar.launchpad.net/~calibre-packagers/calibre/debian/download/head:/no_updates_dialog.pa-20081231120426-rzzufl0zo66t3mtc-16/no_updates_dialog.patch";
sha256 = "16xwa2fa47jvs954fjrwr8rhh89aljgi1d1wrfxa40sknlmfwxif";
})
# the unrar patch is not from debian
] ++ stdenv.lib.optional (!unrarSupport) ./dont_build_unrar_plugin.patch; ] ++ stdenv.lib.optional (!unrarSupport) ./dont_build_unrar_plugin.patch;
prePatch = '' prePatch = ''
sed -i "/pyqt_sip_dir/ s:=.*:= '${pyqt5}/share/sip/PyQt5':" \ sed -i "/pyqt_sip_dir/ s:=.*:= '${pyqt5}/share/sip/PyQt5':" \
setup/build_environment.py setup/build_environment.py
# Remove unneeded files and libs
rm -rf resources/calibre-portable.* \
src/{chardet,cherrypy,html5lib,odf,routes}
''; '';
dontUseQmakeConfigure = true; dontUseQmakeConfigure = true;
@ -34,14 +55,14 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ makeWrapper pkgconfig qmakeHook ]; nativeBuildInputs = [ makeWrapper pkgconfig qmakeHook ];
buildInputs = buildInputs = [
[ python pyqt5 sip poppler_utils libpng imagemagick libjpeg python pyqt5 sip poppler_utils libpng imagemagick libjpeg
fontconfig podofo qtbase chmlib icu sqlite libusb1 libmtp xdg_utils fontconfig podofo qtbase chmlib icu sqlite libusb1 libmtp xdg_utils
pythonPackages.mechanize pythonPackages.lxml pythonPackages.dateutil ] ++ (with pythonPackages; [
pythonPackages.cssutils pythonPackages.beautifulsoup pythonPackages.pillow apsw beautifulsoup cssselect cssutils dateutil lxml mechanize netifaces pillow sqlite3
pythonPackages.sqlite3 pythonPackages.netifaces pythonPackages.apsw # the following are distributed with calibre, but we use upstream instead
pythonPackages.cssselect chardet cherrypy html5lib odfpy routes
]; ]);
installPhase = '' installPhase = ''
export HOME=$TMPDIR/fakehome export HOME=$TMPDIR/fakehome

View File

@ -1,16 +0,0 @@
# Description: Disable update check by default.
Index: calibre/src/calibre/gui2/main.py
===================================================================
--- calibre.orig/src/calibre/gui2/main.py 2014-02-02 10:41:28.470954623 +0100
+++ calibre/src/calibre/gui2/main.py 2014-02-02 10:41:56.546954247 +0100
@@ -37,8 +37,8 @@
help=_('Start minimized to system tray.'))
parser.add_option('-v', '--verbose', default=0, action='count',
help=_('Ignored, do not use. Present only for legacy reasons'))
- parser.add_option('--no-update-check', default=False, action='store_true',
- help=_('Do not check for updates'))
+ parser.add_option('--update-check', dest='no_update_check', default=True, action='store_false',
+ help=_('Check for updates'))
parser.add_option('--ignore-plugins', default=False, action='store_true',
help=_('Ignore custom plugins, useful if you installed a plugin'
' that is preventing calibre from starting'))

View File

@ -12527,7 +12527,7 @@ in
calcurse = callPackage ../applications/misc/calcurse { }; calcurse = callPackage ../applications/misc/calcurse { };
calibre = qt55.callPackage ../applications/misc/calibre { calibre = qt5.callPackage ../applications/misc/calibre {
inherit (pythonPackages) pyqt5 sip; inherit (pythonPackages) pyqt5 sip;
}; };