mirror of
https://gitdl.cn/https://github.com/chakralinux/desktop.git
synced 2025-01-25 02:52:13 +08:00
82 lines
3.0 KiB
Bash
82 lines
3.0 KiB
Bash
# maintainer: almack
|
|
|
|
pkgname=calibre
|
|
pkgver=1.18.0
|
|
pkgrel=1
|
|
pkgdesc="Ebook management application"
|
|
arch=('x86_64')
|
|
url="http://calibre.kovidgoyal.net/"
|
|
license=('GPL3')
|
|
depends=('python2' 'python2-imaging' 'libusb' 'python2-pyqt4' 'python-mechanize'
|
|
'imagemagick' 'python2-dbus' 'python-lxml' 'python2-beautifulsoup' 'python2-dateutil'
|
|
'python2-cssutils' 'desktop-file-utils' 'python2-dns' 'libmtp'
|
|
'podofo' 'xdg-utils' 'cherrypy' 'python2-pdf' 'unrar' 'chmlib' 'poppler'
|
|
'poppler-qt' 'icu' 'libwmf' 'libffi' 'python2-six' 'python2-netifaces' 'python2-cssselect'
|
|
'python2-apsw')
|
|
makedepends=('python2-pycountry' 'qt-private-headers')
|
|
#optdepends=('ipython: to use calibre-debug')
|
|
screenshot=('https://lh5.googleusercontent.com/_lG58t3XWd3c/TcNwiXkAx_I/AAAAAAAAAEc/M34I4uY9UUY/s800/gui.jpeg')
|
|
install=${pkgname}.install
|
|
source=("http://download.calibre-ebook.com/${pkgver}/${pkgname}-${pkgver}.tar.xz"
|
|
'desktop_integration.patch'
|
|
'calibre-mount-helper')
|
|
sha256sums=('e13270258e17afb833c7cfeb688a66996843a349ee3ba552a0746f681955763d'
|
|
'3ae593b04ae928702837054df1d1598d63f3d4a9b474afca0a4024aaaab2d5fa'
|
|
'1cdbd23edfea0b08f7bd089e3302ca9601737aac18537406f0408b449aea32d1')
|
|
|
|
prepare() {
|
|
cd ${pkgname}
|
|
|
|
rm -rf src/cherrypy
|
|
rm -rf resources/${pkgname}-portable.*
|
|
mkdir -p src/calibre/plugins
|
|
|
|
sed -i -e "s/ldflags = shlex.split(ldflags)/ldflags = shlex.split(ldflags) + ['-fPIC']/" \
|
|
setup/extensions.py
|
|
|
|
# Fix for shebang in meta.py
|
|
sed -i -e "s:#!usr:#!/usr:g" src/calibre/ebooks/markdown/extensions/meta.py
|
|
|
|
sed -i -e 's:\(#!/usr/bin/env[ ]\+python$\|#!/usr/bin/python$\):\12:g' \
|
|
$(find . -regex ".*.py\|.*.recipe")
|
|
}
|
|
|
|
build() {
|
|
cd ${pkgname}
|
|
|
|
python2 setup.py build
|
|
python2 setup.py translations
|
|
}
|
|
|
|
package() {
|
|
cd ${pkgname}
|
|
|
|
patch -uN src/calibre/linux.py "${srcdir}/desktop_integration.patch"
|
|
|
|
# More on desktop integration (e.g. enforce Chakra defaults)
|
|
sed -i -e "/self.create_uninstaller()/,/os.rmdir(config_dir)/d" \
|
|
-e "s|self.opts.staging_sharedir, 'man/man1'|self.opts.staging_root, 'usr/share/man/man1'|" \
|
|
-e "s|manpath, prog+'.1'+__appname__+'.bz2'|manpath, prog+'.1'+'.bz2'|" \
|
|
-e "s|old_udev = '/etc|old_udev = '${pkgdir}/etc|" \
|
|
-e "s/^Name=calibre/Name=Calibre/g" src/calibre/linux.py
|
|
|
|
# Fix the environment module location
|
|
sed -i -e "s|(prefix=.*)|(prefix='$pkgdir/usr')|g" setup/install.py
|
|
|
|
install -d "${pkgdir}/usr/lib/python2.7/site-packages"
|
|
install -d "${pkgdir}/usr/share/zsh/site-functions"
|
|
python2 setup.py install --root="${pkgdir}" --prefix=/usr \
|
|
--staging-bindir="${pkgdir}/usr/bin" \
|
|
--staging-libdir="${pkgdir}/usr/lib" \
|
|
--staging-sharedir="${pkgdir}/usr/share"
|
|
|
|
find "${pkgdir}" -type d -empty -delete
|
|
|
|
# See http://lwn.net/SubscriberLink/465311/7c299471a5399167/
|
|
rm -rf "${pkgdir}/usr/bin/calibre-mount-helper"
|
|
install -m 755 "${srcdir}/calibre-mount-helper" "${pkgdir}/usr/bin"
|
|
|
|
python2 -m compileall "${pkgdir}/usr/lib/calibre/"
|
|
python2 -O -m compileall "${pkgdir}/usr/lib/calibre/"
|
|
}
|