mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-13 17:23:08 +00:00
681826c07b
Semi-automatic update generated by https://github.com/ryantm/nixpkgs-update tools. This update was made based on information from https://repology.org/metapackage/calibre/versions. These checks were done: - built on NixOS - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.calibre-wrapped_ passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/calibre passed the binary check. - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.calibre-complete-wrapped_ had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/calibre-complete had a zero exit code or showed the expected version - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.calibre-customize-wrapped_ passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/calibre-customize passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.calibre-debug-wrapped_ passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/calibre-debug passed the binary check. - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.calibre-parallel-wrapped_ had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/calibre-parallel had a zero exit code or showed the expected version - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.calibre-server-wrapped_ passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/calibre-server passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.calibre-smtp-wrapped_ passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/calibre-smtp passed the binary check. - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.calibre-uninstall-wrapped_ had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/calibre-uninstall had a zero exit code or showed the expected version - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.calibredb-wrapped_ passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/calibredb passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.ebook-convert-wrapped_ passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/ebook-convert passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.ebook-device-wrapped_ passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/ebook-device passed the binary check. - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.ebook-edit-wrapped_ had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/ebook-edit had a zero exit code or showed the expected version - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.ebook-meta-wrapped_ passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/ebook-meta passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.ebook-polish-wrapped_ passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/ebook-polish passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.ebook-viewer-wrapped_ passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/ebook-viewer passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.fetch-ebook-metadata-wrapped_ passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/fetch-ebook-metadata passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.lrf2lrs-wrapped_ passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/lrf2lrs passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.lrfviewer-wrapped_ passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/lrfviewer passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.lrs2lrf-wrapped_ passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/lrs2lrf passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.markdown-calibre-wrapped_ passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/markdown-calibre passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.web2disk-wrapped_ passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/web2disk passed the binary check. - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/..calibre-wrapped-wrapped had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.calibre-wrapped had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/..calibre-complete-wrapped-wrapped had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.calibre-complete-wrapped had a zero exit code or showed the expected version - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/..calibre-customize-wrapped-wrapped passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.calibre-customize-wrapped passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/..calibre-debug-wrapped-wrapped passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.calibre-debug-wrapped passed the binary check. - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/..calibre-parallel-wrapped-wrapped had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.calibre-parallel-wrapped had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/..calibre-server-wrapped-wrapped had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.calibre-server-wrapped had a zero exit code or showed the expected version - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/..calibre-smtp-wrapped-wrapped passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.calibre-smtp-wrapped passed the binary check. - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/..calibre-uninstall-wrapped-wrapped had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.calibre-uninstall-wrapped had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/..calibredb-wrapped-wrapped had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.calibredb-wrapped had a zero exit code or showed the expected version - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/..ebook-convert-wrapped-wrapped passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.ebook-convert-wrapped passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/..ebook-device-wrapped-wrapped passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.ebook-device-wrapped passed the binary check. - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/..ebook-edit-wrapped-wrapped had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.ebook-edit-wrapped had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/..ebook-meta-wrapped-wrapped had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.ebook-meta-wrapped had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/..ebook-polish-wrapped-wrapped had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.ebook-polish-wrapped had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/..ebook-viewer-wrapped-wrapped had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.ebook-viewer-wrapped had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/..fetch-ebook-metadata-wrapped-wrapped had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.fetch-ebook-metadata-wrapped had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/..lrf2lrs-wrapped-wrapped had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.lrf2lrs-wrapped had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/..lrfviewer-wrapped-wrapped had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.lrfviewer-wrapped had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/..lrs2lrf-wrapped-wrapped had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.lrs2lrf-wrapped had a zero exit code or showed the expected version - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/..markdown-calibre-wrapped-wrapped passed the binary check. - /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.markdown-calibre-wrapped passed the binary check. - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/..web2disk-wrapped-wrapped had a zero exit code or showed the expected version - Warning: no invocation of /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1/bin/.web2disk-wrapped had a zero exit code or showed the expected version - 46 of 84 passed binary check by having a zero exit code. - 0 of 84 passed binary check by having the new version present in output. - found 3.24.1 with grep in /nix/store/3683in7idrj8nn6fpnhg0jppp9s0w1x7-calibre-3.24.1 - directory tree listing: https://gist.github.com/a9dce8c8de61ed296eb9518301e3f630 - du listing: https://gist.github.com/7cd13b5c8a3bb9ebd6e52f9628f6646a
170 lines
5.5 KiB
Nix
170 lines
5.5 KiB
Nix
{ stdenv, fetchurl, fetchpatch, poppler_utils, pkgconfig, libpng
|
|
, imagemagick, libjpeg, fontconfig, podofo, qtbase, qmake, icu, sqlite
|
|
, makeWrapper, unrarSupport ? false, chmlib, python2Packages, xz, libusb1, libmtp
|
|
, xdg_utils, makeDesktopItem, wrapGAppsHook
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
version = "3.24.1";
|
|
name = "calibre-${version}";
|
|
|
|
src = fetchurl {
|
|
url = "https://download.calibre-ebook.com/${version}/${name}.tar.xz";
|
|
sha256 = "1hgjnw8ynvpcfry4vanz5f54sjq55pqidvyy47lz59cz0s8lx50b";
|
|
};
|
|
|
|
patches = [
|
|
# Patches from Debian that:
|
|
# - disable plugin installation (very insecure)
|
|
./disable_plugins.patch
|
|
# - switches the version update from enabled to disabled by default
|
|
./no_updates_dialog.patch
|
|
# the unrar patch is not from debian
|
|
] ++ stdenv.lib.optional (!unrarSupport) ./dont_build_unrar_plugin.patch;
|
|
|
|
prePatch = ''
|
|
sed -i "/pyqt_sip_dir/ s:=.*:= '${python2Packages.pyqt5}/share/sip/PyQt5':" \
|
|
setup/build_environment.py
|
|
|
|
# Remove unneeded files and libs
|
|
rm -rf resources/calibre-portable.* \
|
|
src/odf
|
|
'';
|
|
|
|
dontUseQmakeConfigure = true;
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
nativeBuildInputs = [ makeWrapper pkgconfig qmake ];
|
|
|
|
buildInputs = [
|
|
poppler_utils libpng imagemagick libjpeg
|
|
fontconfig podofo qtbase chmlib icu sqlite libusb1 libmtp xdg_utils wrapGAppsHook
|
|
] ++ (with python2Packages; [
|
|
apsw cssselect cssutils dateutil dnspython html5-parser lxml mechanize netifaces pillow
|
|
python pyqt5 sip
|
|
regex msgpack
|
|
# the following are distributed with calibre, but we use upstream instead
|
|
odfpy
|
|
]);
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
export HOME=$TMPDIR/fakehome
|
|
export POPPLER_INC_DIR=${poppler_utils.dev}/include/poppler
|
|
export POPPLER_LIB_DIR=${poppler_utils.out}/lib
|
|
export MAGICK_INC=${imagemagick.dev}/include/ImageMagick
|
|
export MAGICK_LIB=${imagemagick.out}/lib
|
|
export FC_INC_DIR=${fontconfig.dev}/include/fontconfig
|
|
export FC_LIB_DIR=${fontconfig.lib}/lib
|
|
export PODOFO_INC_DIR=${podofo}/include/podofo
|
|
export PODOFO_LIB_DIR=${podofo}/lib
|
|
export SIP_BIN=${python2Packages.sip}/bin/sip
|
|
${python2Packages.python.interpreter} setup.py install --prefix=$out
|
|
|
|
PYFILES="$out/bin/* $out/lib/calibre/calibre/web/feeds/*.py
|
|
$out/lib/calibre/calibre/ebooks/metadata/*.py
|
|
$out/lib/calibre/calibre/ebooks/rtf2xml/*.py"
|
|
|
|
sed -i "s/env python[0-9.]*/python/" $PYFILES
|
|
sed -i "2i import sys; sys.argv[0] = 'calibre'" $out/bin/calibre
|
|
|
|
for a in $out/bin/*; do
|
|
wrapProgram $a --prefix PYTHONPATH : $PYTHONPATH \
|
|
--prefix PATH : ${poppler_utils.out}/bin
|
|
done
|
|
|
|
# Replace @out@ by the output path.
|
|
mkdir -p $out/share/applications/
|
|
cp {$calibreDesktopItem,$ebookEditDesktopItem,$ebookViewerDesktopItem}/share/applications/* $out/share/applications/
|
|
for entry in $out/share/applications/*.desktop; do
|
|
substituteAllInPlace $entry
|
|
done
|
|
|
|
mkdir -p $out/share
|
|
cp -a man-pages $out/share/man
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
calibreDesktopItem = makeDesktopItem {
|
|
name = "calibre";
|
|
desktopName = "calibre";
|
|
exec = "@out@/bin/calibre --detach %F";
|
|
genericName = "E-book library management";
|
|
icon = "@out@/share/calibre/images/library.png";
|
|
comment = "Manage, convert, edit, and read e-books";
|
|
mimeType = stdenv.lib.concatStringsSep ";" [
|
|
"application/x-mobipocket-subscription"
|
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
|
"text/html"
|
|
"application/x-cbc"
|
|
"application/ereader"
|
|
"application/oebps-package+xml"
|
|
"image/vnd.djvu"
|
|
"application/x-sony-bbeb"
|
|
"application/vnd.ms-word.document.macroenabled.12"
|
|
"text/rtf"
|
|
"text/x-markdown"
|
|
"application/pdf"
|
|
"application/x-cbz"
|
|
"application/x-mobipocket-ebook"
|
|
"application/x-cbr"
|
|
"application/x-mobi8-ebook"
|
|
"text/fb2+xml"
|
|
"application/vnd.oasis.opendocument.text"
|
|
"application/epub+zip"
|
|
"text/plain"
|
|
"application/xhtml+xml"
|
|
];
|
|
categories = "Office";
|
|
extraEntries = ''
|
|
Actions=Edit;Viewer;
|
|
|
|
[Desktop Action Edit]
|
|
Name=Edit E-book
|
|
Icon=@out@/share/calibre/images/tweak.png
|
|
Exec=@out@/bin/ebook-edit --detach %F
|
|
|
|
[Desktop Action Viewer]
|
|
Name=E-book Viewer
|
|
Icon=@out@/share/calibre/images/viewer.png
|
|
Exec=@out@/bin/ebook-viewer --detach %F
|
|
'';
|
|
};
|
|
|
|
ebookEditDesktopItem = makeDesktopItem {
|
|
name = "calibre-edit-ebook";
|
|
desktopName = "Edit E-book";
|
|
genericName = "E-book Editor";
|
|
comment = "Edit e-books";
|
|
icon = "@out@/share/calibre/images/tweak.png";
|
|
exec = "@out@/bin/ebook-edit --detach %F";
|
|
categories = "Office;Publishing";
|
|
mimeType = "application/epub+zip";
|
|
extraEntries = "NoDisplay=true";
|
|
};
|
|
|
|
ebookViewerDesktopItem = makeDesktopItem {
|
|
name = "calibre-ebook-viewer";
|
|
desktopName = "E-book Viewer";
|
|
genericName = "E-book Viewer";
|
|
comment = "Read e-books in all the major formats";
|
|
icon = "@out@/share/calibre/images/viewer.png";
|
|
exec = "@out@/bin/ebook-viewer --detach %F";
|
|
categories = "Office;Viewer";
|
|
mimeType = "application/epub+zip";
|
|
extraEntries = "NoDisplay=true";
|
|
};
|
|
|
|
meta = with stdenv.lib; {
|
|
description = "Comprehensive e-book software";
|
|
homepage = https://calibre-ebook.com;
|
|
license = with licenses; if unrarSupport then unfreeRedistributable else gpl3;
|
|
maintainers = with maintainers; [ viric domenkozar pSub AndersonTorres ];
|
|
platforms = platforms.linux;
|
|
inherit version;
|
|
};
|
|
}
|