upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / calibre / trunk / PKGBUILD
blob9b5475c190eda24e642f7d7bedcb5e340fca8142
1 # Maintainer: Caleb Maclennan <caleb@alerque.com>
2 # Contributor: Jelle van der Waa <jelle@vdwaa.nl>
3 # Contributor: Eli Schwartz <eschwartz@archlinux.org>
4 # Contributor: Daniel Wallace <danielwallace at gtmanfred dot com>
5 # Contributor: Giovanni Scafora <giovanni@archlinux.org>
6 # Contributor: Petrov Roman <nwhisper@gmail.com>
7 # Contributor: Andrea Fagiani <andfagiani _at_ gmail dot com>
8 # Contributor: Larry Hajali <larryhaja@gmail.com>
10 pkgname=calibre
11 pkgver=6.17.0
12 pkgrel=2
13 pkgdesc='Ebook management application'
14 arch=(x86_64)
15 url=https://calibre-ebook.com
16 license=(GPL3)
17 _pydeps=(apsw
18          beautifulsoup4
19          cchardet
20          css-parser
21          cssselect
22          dateutil
23          dnspython
24          feedparser
25          html2text
26          html5-parser
27          jeepney
28          lxml
29          markdown
30          mechanize
31          msgpack
32          netifaces
33          pdftotext
34          pillow
35          psutil
36          py7zr
37          pychm
38          pycryptodome
39          pygments
40          pyqt6
41          pyqt6-webengine
42          regex
43          unrardll
44          zeroconf)
45 depends=(hunspell
46          hyphen
47          icu
48          jxrlib
49          libmtp
50          libstemmer
51          libusb
52          libwmf
53          mathjax
54          mtdev
55          optipng
56          podofo
57          "${_pydeps[@]/#/python-}"
58          qt6-imageformats
59          qt6-svg
60          qt6-webengine
61          ttf-liberation
62          uchardet
63          udisks2)
64 makedepends=(cmake
65              pyqt-builder
66              rapydscript-ng
67              sip
68              xdg-utils)
69 optdepends=('poppler: required for converting pdf to html'
70             'speech-dispatcher: TTS support in the viewer')
71 conflicts=(calibre-common
72            calibre-python3)
73 replaces=("${conflicts[@]}")
74 _archive="$pkgname-$pkgver"
75 source=("https://download.calibre-ebook.com/$pkgver/$_archive.tar.xz"
76         "$url/signatures/$_archive.tar.xz.sig")
77 sha256sums=('1ca4abb8a5d850c1f5963e37080dd1a7795736538d5c4d4ff6014b687d7a368e'
78             'SKIP')
79 validpgpkeys=('3CE1780F78DD88DF45194FD706BC317B515ACE7C') # Kovid Goyal (New longer key) <kovid@kovidgoyal.net>
81 prepare(){
82         cd "$_archive"
84         # Desktop integration (e.g. enforce arch defaults)
85         # Use uppercase naming scheme, don't delete config files under fakeroot.
86         sed -e "/import config_dir/,/os.rmdir(config_dir)/d" \
87                 -e "s/'ctc-posml'/'text' not in mt and 'pdf' not in mt and 'xhtml'/" \
88                 -e "s/^Name=calibre/Name=Calibre/g" \
89                 -i  src/calibre/linux.py
91         # Remove unneeded files
92         rm -f resources/$pkgname-portable.*
95 build() {
96         cd "$_archive"
97         export LANG='en_US.UTF-8'
98         python setup.py build
99         python setup.py iso639
100         python setup.py iso3166
101         python setup.py liberation_fonts --system-liberation_fonts --path-to-liberation_fonts /usr/share/fonts/liberation
102         python setup.py mathjax --system-mathjax --path-to-mathjax /usr/share/mathjax
103         python setup.py gui
106 check() {
107         cd "$_archive"
108         export LANG='en_US.UTF-8'
109         python -m unittest discover
112 package() {
113         cd "$_archive"
114         export LANG='en_US.UTF-8'
116         # If this directory doesn't exist, zsh completion won't install.
117         install -d "${pkgdir}/usr/share/zsh/site-functions"
119         python setup.py install \
120                 --staging-root="${pkgdir}/usr" \
121                 --prefix=/usr \
122                 --system-plugins-location=/usr/share/calibre/system-plugins
124         cp -a man-pages/ "${pkgdir}/usr/share/man"
126         # not needed at runtime
127         rm -r "${pkgdir}"/usr/share/calibre/rapydscript/
129         # Compiling bytecode FS#33392
130         # This is kind of ugly but removes traces of the build root.
131         while read -rd '' _file; do
132                 _destdir="$(dirname "${_file#${pkgdir}}")"
133                 python -m compileall -d "${_destdir}" "${_file}"
134                 python -O -m compileall -d "${_destdir}" "${_file}"
135         done < <(find "${pkgdir}"/usr/lib/ -name '*.py' -print0)