summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 44a4093cddd4b439c265b5af0829d67b2cff82ce (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
# Maintainer: Ashar Khan <ashar786khan at gmail.com>

pkgname=cpeditor-git
_pkgname=cpeditor
pkgver=7.0.1.r11.g1fd0fd67
pkgrel=1
pkgdesc='The editor for competitive programming'
arch=('x86_64')
url='https://github.com/cpeditor/cpeditor'
license=('GPL-3.0-or-later')
depends=(
    'qt5-base'
    'qt5-svg'
    'syntax-highlighting5'
    'hicolor-icon-theme'
)
makedepends=(
    'cmake'
    'git'
    'ninja'
    'python3'
    'qt5-tools'
)
optdepends=(
    'cf-tool: submit to Codeforces'
    'clang: C++ format and language server'
    'java-environment: compile Java'
    'java-runtime: execute Java'
    'python: execute Python'
    'wakatime: track coding stats'
)
provides=('cpeditor')
conflicts=('cpeditor')

source=(
    'git+https://github.com/cpeditor/cpeditor.git'
    'git+https://github.com/cpeditor/QtFindReplaceDialog.git'
    'git+https://github.com/cpeditor/lsp-cpp.git'
    'git+https://github.com/itay-grudev/singleapplication.git'
    'git+https://github.com/MikeMirzayanov/testlib.git'
    'git+https://github.com/cpeditor/qhttp.git'
)

md5sums=('SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP')

pkgver() {
    cd "$_pkgname"
    git describe --long --tags --abbrev=8 | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
    cd "$_pkgname"

    for _source in "${source[@]:1}"; do
        _name=$(basename "$_source" .git)
        _path="third_party/$_name"
        git config submodule."$_path".url "$srcdir/$_name"
        git -c protocol.file.allow=always submodule update --init -- "$_path"
    done
}

build() {
    cd "$_pkgname"
    cmake -Bbuild -DCMAKE_INSTALL_PREFIX=/usr -DPORTABLE_VERSION=Off -DCMAKE_BUILD_TYPE=Release -GNinja
    cmake --build build
}

package() {
    cd "$_pkgname/build"
    DESTDIR="$pkgdir/" ninja install
}