From 2670d7fb7fe3a4e0387d9af8a806cf148eb479e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederik=20=E2=80=9CFreso=E2=80=9D=20S=2E=20Olesen?= Date: Sat, 17 Feb 2024 18:59:25 +0100 Subject: [PATCH] Move .install functionality into PKGBUILD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Building things belongs in build() in the PKGBUILD and placing them in the filesystem belongs in package() and removing package files belongs to the package manager… none of these are the .install files, so removing the .install files in favour of moving these things into the PKGBUILD’s functions. --- .SRCINFO | 3 +-- PKGBUILD | 30 ++++++++++++++++++++-------- pycharm-professional_aarch64.install | 21 ------------------- pycharm-professional_x86_64.install | 21 ------------------- 4 files changed, 23 insertions(+), 52 deletions(-) delete mode 100644 pycharm-professional_aarch64.install delete mode 100644 pycharm-professional_x86_64.install diff --git a/.SRCINFO b/.SRCINFO index e8daf78..f54d72a 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,9 +1,8 @@ pkgbase = pycharm-professional pkgdesc = Python IDE for Professional Developers. Professional Edition pkgver = 2023.3.3 - pkgrel = 1 + pkgrel = 2 url = https://www.jetbrains.com/pycharm/ - install = pycharm-professional_x86_64.install arch = x86_64 arch = x86_64_v3 arch = aarch64 diff --git a/PKGBUILD b/PKGBUILD index dfe35d1..2a53986 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -3,7 +3,7 @@ pkgname=pycharm-professional pkgver=2023.3.3 -pkgrel=1 +pkgrel=2 pkgdesc="Python IDE for Professional Developers. Professional Edition" arch=('x86_64' 'x86_64_v3' 'aarch64') url='https://www.jetbrains.com/pycharm/' @@ -35,18 +35,32 @@ optdepends=('ipython: For enhanced interactive Python shell inside Pycharm' 'python-pytest: For support testing inside Pycharm' 'python-tox: Python environments for testing tool' 'jupyter-server: For Jupyter notebooks and apps') - -if [[ "${CARCH}" == "x86_64" ]]; then - install=pycharm-professional_x86_64.install -elif [ "${CARCH}" == "aarch64" ]; then - install=pycharm-professional_aarch64.install -fi - + prepare() { # clean up for PyDev debugger find pycharm-${pkgver}/plugins/python/helpers/pydev/ \( -name *.so -o -name *.pyd -o -name *.dll \) -delete } +build(){ + cd "pycharm-${pkgver}" + echo ":: Building Cython speed-ups" + # compile PyDev debugger used by PyCharm to speedup debugging + python ./plugins/python/helpers/pydev/setup_cython.py build_ext --inplace --force-cython + + _gccarch='-m64' + if [ "${CARCH}" == "aarch64" ]; then + _gccarch='-march=armv8-a+crypto' + fi + + # for attach debugger + pushd ./plugins/python/helpers/pydev/pydevd_attach_to_process/linux_and_mac + g++ $_gccarch -shared -o ../attach_linux_amd64.so -fPIC -nostartfiles attach.cpp + popd + + rm -rf ./plugins/python/helpers/pydev/build + echo ":: Cython speed-ups done" +} + package() { # licenses install -dm 755 "${pkgdir}/usr/share/licenses/${pkgname}/" diff --git a/pycharm-professional_aarch64.install b/pycharm-professional_aarch64.install deleted file mode 100644 index 95d7ca7..0000000 --- a/pycharm-professional_aarch64.install +++ /dev/null @@ -1,21 +0,0 @@ -post_install() { - echo ":: Building Cython speed-ups" - # compile PyDev debugger used by PyCharm to speedup debugging - python /opt/pycharm-professional/plugins/python/helpers/pydev/setup_cython.py build_ext --inplace --force-cython - - # for attach debugger - pushd /opt/pycharm-professional/plugins/python/helpers/pydev/pydevd_attach_to_process/linux_and_mac - g++ -march=armv8-a+crypto -shared -o ../attach_linux_amd64.so -fPIC -nostartfiles attach.cpp - popd - - rm -rf /opt/pycharm-professional/plugins/python/helpers/pydev/build - echo ":: Cython speed-ups done" -} - -post_upgrade() { - post_install -} - -post_remove() { - rm -rf /opt/pycharm-professional -} diff --git a/pycharm-professional_x86_64.install b/pycharm-professional_x86_64.install deleted file mode 100644 index b410c12..0000000 --- a/pycharm-professional_x86_64.install +++ /dev/null @@ -1,21 +0,0 @@ -post_install() { - echo ":: Building Cython speed-ups" - # compile PyDev debugger used by PyCharm to speedup debugging - python /opt/pycharm-professional/plugins/python/helpers/pydev/setup_cython.py build_ext --inplace --force-cython - - # for attach debugger - pushd /opt/pycharm-professional/plugins/python/helpers/pydev/pydevd_attach_to_process/linux_and_mac - g++ -m64 -shared -o ../attach_linux_amd64.so -fPIC -nostartfiles attach.cpp - popd - - rm -rf /opt/pycharm-professional/plugins/python/helpers/pydev/build - echo ":: Cython speed-ups done" -} - -post_upgrade() { - post_install -} - -post_remove() { - rm -rf /opt/pycharm-professional -}