summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a6a07b2d7abd7bc5cfca88cb708b25078a0bcf63 (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
# Maintainer: Ahmad Hasan Mubashshir <ahmubashshir@gmail.com>
# pkg: git
pkgbase="openbangla-keyboard-git"
pkgname=(
    "$pkgbase"
    "ibus-openbangla-git"
    "fcitx5-openbangla-git"
)
pkgver=2.0.0.r30.gddeebe5
pkgrel=1
pkgdesc="An OpenSource, Unicode compliant Bengali Input Method"
arch=('x86_64')
url="https://openbangla.github.io"
license=('GPL3')
makedepends=('cmake' 'rust' 'git' 'ibus' 'fcitx5' 'qt5-base')
optdepends=('ttf-indic-otf: fonts for Bangla and other Indic scripts'
            'ttf-freebanglafont: miscellaneous fonts for Bangla script')
source=(
    "${pkgbase%*-git}::git+https://github.com/OpenBangla/OpenBangla-Keyboard#branch=develop"
    "riti::git+https://github.com/OpenBangla/riti"
)
sha256sums=('SKIP'
            'SKIP')
pkgver()
{
    cd "$srcdir/${pkgbase%*-git}"
    (
        set -o pipefail
        git describe --tags --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
        printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
    )
}

prepare() {
    cd "$srcdir/${pkgbase%*-git}"
    git submodule init
    git config submodule."src/engine/riti".url $srcdir/riti
    git submodule update
}

build() {
    if [[ -d build ]]; then rm -rf build; fi
    cmake -B build -S "${pkgbase%*-git}" \
        -DBIN_DIR:PATH=/usr/bin \
        -DLIBEXECDIR:PATH="/usr/lib/$pkgname" \
        -DCMAKE_BUILD_TYPE=None \
        -DCMAKE_SKIP_INSTALL_RPATH=YES \
        -DCMAKE_SKIP_RPATH=YES \
        -DENABLE_FCITX=YES \
        -DENABLE_IBUS=YES
    make -C build
}
package_openbangla-keyboard-git() {
    depends=('qt5-base' "openbangla-im=$pkgver" 'hicolor-icon-theme')
    provides=("${pkgbase%*-git}=$pkgver")
    conflicts=("${pkgbase%*-git}")

    make -C build DESTDIR="$pkgdir" install
    mv -t "$pkgdir/../" \
            "$pkgdir/usr/lib" \
            "$pkgdir/usr/share/ibus" \
            "$pkgdir/usr/share/fcitx5"
}

package_ibus-openbangla-git () {
    depends=('ibus' 'qt5-base' "$pkgbase=$pkgver")
    conflicts=('ibus-openbangla')
    install="ibus-openbangla.install"
    provides=(
        "ibus-openbangla=$pkgver"
        "openbangla-im=$pkgver"
    )

    mkdir -p "$pkgdir/usr/"{lib,share}
    mv "$pkgdir/../lib/openbangla-keyboard-git" "$pkgdir/usr/lib/ibus-openbangla-git"
    mv "$pkgdir/usr/lib/ibus-openbangla-git/"ibus{-engine,}-openbangla
    mv "$pkgdir/../ibus" "$pkgdir/usr/share/ibus"
    sed -i '/<exec>/{s/\(openbangla\)-keyboard/ibus-\1/;s/-engine//;}' \
        "$pkgdir/usr/share/ibus/component/openbangla.xml"
}

package_fcitx5-openbangla-git() {
    depends=('fcitx5' "$pkgbase=$pkgver")
    conflicts=('fcitx5-openbangla')
    install="fcitx5-openbangla.install"
    provides=(
        "fcitx5-openbangla=$pkgver"
        "openbangla-im=$pkgver"
    )

    mkdir -p "$pkgdir/usr/"{lib,share}
    mv "$pkgdir/../lib/fcitx5" "$pkgdir/usr/lib/fcitx5"
    mv "$pkgdir/../fcitx5" "$pkgdir/usr/share/fcitx5"
}