summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Bero2019-07-22 16:04:48 -0500
committerChristopher Bero2019-07-22 16:04:48 -0500
commit61896748978115619174ae1ca6f23b70a012d65b (patch)
tree689ebccf30b73d32adaa9fb0cf87ef1bd3e94f2f
parentbb87dca4aa5796bef1d227a3f1d310357693116b (diff)
downloadaur-61896748978115619174ae1ca6f23b70a012d65b.tar.gz
Initial port from pycharm-professional
-rw-r--r--.SRCINFO50
-rw-r--r--PKGBUILD106
-rw-r--r--charm110
-rw-r--r--charm.desktop10
-rw-r--r--pycharm3
-rw-r--r--pycharm-community.desktop13
6 files changed, 238 insertions, 54 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 79d297dbd5fc..0f0dec7f6918 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,25 +1,53 @@
pkgbase = pycharm-community
- pkgdesc = Powerful Python and Django IDE. Community edition.
- pkgver = 2017.2.3
+ pkgdesc = Powerful Python and Django IDE. Professional Edition.
+ pkgver = 2019.1.3
pkgrel = 1
- url = http://www.jetbrains.com/pycharm/
- arch = i686
+ url = https://www.jetbrains.com/pycharm/
arch = x86_64
- license = Apache
+ license = custom
makedepends = python2-setuptools
makedepends = python-setuptools
depends = giflib
+ depends = glibc
+ depends = sh
depends = ttf-font
- optdepends = ipython2: IPython integration for Python 2
- optdepends = ipython: IPython integration for Python 3
+ depends = libxtst
+ depends = libxslt
+ depends = python
+ optdepends = ipython2: For enhanced interactive Python shell v2 inside Pycharm
+ optdepends = ipython: For enhanced interactive Python shell v3 inside Pycharm
+ optdepends = openssh: For deployment and remote connections
+ optdepends = python2-setuptools: Packages manager for Python 2, for project interpreter
+ optdepends = python-setuptools: Packages manager for Python 3, for project interpreter
+ optdepends = python2-coverage: For support code coverage measurement for Python 2
+ optdepends = python-coverage: For support code coverage measurement for Python 3
+ optdepends = cython2: For performance debugger in Python 2
+ optdepends = cython: For performance debugger in Python 3
+ optdepends = docker-machine: For support docker inside Pycharm
+ optdepends = docker-compose: For support docker inside Pycharm
+ optdepends = vagrant: For support virtualized development environments
+ optdepends = python2-pytest: For support testing inside Pycharm with Python 2
+ optdepends = python-pytest: For support testing inside Pycharm with Python 3
+ optdepends = python2-tox: Python environments for testing tool with Python 2
+ optdepends = python-tox: Python environments for testing tool with Python 3
+ optdepends = jupyter: For support Jupyter Notebook
+ optdepends = python-docutils-stubs: For build documentation with sphynx
provides = pycharm
conflicts = pycharm
conflicts = pycharm-professional
- options = !strip
- source = https://download.jetbrains.com/python/pycharm-community-2017.2.3.tar.gz
+ backup = opt/pycharm-community/bin/pycharm.vmoptions
+ backup = opt/pycharm-community/bin/pycharm64.vmoptions
+ backup = opt/pycharm-community/bin/idea.properties
+ source = https://download.jetbrains.com/python/pycharm-community-2019.1.3.tar.gz
source = pycharm-community.desktop
- sha256sums = e8562938c2ede32a1c1036391942190144cd9f0927bd49b6b3ddf5f7a01c33aa
- sha256sums = 5ce44b5bee632258749ee7d0df0fd08af446d43715f9ef50cb6889b88232de41
+ source = pycharm
+ source = charm.desktop
+ source = charm
+ sha256sums = f06d5aad37335735ad929c0b57b73c088a71c28b9ad6cd3e0960f8096e779c29
+ sha256sums = 1c12333a8be131a4d148f960d611585f8f783ee080db957110a99c8a780f55ab
+ sha256sums = 0afdd03fe56553e01001f783da9b627f952cd43eeaed4e31bba53d68e1c9f9b3
+ sha256sums = 6df85b749f78ebe13031643c96cbb05bca80b4c19d3780e4d1eb7e95d97464a8
+ sha256sums = 029490b735ec0f5785a083f65172f6eece3fa64dad94b8b56f0db73c5418cfa2
pkgname = pycharm-community
diff --git a/PKGBUILD b/PKGBUILD
index 4b300fc7f3b6..753fe6d71459 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,48 +1,82 @@
-# Contributor: David Keogh <davekeogh@archlinux.us>
+# Maintainer: XavierCLL <xavier.corredor.llano (a) gmail.com>
pkgname=pycharm-community
-pkgver=2017.2.3
+pkgver=2019.1.3
+_pkgver=2019.1.3
pkgrel=1
-pkgdesc="Powerful Python and Django IDE. Community edition."
-arch=('i686' 'x86_64')
-options=('!strip')
-url="http://www.jetbrains.com/pycharm/"
-license=('Apache')
-depends=('giflib' 'ttf-font')
-optdepends=('ipython2: IPython integration for Python 2'
- 'ipython: IPython integration for Python 3')
-makedepends=('python2-setuptools' 'python-setuptools')
+pkgdesc="Powerful Python and Django IDE. Professional Edition."
+arch=('x86_64')
+url='https://www.jetbrains.com/pycharm/'
conflicts=('pycharm' 'pycharm-professional')
provides=('pycharm')
-source=(https://download.jetbrains.com/python/$pkgname-$pkgver.tar.gz
- 'pycharm-community.desktop' )
-sha256sums=('4eacc9bf512406bebf71546ccb4b6c14ea8e06748fd76be6ca409ea1955e1f53'
- '5ce44b5bee632258749ee7d0df0fd08af446d43715f9ef50cb6889b88232de41')
-
+license=('custom')
+backup=(
+ opt/$pkgname/bin/pycharm.vmoptions
+ opt/$pkgname/bin/pycharm64.vmoptions
+ opt/$pkgname/bin/idea.properties
+)
+depends=('giflib' 'glibc' 'sh' 'ttf-font' 'libxtst' 'libxslt' 'python')
+source=("https://download.jetbrains.com/python/$pkgname-$_pkgver.tar.gz"
+ "pycharm-community.desktop"
+ "pycharm"
+ "charm.desktop"
+ "charm")
+# https://download.jetbrains.com/python/pycharm-professional-${_pkgver}.tar.gz.sha256
+sha256sums=('f06d5aad37335735ad929c0b57b73c088a71c28b9ad6cd3e0960f8096e779c29'
+ '1c12333a8be131a4d148f960d611585f8f783ee080db957110a99c8a780f55ab'
+ '0afdd03fe56553e01001f783da9b627f952cd43eeaed4e31bba53d68e1c9f9b3'
+ '6df85b749f78ebe13031643c96cbb05bca80b4c19d3780e4d1eb7e95d97464a8'
+ '029490b735ec0f5785a083f65172f6eece3fa64dad94b8b56f0db73c5418cfa2')
+makedepends=('python2-setuptools' 'python-setuptools')
+optdepends=('ipython2: For enhanced interactive Python shell v2 inside Pycharm'
+ 'ipython: For enhanced interactive Python shell v3 inside Pycharm'
+ 'openssh: For deployment and remote connections'
+ 'python2-setuptools: Packages manager for Python 2, for project interpreter'
+ 'python-setuptools: Packages manager for Python 3, for project interpreter'
+ 'python2-coverage: For support code coverage measurement for Python 2'
+ 'python-coverage: For support code coverage measurement for Python 3'
+ 'cython2: For performance debugger in Python 2'
+ 'cython: For performance debugger in Python 3'
+ 'docker-machine: For support docker inside Pycharm'
+ 'docker-compose: For support docker inside Pycharm'
+ 'vagrant: For support virtualized development environments'
+ 'python2-pytest: For support testing inside Pycharm with Python 2'
+ 'python-pytest: For support testing inside Pycharm with Python 3'
+ 'python2-tox: Python environments for testing tool with Python 2'
+ 'python-tox: Python environments for testing tool with Python 3'
+ 'jupyter: For support Jupyter Notebook'
+ 'python-docutils-stubs: For build documentation with sphynx')
+
build() {
+ cd pycharm-community-$_pkgver
+
# compile PyDev debugger used by PyCharm to speedup debugging
- python2 $srcdir/$pkgname-$pkgver/helpers/pydev/setup_cython.py build_ext --inplace
- python3 $srcdir/$pkgname-$pkgver/helpers/pydev/setup_cython.py build_ext --inplace
+ python2 helpers/pydev/setup_cython.py build_ext --build-temp build --build-lib .
+ python3 helpers/pydev/setup_cython.py build_ext --build-temp build --build-lib .
+
+ rm -rf bin/fsnotifier{,-arm} lib/libpty/linux/x86
}
package() {
- cd $srcdir
- mkdir -p $pkgdir/opt/$pkgname
- cp -R $srcdir/$pkgname-$pkgver/* $pkgdir/opt/$pkgname
+ # workaround FS#40934
+ sed -i 's/lcd/on/' pycharm-community-$_pkgver/bin/*.vmoptions
- if [[ $CARCH = 'i686' ]]; then
- rm -f $pkgdir/opt/$pkgname/bin/libyjpagent-linux64.so
- rm -f $pkgdir/opt/$pkgname/bin/fsnotifier64
- fi
-
- mkdir -p $pkgdir/usr/share/{applications,pixmaps}
- install -Dm644 $srcdir/pycharm-community.desktop $pkgdir/usr/share/applications/
- install -Dm644 $pkgdir/opt/$pkgname/bin/pycharm.png $pkgdir/usr/share/pixmaps/pycharm.png
-
- mkdir -p $pkgdir/usr/bin
- ln -s /opt/pycharm-community/bin/pycharm.sh $pkgdir/usr/bin/pycharm
+ # base
+ install -dm 755 $pkgdir/opt/$pkgname
+ cp -dr --no-preserve=ownership pycharm-community-$_pkgver/* $pkgdir/opt/$pkgname/
+ install -dm 755 $pkgdir/usr/share/{applications,pixmaps}
+ install -Dm 644 $pkgdir/opt/$pkgname/bin/pycharm.png $pkgdir/usr/share/pixmaps/pycharm.png
+ install -Dm 644 pycharm-community.desktop $pkgdir/usr/share/applications/
+
+ # exec
+ install -dm 755 $pkgdir/usr/bin/
+ install -Dm 755 pycharm $pkgdir/usr/bin/
+
+ # licenses
+ install -dm 755 $pkgdir/usr/share/licenses/$pkgname/
+ cp -dr --no-preserve=ownership pycharm-community-$_pkgver/license/* $pkgdir/usr/share/licenses/$pkgname/
+
+ # install charm application - for edit a single file in Pycharm
+ install -Dm 755 charm $pkgdir/opt/pycharm-community/bin/
+ install -Dm 644 charm.desktop $pkgdir/usr/share/applications/
}
-
-# vim:set ts=2 sw=2 et:
-sha256sums=('e8562938c2ede32a1c1036391942190144cd9f0927bd49b6b3ddf5f7a01c33aa'
- '5ce44b5bee632258749ee7d0df0fd08af446d43715f9ef50cb6889b88232de41')
diff --git a/charm b/charm
new file mode 100644
index 000000000000..109a7b78187a
--- /dev/null
+++ b/charm
@@ -0,0 +1,110 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import socket
+import struct
+import sys
+import os
+import time
+
+# see com.intellij.idea.SocketLock for the server side of this interface
+
+RUN_PATH = u'/opt/pycharm-professional/bin/pycharm.sh'
+CONFIG_PATH = u'~/.PyCharm2019.1/config'
+SYSTEM_PATH = u'~/.PyCharm2019.1/system'
+
+
+def print_usage(cmd):
+ print(('Usage:\n' +
+ ' {0} -h | -? | --help\n' +
+ ' {0} [project_dir]\n' +
+ ' {0} [-l|--line line] [project_dir|--temp-project] file[:line]\n' +
+ ' {0} diff <left> <right>\n' +
+ ' {0} merge <local> <remote> [base] <merged>').format(cmd))
+
+
+def process_args(argv):
+ args = []
+
+ skip_next = False
+ for i, arg in enumerate(argv[1:]):
+ if arg == '-h' or arg == '-?' or arg == '--help':
+ print_usage(argv[0])
+ exit(0)
+ elif i == 0 and (arg == 'diff' or arg == 'merge' or arg == '--temp-project'):
+ args.append(arg)
+ elif arg == '-l' or arg == '--line':
+ args.append(arg)
+ skip_next = True
+ elif skip_next:
+ args.append(arg)
+ skip_next = False
+ else:
+ path = arg
+ if ':' in arg:
+ file_path, line_number = arg.rsplit(':', 1)
+ if line_number.isdigit():
+ args.append('-l')
+ args.append(line_number)
+ path = file_path
+ args.append(os.path.abspath(path))
+
+ return args
+
+
+def try_activate_instance(args):
+ port_path = os.path.join(CONFIG_PATH, 'port')
+ token_path = os.path.join(SYSTEM_PATH, 'token')
+ if not (os.path.exists(port_path) and os.path.exists(token_path)):
+ return False
+
+ try:
+ with open(port_path) as pf:
+ port = int(pf.read())
+ with open(token_path) as tf:
+ token = tf.read()
+ except (ValueError):
+ return False
+
+ s = socket.socket()
+ s.settimeout(0.3)
+ try:
+ s.connect(('127.0.0.1', port))
+ except (socket.error, IOError):
+ return False
+
+ found = False
+ while True:
+ try:
+ path_len = struct.unpack('>h', s.recv(2))[0]
+ path = s.recv(path_len).decode('utf-8')
+ if os.path.abspath(path) == os.path.abspath(CONFIG_PATH):
+ found = True
+ break
+ except (socket.error, IOError):
+ return False
+
+ if found:
+ cmd = 'activate ' + token + '\0' + os.getcwd() + '\0' + '\0'.join(args)
+ if sys.version_info[0] >= 3: cmd = cmd.encode('utf-8')
+ encoded = struct.pack('>h', len(cmd)) + cmd
+ s.send(encoded)
+ time.sleep(0.5) # don't close the socket immediately
+ return True
+
+ return False
+
+
+def start_new_instance(args):
+ if sys.platform == 'darwin':
+ if len(args) > 0:
+ args.insert(0, '--args')
+ os.execvp('/usr/bin/open', ['-a', RUN_PATH] + args)
+ else:
+ bin_file = os.path.split(RUN_PATH)[1]
+ os.execv(RUN_PATH, [bin_file] + args)
+
+
+ide_args = process_args(sys.argv)
+if not try_activate_instance(ide_args):
+ start_new_instance(ide_args)
diff --git a/charm.desktop b/charm.desktop
new file mode 100644
index 000000000000..2c2bcbc7e71f
--- /dev/null
+++ b/charm.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Type=Application
+Name=Charm
+Icon=pycharm
+Exec=/opt/pycharm-community/bin/charm %f
+MimeType=text/x-python;application/x-ipynb+json
+NoDisplay=true
+Terminal=false
+StartupNotify=true
+StartupWMClass=jetbrains-pycharm
diff --git a/pycharm b/pycharm
new file mode 100644
index 000000000000..be490121b188
--- /dev/null
+++ b/pycharm
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /opt/pycharm-community/bin/pycharm.sh "$@"
diff --git a/pycharm-community.desktop b/pycharm-community.desktop
index 51b71c95189a..4605bf7809c2 100644
--- a/pycharm-community.desktop
+++ b/pycharm-community.desktop
@@ -1,11 +1,10 @@
[Desktop Entry]
-Name=PyCharm
+Type=Application
+Name=PyCharm Community Edition
Icon=pycharm
-GenericName=Python and Django IDE
-Comment=Powerful Python and Django IDE. Community edition.
-Exec=/usr/bin/pycharm
+Comment=Python IDE for Professional Developers.
+Exec=/usr/bin/pycharm %f
Terminal=false
-Type=Application
-Categories=Development;IDE;
+Categories=Development;IDE;Python;
StartupNotify=true
-StartupWMClass=jetbrains-pycharm-ce
+StartupWMClass=jetbrains-pycharm