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