mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-28 09:53:10 +00:00
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:
parent
39e197ab1c
commit
d4eac0278c
@ -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
|
||||
, makeWrapper, unrarSupport ? false, chmlib, pythonPackages, xz, libusb1, libmtp
|
||||
, xdg_utils, makeDesktopItem
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "2.64.0";
|
||||
version = "2.66.0";
|
||||
name = "calibre-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.calibre-ebook.com/${version}/${name}.tar.xz";
|
||||
sha256 = "0jjbkhd3n7rh5q6cl6yy51hyjbxmgm6xj7i2a1d3h2ggrip1zmr9";
|
||||
sha256 = "1dbv6p9cq9zj51zvhfy2b7aic2zqa44lmfmq7k7fkqcgb6wmanic";
|
||||
};
|
||||
|
||||
inherit python;
|
||||
|
||||
patches = [
|
||||
# Patch from Debian that switches the version update change from
|
||||
# enabled by default to disabled by default.
|
||||
./no_updates_dialog.patch
|
||||
# Patches from Debian that:
|
||||
# - disable plugin installation (very insecure)
|
||||
# - 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;
|
||||
|
||||
prePatch = ''
|
||||
sed -i "/pyqt_sip_dir/ s:=.*:= '${pyqt5}/share/sip/PyQt5':" \
|
||||
setup/build_environment.py
|
||||
|
||||
# Remove unneeded files and libs
|
||||
rm -rf resources/calibre-portable.* \
|
||||
src/{chardet,cherrypy,html5lib,odf,routes}
|
||||
'';
|
||||
|
||||
dontUseQmakeConfigure = true;
|
||||
@ -34,14 +55,14 @@ stdenv.mkDerivation rec {
|
||||
|
||||
nativeBuildInputs = [ makeWrapper pkgconfig qmakeHook ];
|
||||
|
||||
buildInputs =
|
||||
[ python pyqt5 sip poppler_utils libpng imagemagick libjpeg
|
||||
buildInputs = [
|
||||
python pyqt5 sip poppler_utils libpng imagemagick libjpeg
|
||||
fontconfig podofo qtbase chmlib icu sqlite libusb1 libmtp xdg_utils
|
||||
pythonPackages.mechanize pythonPackages.lxml pythonPackages.dateutil
|
||||
pythonPackages.cssutils pythonPackages.beautifulsoup pythonPackages.pillow
|
||||
pythonPackages.sqlite3 pythonPackages.netifaces pythonPackages.apsw
|
||||
pythonPackages.cssselect
|
||||
];
|
||||
] ++ (with pythonPackages; [
|
||||
apsw beautifulsoup cssselect cssutils dateutil lxml mechanize netifaces pillow sqlite3
|
||||
# the following are distributed with calibre, but we use upstream instead
|
||||
chardet cherrypy html5lib odfpy routes
|
||||
]);
|
||||
|
||||
installPhase = ''
|
||||
export HOME=$TMPDIR/fakehome
|
||||
|
@ -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'))
|
@ -12527,7 +12527,7 @@ in
|
||||
|
||||
calcurse = callPackage ../applications/misc/calcurse { };
|
||||
|
||||
calibre = qt55.callPackage ../applications/misc/calibre {
|
||||
calibre = qt5.callPackage ../applications/misc/calibre {
|
||||
inherit (pythonPackages) pyqt5 sip;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user