# Description: Ebook manager # URL: https://calibre-ebook.com/download_linux # Maintainer: Petar Petrov, slackalaxy at gmail dot com # Depends on: brotli double-conversion graphite2 icu keyutils krb5 libdeflate libgpg-error libinput libxslt lua nss openjpeg2 pulseaudio qt6-multimedia snowball wayland name=calibre version=9.9.0 release=1 source=(https://download.calibre-ebook.com/$version/calibre-$version-x86_64.txz $name.desktop) build() { mkdir -p $PKG/usr/{bin,lib/calibre} cp -a $SRC/* $PKG/usr/lib/calibre/ # Actually, we don't need this rm -rf $PKG/usr/lib/calibre/translations mkdir -p $PKG/usr/share/{applications,pixmaps} cp $SRC/$name.desktop $PKG/usr/share/applications cp resources/content-server/calibre.png $PKG/usr/share/pixmaps/$name.png cd $PKG/usr/bin ln -s ../lib/calibre/calibre $name # remove the PDF-related extensions rm -f $PKG/usr/lib/calibre/lib/calibre-extensions/PyQt6.QtPdf* rm -f $PKG/usr/lib/calibre/lib/calibre-extensions/PyQt6.QtPdfWidgets* # remove the PDF image plugin rm -f $PKG/usr/lib/calibre/plugins/imageformats/libqpdf.so # remove TTS plugins rm -rf $PKG/usr/lib/calibre/plugins/texttospeech/ # https://stackoverflow.com/questions/539583/how-do-i-recursively-list-all-directories-at-a-location-breadth-first mkdir -p $PKG/etc/revdep.d cd $PKG/usr/lib/calibre find . -type d | perl -lne 'print tr:/::, " $_"' | sort -n | cut -d' ' -f2 > $PKG/etc/revdep.d/$name sed -i "s:\.:/usr/lib/calibre:g" $PKG/etc/revdep.d/$name }