Merge pull request #194912 from kilianar/calibre-6.6.1

This commit is contained in:
Bernardo Meurer 2022-10-07 15:41:30 -03:00 committed by GitHub
commit 38d63e5b0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 28 deletions

View file

@ -1,37 +1,40 @@
{ lib
, mkDerivation
, stdenv
, fetchurl
, cmake
, fetchpatch
, poppler_utils
, pkg-config
, libpng
, imagemagick
, libjpeg
, fontconfig
, podofo
, qtbase
, qmake
, icu
, sqlite
, hunspell
, hyphen
, unrarSupport ? false
, python3Packages
, libusb1
, icu
, imagemagick
, libjpeg
, libmtp
, xdg-utils
, removeReferencesTo
, libpng
, libstemmer
, wrapGAppsHook
, libuchardet
, libusb1
, pkg-config
, podofo
, poppler_utils
, python3Packages
, qmake
, qtbase
, qtwayland
, removeReferencesTo
, sqlite
, wrapQtAppsHook
, xdg-utils
, unrarSupport ? false
}:
mkDerivation rec {
stdenv.mkDerivation rec {
pname = "calibre";
version = "5.44.0";
version = "6.6.1";
src = fetchurl {
url = "https://download.calibre-ebook.com/${version}/${pname}-${version}.tar.xz";
hash = "sha256-b/qj6v02okNV5ZV/D4ONttttNFbPoXy00Tn9lOuviOw=";
hash = "sha256-jJMHliPTRqiI4Wx5N9qbSryoARcGBisSq6awXIaTk5g=";
};
# https://sources.debian.org/patches/calibre/${version}+dfsg-1
@ -40,18 +43,18 @@ mkDerivation rec {
(fetchpatch {
name = "0001-only-plugin-update.patch";
url = "https://raw.githubusercontent.com/debian-calibre/calibre/debian/${version}%2Bdfsg-1/debian/patches/0001-only-plugin-update.patch";
sha256 = "sha256-dLzO1TWP7Q4nw2a3oN7qlhGCmcA0NKJrZidUnD6hUMA=";
hash = "sha256-uL1mSjgCl5ZRLbSuKxJM6XTfvVwog70F7vgKtQzQNEQ=";
})
(fetchpatch {
name = "0006-Hardening-Qt-code.patch";
url = "https://raw.githubusercontent.com/debian-calibre/calibre/debian/${version}%2Bdfsg-1/debian/patches/0006-Hardening-Qt-code.patch";
sha256 = "sha256-/X6iZZFxv4793h2yYI3UAz0mLNEmKpdVrmOnABFT0tE=";
hash = "sha256-CutVTb7K4tjewq1xAjHEGUHFcuuP/Z4FFtj4xQb4zKQ=";
})
]
++ lib.optional (!unrarSupport) ./dont_build_unrar_plugin.patch;
prePatch = ''
sed -i "s@\[tool.sip.project\]@[tool.sip.project]\nsip-include-dirs = [\"${python3Packages.pyqt5}/${python3Packages.python.sitePackages}/PyQt5/bindings\"]@g" \
sed -i "s@\[tool.sip.project\]@[tool.sip.project]\nsip-include-dirs = [\"${python3Packages.pyqt6}/${python3Packages.python.sitePackages}/PyQt6/bindings\"]@g" \
setup/build.py
sed -i "s/\[tool.sip.bindings.pictureflow\]/[tool.sip.bindings.pictureflow]\ntags = [\"${python3Packages.sip.platform_tag}\"]/g" \
setup/build.py
@ -61,8 +64,15 @@ mkDerivation rec {
'';
dontUseQmakeConfigure = true;
dontUseCmakeConfigure = true;
nativeBuildInputs = [ pkg-config qmake removeReferencesTo wrapGAppsHook ];
nativeBuildInputs = [
cmake
pkg-config
qmake
removeReferencesTo
wrapQtAppsHook
];
buildInputs = [
fontconfig
@ -74,10 +84,12 @@ mkDerivation rec {
libmtp
libpng
libstemmer
libuchardet
libusb1
podofo
poppler_utils
qtbase
qtwayland
sqlite
xdg-utils
] ++ (
@ -102,7 +114,7 @@ mkDerivation rec {
pillow
pychm
pyqt-builder
pyqt5
pyqt6
python
regex
sip
@ -166,8 +178,7 @@ mkDerivation rec {
$out/lib/calibre/calibre/plugins/podofo.so
for program in $out/bin/*; do
wrapProgram $program \
''${qtWrapperArgs[@]} \
wrapQtApp $program \
--prefix PYTHONPATH : $PYTHONPATH \
--prefix PATH : ${poppler_utils.out}/bin
done

View file

@ -27153,7 +27153,7 @@ with pkgs;
calculix = callPackage ../applications/science/math/calculix {};
calibre = libsForQt5.callPackage ../applications/misc/calibre { };
calibre = qt6Packages.callPackage ../applications/misc/calibre { };
calibre-web = callPackage ../servers/calibre-web { };