blob: e61b19eef06d34ab13d88c6cd390082a47fe107a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Eli Schwartz <eschwartz@archlinux.org>
# Contributor: Jelle van der Waa <jelle@vdwaa.nl>
# Contributor: Daniel Wallace <danielwallace at gtmanfred dot com>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Petrov Roman <nwhisper@gmail.com>
# Contributor: Andrea Fagiani <andfagiani _at_ gmail dot com>
# Contributor: Larry Hajali <larryhaja@gmail.com>
pkgbase=calibre-git
pkgname=calibre-git
pkgver=5.34.0.r114.g0cf7af69ac
pkgrel=1
_dictionaries_commit="8cd38fb5138f2e456506aaa889ec2b7042a7439e"
pkgdesc="Ebook management application"
arch=('i686' 'x86_64')
url="https://calibre-ebook.com/"
license=('GPL3')
_py_deps=('apsw' 'beautifulsoup4' 'cchardet' 'cssselect' 'css-parser' 'dateutil' 'dnspython'
'feedparser' 'html2text' 'html5-parser' 'jeepney' 'lxml' 'markdown' 'mechanize' 'msgpack'
'netifaces' 'unrardll' 'pillow' 'psutil' 'py7zr' 'pychm' 'pygments' 'pyqt5'
'pyqtwebengine' 'regex' 'zeroconf')
depends=('hunspell' 'hyphen' 'icu' 'jxrlib' 'libmtp' 'libstemmer' 'libusb'
'libwmf' 'mathjax' 'mtdev' 'optipng' 'podofo'
"${_py_deps[@]/#/python-}" 'qt5-imageformats' 'qt5-svg' 'ttf-liberation' 'udisks2')
makedepends=('git' 'qt5-x11extras' 'sip' 'pyqt-builder' 'xdg-utils' 'rapydscript-ng' 'python-sphinx')
checkdepends=('xorg-server-xvfb')
optdepends=('poppler: required for converting pdf to html')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}" 'calibre-common' 'calibre-python3')
replaces=('calibre-common-git' 'calibre-python3-git')
source=("git+https://github.com/kovidgoyal/${pkgbase%-git}.git?signed"
"git+https://github.com/kovidgoyal/${pkgbase%-git}-translations.git?signed"
"dictionaries-${_dictionaries_commit}.tar.gz::https://github.com/LibreOffice/dictionaries/archive/${_dictionaries_commit}.tar.gz"
"user-agent-data.json")
sha256sums=('SKIP'
'SKIP'
'50a90de207ce177cb415e3694d16906cfcb7bdb0f8602b8a23bca25f8276d46a'
'26e00a8de411f3a134735d508f4bb7b85f9c1abe5b9d031d3d50d59450e74bd6')
validpgpkeys=('3CE1780F78DD88DF45194FD706BC317B515ACE7C') # Kovid Goyal (New longer key) <kovid@kovidgoyal.net>
pkgver() {
cd "${pkgbase%-git}"
git describe --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare(){
cd "${pkgbase%-git}"
python setup.py git_version
# Link translations to build dir
ln -sfT ../calibre-translations translations
# Desktop integration (e.g. enforce arch defaults)
# Use uppercase naming scheme, don't delete config files under fakeroot.
sed -e "/import config_dir/,/os.rmdir(config_dir)/d" \
-e "s/^Name=calibre/Name=Calibre/g" \
-i src/calibre/linux.py
}
build() {
cd "${pkgbase%-git}"
# Don't use the bootstrapper, since it tries to checkout/pull the
# translations repo and generally touch the internet. Instead call each
# *needed* subcommmand.
# LANG='en_US.UTF-8' python2 setup.py bootstrap
LANG='en_US.UTF-8' python setup.py build
LANG='en_US.UTF-8' python setup.py iso639
LANG='en_US.UTF-8' python setup.py iso3166
LANG='en_US.UTF-8' python setup.py translations
LANG='en_US.UTF-8' python setup.py gui
LANG='en_US.UTF-8' python setup.py resources \
--path-to-liberation_fonts /usr/share/fonts/liberation --system-liberation_fonts \
--path-to-mathjax /usr/share/mathjax --system-mathjax \
--path-to-hyphenation "${srcdir}"/dictionaries-${_dictionaries_commit}
LANG='en_US.UTF-8' python setup.py man_pages
# This tries to download new user-agent data, so pre-seed a
# recently-generated copy to allow offline builds.
cp ../user-agent-data.json resources/
LANG='en_US.UTF-8' python setup.py recent_uas || true
}
check() {
cd "${pkgbase%-git}"
_test_excludes=(
# merely testing if a runtime-optional feature optdepend is importable
'speech_dispatcher'
# tests if a completely unused module is bundled
'pycryptodome'
# only fails on local builds, and that intermittently
'test_searching'
)
LANG='en_US.UTF-8' python setup.py test "${_test_excludes[@]/#/--exclude-test-name=}"
}
package() {
cd "${pkgbase%-git}"
# If this directory doesn't exist, zsh completion won't install.
install -d "${pkgdir}/usr/share/zsh/site-functions"
LANG='en_US.UTF-8' python setup.py install \
--staging-root="${pkgdir}/usr" \
--prefix=/usr \
--system-plugins-location=/usr/share/calibre/system-plugins
cp -a man-pages/ "${pkgdir}/usr/share/man"
# not needed at runtime
rm -r "${pkgdir}"/usr/share/calibre/rapydscript/
# Compiling bytecode FS#33392
# This is kind of ugly but removes traces of the build root.
while read -rd '' _file; do
_destdir="$(dirname "${_file#${pkgdir}}")"
python3 -m compileall -d "${_destdir}" "${_file}"
python3 -O -m compileall -d "${_destdir}" "${_file}"
done < <(find "${pkgdir}"/usr/lib/ -name '*.py' -print0)
}
|