desktop/calibre/PKGBUILD

86 lines
3.2 KiB
Bash
Raw Normal View History

2015-01-11 14:47:09 +08:00
# Maintainer: Jeff Huang <s8321414[at]gmail[dot]com>
# Contributer: UtG <utg[dot]chakra.linux[at]gmail[dot]com>
2010-11-19 20:36:49 +08:00
pkgname=calibre
2015-01-11 14:47:09 +08:00
pkgver=2.16.0
2014-09-03 12:55:09 +08:00
pkgrel=1
pkgdesc="Ebook management application"
arch=('x86_64')
2010-11-19 20:36:49 +08:00
url="http://calibre.kovidgoyal.net/"
license=('GPL3')
2014-09-03 12:55:09 +08:00
depends=('python2-six' 'python2-dateutil' 'python2-cssutils' 'python2-cherrypy'
'python2-mechanize' 'podofo' 'libwmf'
'imagemagick' 'chmlib' 'python2-lxml' 'libusb'
'python2-pillow' 'shared-mime-info' 'python2-dns'
2014-12-22 21:00:54 +08:00
'python2-pyqt5' 'python2-psutil' 'icu' 'libmtp' 'python2-dbus'
2014-09-03 12:55:09 +08:00
'python2-netifaces' 'python2-cssselect' 'python2-apsw' 'qt5-webkit'
2014-12-22 21:00:54 +08:00
'qt5-svg' 'python2-chardet' 'python2-html5lib' 'python2-pygments')
2014-09-03 12:55:09 +08:00
makedepends=('python2-pycountry' 'qt5-x11extras')
2014-08-10 19:18:07 +08:00
#optdepends=('ipython2: to use calibre-debug')
2012-04-21 01:20:22 +08:00
screenshot=('https://lh5.googleusercontent.com/_lG58t3XWd3c/TcNwiXkAx_I/AAAAAAAAAEc/M34I4uY9UUY/s800/gui.jpeg')
2013-08-24 19:34:53 +08:00
install=${pkgname}.install
2014-08-21 13:08:31 +08:00
source=("http://download.calibre-ebook.com/${pkgver}/${pkgname}-${pkgver}.tar.xz")
2015-01-03 13:34:39 +08:00
sha256sums=('bac0f627eaf4fa1d03e1b7b27110f723c81cc790855888ff4031e93e776a02bf')
2014-06-26 03:39:27 +08:00
2013-08-24 19:34:53 +08:00
prepare() {
2014-09-03 12:55:09 +08:00
cd ${pkgname}-${pkgver}
2010-11-19 20:36:49 +08:00
2014-08-10 19:18:07 +08:00
# Remove unneded files an libs
2014-09-03 12:55:09 +08:00
rm -rf src/cherrypy
#src/six.py \
#src/chardet \
#src/html5lib
2013-05-12 07:51:11 +08:00
rm -rf resources/${pkgname}-portable.*
2013-09-21 04:31:39 +08:00
2014-09-03 12:55:09 +08:00
sed -i -e "s/shlex.split(ldflags)/& + ['-fPIC']/" setup/extensions.py
2013-09-21 04:31:39 +08:00
2014-09-03 12:55:09 +08:00
sed -i 's:\(env[ ]\+python$\|/usr/bin/python$\):\12:g' \
$(find . -regex ".*\.py\|.*\.recipe")
sed -i "/pyqt_sip_dir/ s:=.*:= '/usr/share/sip/Py2-PyQt5':" setup/build_environment.py
2014-08-10 19:18:07 +08:00
# Desktop integration (e.g. enforce arch defaults)
sed -e "/self.create_uninstaller()/,/os.rmdir(config_dir)/d" \
-e "/\(cc('xdg-icon-resource\|self.icon_resources.append\|'128'))\)/d" \
-e "/render_img/ s/\('calibre-.*\.png'\)/os.path.join(dir, \1)/g" \
-e "/dir, 'calibre-lrf.png'/i \
\ dir = os.path.join(self.opts.staging_sharedir,'../pixmaps')\n\
\ os.mkdir(dir)" \
-e "/f = open/ s/\('calibre-.*\.desktop'\)/os.path.join(dir, \1)/g" \
-e "/dir, 'calibre-lrfviewer.desktop'/i \
\ dir = os.path.join(self.opts.staging_sharedir,'../applications')\n\
\ os.mkdir(dir)" \
-e "s/'ctc-posml'/'text' not in mt and 'pdf' not in mt and 'xhtml'/" \
-e "s/^Name=calibre/Name=Calibre/g" \
-i src/calibre/linux.py
2013-08-24 19:34:53 +08:00
}
2013-08-24 19:34:53 +08:00
build() {
2014-09-03 12:55:09 +08:00
cd ${pkgname}-${pkgver}
2013-08-24 19:34:53 +08:00
2014-08-10 19:18:07 +08:00
LANG=en_US.UTF-8 python2 setup.py build
LANG=en_US.UTF-8 python2 setup.py translations
2010-11-19 20:36:49 +08:00
}
package() {
2014-09-03 12:55:09 +08:00
cd ${pkgname}-${pkgver}
2012-05-26 06:02:26 +08:00
2011-03-09 20:23:16 +08:00
# Fix the environment module location
2014-08-10 19:18:07 +08:00
sed -i -e "s|(prefix=.*)|(prefix='${pkgdir}/usr')|g" setup/install.py
2010-11-19 20:36:49 +08:00
2013-08-24 19:34:53 +08:00
install -d "${pkgdir}/usr/lib/python2.7/site-packages"
install -d "${pkgdir}/usr/share/zsh/site-functions"
2014-08-10 19:18:07 +08:00
LANG=en_US.UTF-8 python2 setup.py install \
--root="${pkgdir}" \
--prefix=/usr \
2013-08-24 19:34:53 +08:00
--staging-bindir="${pkgdir}/usr/bin" \
--staging-libdir="${pkgdir}/usr/lib" \
--staging-sharedir="${pkgdir}/usr/share"
2014-08-10 19:18:07 +08:00
2013-01-19 02:09:55 +08:00
python2 -m compileall "${pkgdir}/usr/lib/calibre/"
python2 -O -m compileall "${pkgdir}/usr/lib/calibre/"
2011-01-07 09:05:37 +08:00
}
2015-01-11 14:47:09 +08:00
sha256sums=('2109cf6de75117a77e314e6e24099227f3f0fc1476a2be344d607291724a3aa9')