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

pkgname=cpeditor-git
_pkgname=cpeditor
pkgver=6.8.1.r38.ga46cf7eb
pkgrel=1
pkgdesc='The editor for competitive programming'
arch=('x86_64')
url='https://github.com/cpeditor/cpeditor'
license=('GPL3')
depends=('qt5-base')
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'
)
provides=('cpeditor')
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'
	'git://github.com/cpeditor/qhttp.git')

md5sums=('SKIP' '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"
	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 config submodule.third_party/qhttp.url "$srcdir/qhttp"

	git submodule update
}

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
}