Merge pull request #97270 from peterhoeg/f/calibre_py3

calibre: build with py3 by default

authored by

Peter Hoeg and committed by
GitHub
745d47ef 90ee9e63

+32 -35
+27 -34
pkgs/applications/misc/calibre/default.nix
··· 16 16 , hyphen 17 17 , unrarSupport ? false 18 18 , chmlib 19 - , python2Packages 19 + , pythonPackages 20 20 , libusb1 21 21 , libmtp 22 22 , xdg_utils ··· 24 24 , removeReferencesTo 25 25 }: 26 26 27 - let 28 - pypkgs = python2Packages; 29 - 30 - in 31 27 mkDerivation rec { 32 28 pname = "calibre"; 33 - version = "4.22.0"; 29 + version = "4.23.0"; 34 30 35 31 src = fetchurl { 36 32 url = "https://download.calibre-ebook.com/${version}/${pname}-${version}.tar.xz"; 37 - sha256 = "0d0wmd3ijk8px1d662igal4lfmpyzynfzs6ms1bb9nf42mq2pxai"; 33 + sha256 = "sha256-Ft5RRzzw4zb5RqVyUaHk9Pu6H4V/F9j8FKoTLn61lRg="; 38 34 }; 39 35 40 36 patches = [ ··· 47 43 ] ++ lib.optional (!unrarSupport) ./dont_build_unrar_plugin.patch; 48 44 49 45 prePatch = '' 50 - sed -i "/pyqt_sip_dir/ s:=.*:= '${pypkgs.pyqt5}/share/sip/PyQt5':" \ 46 + sed -i "/pyqt_sip_dir/ s:=.*:= '${pythonPackages.pyqt5}/share/sip/PyQt5':" \ 51 47 setup/build_environment.py 52 48 53 49 # Remove unneeded files and libs ··· 61 57 62 58 nativeBuildInputs = [ pkgconfig qmake removeReferencesTo ]; 63 59 64 - CALIBRE_PY3_PORT = builtins.toString pypkgs.isPy3k; 60 + CALIBRE_PY3_PORT = builtins.toString pythonPackages.isPy3k; 65 61 66 62 buildInputs = [ 67 - poppler_utils 68 - libpng 63 + chmlib 64 + fontconfig 65 + hunspell 66 + hyphen 67 + icu 69 68 imagemagick 70 69 libjpeg 71 - fontconfig 70 + libmtp 71 + libpng 72 + libusb1 72 73 podofo 74 + poppler_utils 73 75 qtbase 74 - chmlib 75 - icu 76 - hunspell 77 - hyphen 78 76 sqlite 79 - libusb1 80 - libmtp 81 77 xdg_utils 82 78 ] ++ ( 83 - with pypkgs; [ 79 + with pythonPackages; [ 84 80 apsw 85 - cssselect 81 + beautifulsoup4 86 82 css-parser 83 + cssselect 87 84 dateutil 88 85 dnspython 89 86 feedparser 87 + html2text 90 88 html5-parser 91 89 lxml 92 90 markdown 91 + mechanize 92 + msgpack 93 93 netifaces 94 94 pillow 95 - python 96 95 pyqt5 97 - sip 98 - regex 99 - msgpack 100 - beautifulsoup4 101 - html2text 102 96 pyqtwebengine 97 + python 98 + regex 99 + sip 103 100 # the following are distributed with calibre, but we use upstream instead 104 101 odfpy 105 - ] 106 - ) ++ lib.optionals (!pypkgs.isPy3k) ( 107 - with pypkgs; [ 108 - mechanize 109 102 ] 110 103 ); 111 104 ··· 121 114 export FC_LIB_DIR=${fontconfig.lib}/lib 122 115 export PODOFO_INC_DIR=${podofo.dev}/include/podofo 123 116 export PODOFO_LIB_DIR=${podofo.lib}/lib 124 - export SIP_BIN=${pypkgs.sip}/bin/sip 117 + export SIP_BIN=${pythonPackages.sip}/bin/sip 125 118 export XDG_DATA_HOME=$out/share 126 119 export XDG_UTILS_INSTALL_MODE="user" 127 120 128 - ${pypkgs.python.interpreter} setup.py install --root=$out \ 121 + ${pythonPackages.python.interpreter} setup.py install --root=$out \ 129 122 --prefix=$out \ 130 123 --libdir=$out/lib \ 131 124 --staging-root=$out \ 132 125 --staging-libdir=$out/lib \ 133 126 --staging-sharedir=$out/share 134 - 135 127 136 128 PYFILES="$out/bin/* $out/lib/calibre/calibre/web/feeds/*.py 137 129 $out/lib/calibre/calibre/ebooks/metadata/*.py ··· 154 146 # 2018-11-06) was a single string like the following: 155 147 # /nix/store/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-podofo-0.9.6-dev/include/podofo/base/PdfVariant.h 156 148 preFixup = '' 157 - remove-references-to -t ${podofo.dev} $out/lib/calibre/calibre/plugins/podofo.so 149 + remove-references-to -t ${podofo.dev} \ 150 + $out/lib/calibre/calibre/plugins${lib.optionalString pythonPackages.isPy3k "/3"}/podofo.so 158 151 159 152 for program in $out/bin/*; do 160 153 wrapProgram $program \
+5 -1
pkgs/top-level/all-packages.nix
··· 19701 19701 19702 19702 calculix = callPackage ../applications/science/math/calculix {}; 19703 19703 19704 - calibre = libsForQt5.callPackage ../applications/misc/calibre { }; 19704 + calibre-py2 = libsForQt5.callPackage ../applications/misc/calibre { pythonPackages = python2Packages; }; 19705 + 19706 + calibre-py3 = libsForQt5.callPackage ../applications/misc/calibre { pythonPackages = python3Packages; }; 19707 + 19708 + calibre = self.calibre-py3; 19705 19709 19706 19710 calligra = libsForQt5.callPackage ../applications/office/calligra { 19707 19711 inherit (kdeApplications) akonadi-calendar akonadi-contacts;