From 7dad91641121ba8fdffe485b4acc790adade95fe Mon Sep 17 00:00:00 2001 From: "Xavier C. Llano" Date: Fri, 28 Apr 2023 11:23:42 -0700 Subject: [PATCH] v2023.1.1 --- .SRCINFO | 19 ++--- PKGBUILD | 21 ++--- charm | 142 -------------------------------- charm.desktop => ltedit.desktop | 4 +- 4 files changed, 20 insertions(+), 166 deletions(-) delete mode 100644 charm rename charm.desktop => ltedit.desktop (78%) diff --git a/.SRCINFO b/.SRCINFO index 4618ef7..2edb025 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = pycharm-professional pkgdesc = Python IDE for Professional Developers. Professional Edition - pkgver = 2022.3.3 - pkgrel = 2 + pkgver = 2023.1.1 + pkgrel = 1 url = https://www.jetbrains.com/pycharm/ arch = x86_64 arch = aarch64 @@ -35,17 +35,16 @@ pkgbase = pycharm-professional conflicts = pycharm-community-eap conflicts = pycharm-eap conflicts = pycharm-community-jre-aarch64 + options = !strip backup = opt/pycharm-professional/bin/pycharm64.vmoptions backup = opt/pycharm-professional/bin/idea.properties source = pycharm-professional.desktop - source = charm.desktop - source = charm + source = ltedit.desktop sha256sums = a75264959b06a45ea0801729bc1688bfbd52da3c5fbf3d5b1ad9267860439291 - sha256sums = 6996b38a3c2ba1e472838d7046a4c54a27822fd647be9ca590457e8c6a2d50c8 - sha256sums = 2c520f63afffa5ef153077fc61e0c3b15a0a9bf8fd4973164af62ec64626a741 - source_x86_64 = https://download.jetbrains.com/python/pycharm-professional-2022.3.3.tar.gz - sha256sums_x86_64 = 50c37aafd9fbe3a78d97cccf4f7abd80266c548d1c7ea4751b08c52810f16f2d - source_aarch64 = https://download.jetbrains.com/python/pycharm-professional-2022.3.3-aarch64.tar.gz - sha256sums_aarch64 = 795217e215782bd7cf033deced13394b2273cd4c50010a09d1f158f61d3a4353 + sha256sums = 41f0e64dc7ec5ab85e7b0df1dc8237b56c94ccf9e4f2fa033eaadcc7756df3d3 + source_x86_64 = https://download.jetbrains.com/python/pycharm-professional-2023.1.1.tar.gz + sha256sums_x86_64 = aaa8d136e47077cfe970a5b42aa2058bb74038c5dab354c9f6ff22bfa3aa327d + source_aarch64 = https://download.jetbrains.com/python/pycharm-professional-2023.1.1-aarch64.tar.gz + sha256sums_aarch64 = b50dd7d3573f00474aeddba8863fa3cad22e642dfb6bfe166f1fe35b92d5dd17 pkgname = pycharm-professional diff --git a/PKGBUILD b/PKGBUILD index 4ef9fc3..b24b619 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -4,8 +4,8 @@ # Contributor: Ethan Reece pkgname=pycharm-professional -pkgver=2022.3.3 -pkgrel=2 +pkgver=2023.1.1 +pkgrel=1 pkgdesc="Python IDE for Professional Developers. Professional Edition" arch=('x86_64' 'aarch64') url='https://www.jetbrains.com/pycharm/' @@ -15,16 +15,15 @@ license=('custom') backup=("opt/$pkgname/bin/pycharm64.vmoptions" "opt/$pkgname/bin/idea.properties") depends=('giflib' 'glibc' 'sh' 'libxtst' 'libxslt' 'libxss' 'nss' 'python' 'libdbusmenu-glib') +options=('!strip') source_x86_64=("https://download.jetbrains.com/python/$pkgname-$pkgver.tar.gz") source_aarch64=("https://download.jetbrains.com/python/$pkgname-$pkgver-aarch64.tar.gz") source=("pycharm-professional.desktop" - "charm.desktop" - "charm") + "ltedit.desktop") sha256sums=('a75264959b06a45ea0801729bc1688bfbd52da3c5fbf3d5b1ad9267860439291' - '6996b38a3c2ba1e472838d7046a4c54a27822fd647be9ca590457e8c6a2d50c8' - '2c520f63afffa5ef153077fc61e0c3b15a0a9bf8fd4973164af62ec64626a741') -sha256sums_x86_64=('50c37aafd9fbe3a78d97cccf4f7abd80266c548d1c7ea4751b08c52810f16f2d') -sha256sums_aarch64=('795217e215782bd7cf033deced13394b2273cd4c50010a09d1f158f61d3a4353') + '41f0e64dc7ec5ab85e7b0df1dc8237b56c94ccf9e4f2fa033eaadcc7756df3d3') +sha256sums_x86_64=('aaa8d136e47077cfe970a5b42aa2058bb74038c5dab354c9f6ff22bfa3aa327d') +sha256sums_aarch64=('b50dd7d3573f00474aeddba8863fa3cad22e642dfb6bfe166f1fe35b92d5dd17') makedepends=('python-setuptools' 'cython') optdepends=('ipython: For enhanced interactive Python shell inside Pycharm' 'openssh: For deployment and remote connections' @@ -41,7 +40,6 @@ optdepends=('ipython: For enhanced interactive Python shell inside Pycharm' build() { # clean up and compile PyDev debugger used by PyCharm to speedup debugging find pycharm-${pkgver}/plugins/python/helpers/pydev/ \( -name *.so -o -name *.pyd \) -delete - sed -i '1s/^/# cython: language_level=3\n/' pycharm-${pkgver}/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_cython.pxd python pycharm-${pkgver}/plugins/python/helpers/pydev/setup_cython.py build_ext --inplace --force-cython # for attach debugger @@ -67,6 +65,7 @@ package() { mv "pycharm-$pkgver/"* "$pkgdir/opt/$pkgname/" install -dm 755 "$pkgdir/usr/share/applications" install -Dm 644 "$pkgname.desktop" "$pkgdir/usr/share/applications/" + install -Dm 644 ltedit.desktop "$pkgdir/usr/share/applications/" install -dm 755 "$pkgdir/usr/share/icons/hicolor/"{128x128,scalable}"/apps/" install -Dm 644 "$pkgdir/opt/$pkgname/bin/pycharm.png" "$pkgdir/usr/share/icons/hicolor/128x128/apps/pycharm.png" install -Dm 644 "$pkgdir/opt/$pkgname/bin/pycharm.svg" "$pkgdir/usr/share/icons/hicolor/scalable/apps/pycharm.svg" @@ -74,8 +73,6 @@ package() { # exec install -dm 755 "$pkgdir/usr/bin/" ln -s "/opt/$pkgname/bin/pycharm.sh" "$pkgdir/usr/bin/pycharm" + ln -s "/opt/$pkgname/bin/ltedit.sh" "$pkgdir/usr/bin/ltedit" - # install charm application - for edit a single file in Pycharm - install -Dm 755 charm "$pkgdir/usr/bin/" - install -Dm 644 charm.desktop "$pkgdir/usr/share/applications/" } diff --git a/charm b/charm deleted file mode 100644 index 9a2bf4c..0000000 --- a/charm +++ /dev/null @@ -1,142 +0,0 @@ -#!/usr/bin/env python3 -# Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. - -import os -import socket -import struct -import sys -import traceback - -# See com.intellij.idea.SocketLock for the server side of this interface. - -RUN_PATH = u'/opt/pycharm-professional/bin/pycharm.sh' -CONFIG_PATH = u'~/.config/JetBrains/PyCharm2022.3' -SYSTEM_PATH = u'~/.cache/JetBrains/PyCharm2022.3' - - -def print_usage(cmd): - print(('Usage:\n' + - ' {0} -h | -? | --help\n' + - ' {0} [project_dir] [-w|--wait]\n' + - ' {0} [-l|--line line] [project_dir|--temp-project] [-w|--wait] file[:line]\n' + - ' {0} diff \n' + - ' {0} merge [base] ').format(cmd)) - - -def write_to_sock(sock, data): - if sys.version_info[0] >= 3: - data = data.encode('utf-8') - sock.send(struct.pack('>h', len(data)) + data) - - -def read_from_sock(sock): - length = struct.unpack('>h', sock.recv(2))[0] - return sock.recv(length).decode('utf-8') - - -def read_sequence_from_sock(sock): - result = [] - while True: - try: - data = read_from_sock(sock) - if data == '---': - break - result.append(data) - except (socket.error, IOError) as e: - print("I/O error({0}): {1} ({2})".format(e.errno, e.strerror, e)) - traceback.print_exception(*sys.exc_info()) - break - return result - - -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 arg == '-w' or arg == '--wait': - args.append('--wait') - elif arg == '-p' or arg == '--project': - args.append(arg) - elif arg == '-e' or arg == '--edit': - args.append(arg) - 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(1.0) - try: - s.connect(('127.0.0.1', port)) - except (socket.error, IOError): - return False - - paths = read_sequence_from_sock(s) - found = CONFIG_PATH in paths or os.path.realpath(CONFIG_PATH) in paths - - if found: - write_to_sock(s, 'activate ' + token + '\0' + os.getcwd() + '\0' + '\0'.join(args)) - - s.settimeout(None) - response = read_sequence_from_sock(s) - if len(response) < 2 or response[0] != 'ok': - print('bad response: ' + str(response)) - exit(1) - - if len(response) > 2: - print(response[2]) - - exit(int(response[1])) - - return False - - -def start_new_instance(args): - if sys.platform == 'darwin': - if len(args) > 0: - args.insert(0, '--args') - if '--wait' in args: - args.insert(0, '-W') - os.execv('/usr/bin/open', ['open', '-na', 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/ltedit.desktop similarity index 78% rename from charm.desktop rename to ltedit.desktop index b239d40..7e240dd 100644 --- a/charm.desktop +++ b/ltedit.desktop @@ -1,8 +1,8 @@ [Desktop Entry] Type=Application -Name=Charm +Name=Pycharm Light Edit Icon=pycharm -Exec=charm -e %f +Exec=ltedit %f MimeType=text/x-python;application/x-ipynb+json NoDisplay=true Terminal=false