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

pkgname=cpeditor-git
_pkgname=cpeditor
pkgver=6.3.1.r26.g5d8c7f5
pkgrel=1
pkgdesc='The editor for competitive programming'
arch=('x86_64')
url='https://github.com/cpeditor/cpeditor'
license=('GPL3')
depends=('qt5-base')
makedepends=("gcc" "cmake" "git" "python3")
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 -DCMAKE_CXX_COMPILER=g++
	cmake --build build -j$(nproc)
}

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