upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / chewing-editor / repos / community-x86_64 / PKGBUILD
blob1442fe88481668d07cf701942b8892c7db9c4d54
1 # Maintainer: Chih-Hsuan Yen <yan12125@archlinux.org>
2 # Contributor: Chocobo1 <chocobo1 AT archlinux DOT net>
4 pkgname=chewing-editor
5 pkgver=0.1.1
6 pkgrel=10
7 pkgdesc="Cross platform chewing user phrase editor"
8 arch=('x86_64')
9 url="http://chewing.im"
10 license=('GPL')
11 depends=('glibc' 'libchewing' 'qt5-base')
12 makedepends=('cmake' 'qt5-tools' 'help2man' 'gtest' 'gmock')
13 checkdepends=('valgrind')
14 source=("https://github.com/chewing/$pkgname/archive/$pkgver/$pkgname-$pkgver.tar.gz"
15         system-gtest.patch
16         chewing-editor-reproducibility.patch::https://github.com/chewing/chewing-editor/commit/7db328e7372f870dc741436ba2da8ceb5199f2f9.patch
17         no-rebuild-manpage.diff)
18 sha256sums=('ad59ba32bb258d7a1ee6c105a4be54357d2de18cc324277a1429f53fbb23709b'
19             '17f115cc9352c85973f1a3f75c2f1f17c2e8cc3e52a6656914d3895478cc35fc'
20             '36a2aa702f58e90f306f3de07dee2cac74f013dff4762e277fd0048d9476c430'
21             '864a7f5a0b50a96edb21cbc76448010b375d65bb35e2f012640d41839fb13df3')
23 prepare() {
24     cd $pkgname-$pkgver
26     # based on commits from https://github.com/iblis17/chewing-editor/tree/cmake-gtest
27     patch -Np1 -i ../system-gtest.patch
29     patch -Np1 -i ../chewing-editor-reproducibility.patch
31     # Building the man page requires an environment for Qt (see below). This
32     # patch avoids preparing the environment twice.
33     patch -Np1 -i ../no-rebuild-manpage.diff
35     rm -r gmock
38 build() {
39     cmake -S $pkgname-$pkgver -B build \
40       -DCMAKE_INSTALL_PREFIX="/usr" \
41       -DCMAKE_BUILD_TYPE=None
43     # Building the man page needs running `chewing-editor --version`, so
44     # preparing an environment for Qt
45     export XDG_RUNTIME_DIR="$PWD""$(mktemp -d runtimer_dir_XXXXXX)"
46     QT_QPA_PLATFORM=offscreen make -C build
49 check() {
50     cd build
52     make test
55 package() {
56     cd build
58     make DESTDIR="$pkgdir" install