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

pkgname=cpeditor-git
_pkgname=cpeditor
pkgver=6.5.2.r33.gfb06000
pkgrel=1
pkgdesc='The editor for competitive programming'
arch=('x86_64')
url='https://github.com/cpeditor/cpeditor'
license=('GPL3')
depends=('qt5-base>=5.15.0')
makedepends=(
	"cmake"
	"git"
	"python3"
	"qt5-tools"
)
optdepends=(
	'cf-tool: submit to Codeforces support'
	'clang: C++ format and language server support'
	'jdk-openjdk: compile Java support'
	'jre-openjdk: execute Java support'
	'python: execute Python support'
	'xterm: detached run support'
)
conflicts=("cpeditor")

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

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

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

prepare() {
	cd "$_pkgname"
	git submodule init

	git config submodule.third_party/QCodeEditor.url "$srcdir/QCodeEditor"
	git config submodule.third_party/QtFindReplaceDialog.url "$srcdir/QtFindReplaceDialog"
	git config submodule.third_party/lsp-cpp.url "$srcdir/lsp-cpp"
	git config submodule.third_party/singleapplication.url "$srcdir/singleapplication"
	git config submodule.third_party/testlib.url "$srcdir/testlib"

	git submodule update
}

build() {
	cd "$_pkgname"
	cmake -H. -Bbuild -DCMAKE_INSTALL_PREFIX=/usr
	cmake --build build -j$(nproc)
}

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