From 45c36fbb01cd8d30a87bbdc36685e2661cbc07d4 Mon Sep 17 00:00:00 2001 From: Olliroxx Date: Fri, 15 Jul 2022 13:53:08 +0100 Subject: [PATCH] jetbrains.pycharm: add cython debug speedups https://www.jetbrains.com/help/pycharm/2022.1/cython-speedups.html As far as I can tell, the installation directory needs to be writeable to run the compile script, which isn't possible post-build --- pkgs/applications/editors/jetbrains/default.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/editors/jetbrains/default.nix b/pkgs/applications/editors/jetbrains/default.nix index 394c668989a0..4e6a91b603a5 100644 --- a/pkgs/applications/editors/jetbrains/default.nix +++ b/pkgs/applications/editors/jetbrains/default.nix @@ -166,7 +166,7 @@ let }; }); - buildPycharm = { pname, version, src, license, description, wmClass, product, ... }: + buildPycharm = { pname, version, src, license, description, wmClass, product, cythonSpeedup ? stdenv.isLinux, ... }: (mkJetBrainsProduct { inherit pname version src wmClass jdk product; productShort = "PyCharm"; @@ -189,6 +189,17 @@ let ''; maintainers = with maintainers; [ ]; }; + }).overrideAttrs (finalAttrs: previousAttrs: optionalAttrs cythonSpeedup { + buildInputs = with python3.pkgs; [ python3 setuptools ]; + preInstall = '' + echo "compiling cython debug speedups" + if [[ -d plugins/python-ce ]]; then + ${python3.interpreter} plugins/python-ce/helpers/pydev/setup_cython.py build_ext --inplace + else + ${python3.interpreter} plugins/python/helpers/pydev/setup_cython.py build_ext --inplace + fi + ''; + # See https://www.jetbrains.com/help/pycharm/2022.1/cython-speedups.html }); buildRider = { pname, version, src, license, description, wmClass, ... }: