summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: cba55fea8387b9b2b06a9a1ce2f0808b262c2d69 (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
pkgname=pycharm-community-eap
_buildver=192.5281.25
_pkgver=2019.2
_eap=y
pkgver=$_pkgver.$_buildver
pkgrel=1
epoch=3
pkgdesc='Powerful Python and Django IDE, Early Access Program (EAP) build. Community edition.'
arch=(any)
options=('!strip')
url='http://www.jetbrains.com/pycharm/'
license=(Apache)
depends=(java-environment libdbusmenu-glib)
makedepends=(python-setuptools python2-setuptools)
provides=(pycharm-community-edition)
conflicts=(pycharm-community-edition)
if [[ $_eap = y ]]; then
    _filever=$_buildver
else
    _filever=$_pkgver
fi
source=("https://download.jetbrains.com/python/pycharm-community-$_filever.tar.gz")
sha256sums=($(curl -s "https://download.jetbrains.com/python/pycharm-community-$_filever.tar.gz.sha256" | cut -d' ' -f1))
prepare() {
	cat >"$srcdir/$pkgname.desktop" <<-EOF
		[Desktop Entry]
		Version=$pkgver
		Type=Application
		Name=PyCharm Community EAP
		Exec="/opt/$pkgname/bin/pycharm.sh" %f
		Icon=pycharm
		Comment=$pkgdesc
		Categories=Development;IDE;
		Terminal=false
		StartupNotify=true
		StartupWMClass=jetbrains-pycharm-ce
	EOF
}

build() {
	# use absolute paths to the python executables so that users with an activated
	# virtual environment (like e.g. anaconda) can build without issues
	/usr/bin/python2 "$srcdir/pycharm-community-$_filever/helpers/pydev/setup_cython.py" build_ext --inplace
	/usr/bin/python3 "$srcdir/pycharm-community-$_filever/helpers/pydev/setup_cython.py" build_ext --inplace
}

package() {
	cd "$srcdir"
	mkdir -p "$pkgdir/opt/$pkgname"
	cp -R "pycharm-community-$_filever/"* "$pkgdir/opt/$pkgname/"

	local _vmoptfile=pycharm64
	if [[ $CARCH = 'i686' ]]; then
		rm -f "$pkgdir/opt/$pkgname/bin/libyjpagent-linux64.so"
		rm -f "$pkgdir/opt/$pkgname/bin/fsnotifier64"
		_vmoptfile=pycharm
	fi
	echo $'-Dawt.useSystemAAFontSettings=on\n-Dswing.aatext=true' >>"$pkgdir/opt/$pkgname/bin/$_vmoptfile.vmoptions"

	mkdir -p "$pkgdir/usr/bin"
	ln -s "/opt/$pkgname/bin/pycharm.sh" "$pkgdir/usr/bin/pycharm-eap"
	mkdir -p "$pkgdir/usr/share/pixmaps"
	ln -s "/opt/$pkgname/bin/pycharm.png" "$pkgdir/usr/share/pixmaps/pycharm.png"
	install -Dm755 "$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"
}