Merge pull request #97270 from peterhoeg/f/calibre_py3
calibre: build with py3 by default
This commit is contained in:
commit
745d47ef38
@ -16,7 +16,7 @@
|
|||||||
, hyphen
|
, hyphen
|
||||||
, unrarSupport ? false
|
, unrarSupport ? false
|
||||||
, chmlib
|
, chmlib
|
||||||
, python2Packages
|
, pythonPackages
|
||||||
, libusb1
|
, libusb1
|
||||||
, libmtp
|
, libmtp
|
||||||
, xdg_utils
|
, xdg_utils
|
||||||
@ -24,17 +24,13 @@
|
|||||||
, removeReferencesTo
|
, removeReferencesTo
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
|
||||||
pypkgs = python2Packages;
|
|
||||||
|
|
||||||
in
|
|
||||||
mkDerivation rec {
|
mkDerivation rec {
|
||||||
pname = "calibre";
|
pname = "calibre";
|
||||||
version = "4.22.0";
|
version = "4.23.0";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://download.calibre-ebook.com/${version}/${pname}-${version}.tar.xz";
|
url = "https://download.calibre-ebook.com/${version}/${pname}-${version}.tar.xz";
|
||||||
sha256 = "0d0wmd3ijk8px1d662igal4lfmpyzynfzs6ms1bb9nf42mq2pxai";
|
sha256 = "sha256-Ft5RRzzw4zb5RqVyUaHk9Pu6H4V/F9j8FKoTLn61lRg=";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
@ -47,7 +43,7 @@ mkDerivation rec {
|
|||||||
] ++ lib.optional (!unrarSupport) ./dont_build_unrar_plugin.patch;
|
] ++ lib.optional (!unrarSupport) ./dont_build_unrar_plugin.patch;
|
||||||
|
|
||||||
prePatch = ''
|
prePatch = ''
|
||||||
sed -i "/pyqt_sip_dir/ s:=.*:= '${pypkgs.pyqt5}/share/sip/PyQt5':" \
|
sed -i "/pyqt_sip_dir/ s:=.*:= '${pythonPackages.pyqt5}/share/sip/PyQt5':" \
|
||||||
setup/build_environment.py
|
setup/build_environment.py
|
||||||
|
|
||||||
# Remove unneeded files and libs
|
# Remove unneeded files and libs
|
||||||
@ -61,52 +57,49 @@ mkDerivation rec {
|
|||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig qmake removeReferencesTo ];
|
nativeBuildInputs = [ pkgconfig qmake removeReferencesTo ];
|
||||||
|
|
||||||
CALIBRE_PY3_PORT = builtins.toString pypkgs.isPy3k;
|
CALIBRE_PY3_PORT = builtins.toString pythonPackages.isPy3k;
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
poppler_utils
|
|
||||||
libpng
|
|
||||||
imagemagick
|
|
||||||
libjpeg
|
|
||||||
fontconfig
|
|
||||||
podofo
|
|
||||||
qtbase
|
|
||||||
chmlib
|
chmlib
|
||||||
icu
|
fontconfig
|
||||||
hunspell
|
hunspell
|
||||||
hyphen
|
hyphen
|
||||||
sqlite
|
icu
|
||||||
libusb1
|
imagemagick
|
||||||
|
libjpeg
|
||||||
libmtp
|
libmtp
|
||||||
|
libpng
|
||||||
|
libusb1
|
||||||
|
podofo
|
||||||
|
poppler_utils
|
||||||
|
qtbase
|
||||||
|
sqlite
|
||||||
xdg_utils
|
xdg_utils
|
||||||
] ++ (
|
] ++ (
|
||||||
with pypkgs; [
|
with pythonPackages; [
|
||||||
apsw
|
apsw
|
||||||
cssselect
|
beautifulsoup4
|
||||||
css-parser
|
css-parser
|
||||||
|
cssselect
|
||||||
dateutil
|
dateutil
|
||||||
dnspython
|
dnspython
|
||||||
feedparser
|
feedparser
|
||||||
|
html2text
|
||||||
html5-parser
|
html5-parser
|
||||||
lxml
|
lxml
|
||||||
markdown
|
markdown
|
||||||
|
mechanize
|
||||||
|
msgpack
|
||||||
netifaces
|
netifaces
|
||||||
pillow
|
pillow
|
||||||
python
|
|
||||||
pyqt5
|
pyqt5
|
||||||
sip
|
|
||||||
regex
|
|
||||||
msgpack
|
|
||||||
beautifulsoup4
|
|
||||||
html2text
|
|
||||||
pyqtwebengine
|
pyqtwebengine
|
||||||
|
python
|
||||||
|
regex
|
||||||
|
sip
|
||||||
# the following are distributed with calibre, but we use upstream instead
|
# the following are distributed with calibre, but we use upstream instead
|
||||||
odfpy
|
odfpy
|
||||||
]
|
]
|
||||||
) ++ lib.optionals (!pypkgs.isPy3k) (
|
|
||||||
with pypkgs; [
|
|
||||||
mechanize
|
|
||||||
]
|
|
||||||
);
|
);
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
@ -121,18 +114,17 @@ mkDerivation rec {
|
|||||||
export FC_LIB_DIR=${fontconfig.lib}/lib
|
export FC_LIB_DIR=${fontconfig.lib}/lib
|
||||||
export PODOFO_INC_DIR=${podofo.dev}/include/podofo
|
export PODOFO_INC_DIR=${podofo.dev}/include/podofo
|
||||||
export PODOFO_LIB_DIR=${podofo.lib}/lib
|
export PODOFO_LIB_DIR=${podofo.lib}/lib
|
||||||
export SIP_BIN=${pypkgs.sip}/bin/sip
|
export SIP_BIN=${pythonPackages.sip}/bin/sip
|
||||||
export XDG_DATA_HOME=$out/share
|
export XDG_DATA_HOME=$out/share
|
||||||
export XDG_UTILS_INSTALL_MODE="user"
|
export XDG_UTILS_INSTALL_MODE="user"
|
||||||
|
|
||||||
${pypkgs.python.interpreter} setup.py install --root=$out \
|
${pythonPackages.python.interpreter} setup.py install --root=$out \
|
||||||
--prefix=$out \
|
--prefix=$out \
|
||||||
--libdir=$out/lib \
|
--libdir=$out/lib \
|
||||||
--staging-root=$out \
|
--staging-root=$out \
|
||||||
--staging-libdir=$out/lib \
|
--staging-libdir=$out/lib \
|
||||||
--staging-sharedir=$out/share
|
--staging-sharedir=$out/share
|
||||||
|
|
||||||
|
|
||||||
PYFILES="$out/bin/* $out/lib/calibre/calibre/web/feeds/*.py
|
PYFILES="$out/bin/* $out/lib/calibre/calibre/web/feeds/*.py
|
||||||
$out/lib/calibre/calibre/ebooks/metadata/*.py
|
$out/lib/calibre/calibre/ebooks/metadata/*.py
|
||||||
$out/lib/calibre/calibre/ebooks/rtf2xml/*.py"
|
$out/lib/calibre/calibre/ebooks/rtf2xml/*.py"
|
||||||
@ -154,7 +146,8 @@ mkDerivation rec {
|
|||||||
# 2018-11-06) was a single string like the following:
|
# 2018-11-06) was a single string like the following:
|
||||||
# /nix/store/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-podofo-0.9.6-dev/include/podofo/base/PdfVariant.h
|
# /nix/store/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-podofo-0.9.6-dev/include/podofo/base/PdfVariant.h
|
||||||
preFixup = ''
|
preFixup = ''
|
||||||
remove-references-to -t ${podofo.dev} $out/lib/calibre/calibre/plugins/podofo.so
|
remove-references-to -t ${podofo.dev} \
|
||||||
|
$out/lib/calibre/calibre/plugins${lib.optionalString pythonPackages.isPy3k "/3"}/podofo.so
|
||||||
|
|
||||||
for program in $out/bin/*; do
|
for program in $out/bin/*; do
|
||||||
wrapProgram $program \
|
wrapProgram $program \
|
||||||
|
@ -19701,7 +19701,11 @@ in
|
|||||||
|
|
||||||
calculix = callPackage ../applications/science/math/calculix {};
|
calculix = callPackage ../applications/science/math/calculix {};
|
||||||
|
|
||||||
calibre = libsForQt5.callPackage ../applications/misc/calibre { };
|
calibre-py2 = libsForQt5.callPackage ../applications/misc/calibre { pythonPackages = python2Packages; };
|
||||||
|
|
||||||
|
calibre-py3 = libsForQt5.callPackage ../applications/misc/calibre { pythonPackages = python3Packages; };
|
||||||
|
|
||||||
|
calibre = self.calibre-py3;
|
||||||
|
|
||||||
calligra = libsForQt5.callPackage ../applications/office/calligra {
|
calligra = libsForQt5.callPackage ../applications/office/calligra {
|
||||||
inherit (kdeApplications) akonadi-calendar akonadi-contacts;
|
inherit (kdeApplications) akonadi-calendar akonadi-contacts;
|
||||||
|
Loading…
Reference in New Issue
Block a user