root5: Fix build with Python 3.11

Was broken since the Python update from https://github.com/NixOS/nixpkgs/pull/251878

This should fix the apfelgrid and applgrid builds, not tested yet

+20
+3
pkgs/applications/science/misc/root/5.nix
··· 64 url = "https://github.com/root-project/root/commit/c75458024082de0cc35b45505c652b8460a9e71b.patch"; 65 sha256 = "sha256-A5zEjQE9OGPFp/L1HUs4NIdxQMRiwbwCRNWOLN2ENrM="; 66 }) 67 ]; 68 69 # https://github.com/root-project/root/issues/13216
··· 64 url = "https://github.com/root-project/root/commit/c75458024082de0cc35b45505c652b8460a9e71b.patch"; 65 sha256 = "sha256-A5zEjQE9OGPFp/L1HUs4NIdxQMRiwbwCRNWOLN2ENrM="; 66 }) 67 + # Backport Python 3.11 fix to v5 from v6.26 68 + # https://github.com/root-project/root/commit/484deb056dacf768aba4954073b41105c431bffc 69 + ./root5-python311-fix.patch 70 ]; 71 72 # https://github.com/root-project/root/issues/13216
+17
pkgs/applications/science/misc/root/root5-python311-fix.patch
···
··· 1 + diff --git a/bindings/pyroot/src/MethodProxy.cxx b/bindings/pyroot/src/MethodProxy.cxx 2 + --- a/bindings/pyroot/src/MethodProxy.cxx 3 + +++ b/bindings/pyroot/src/MethodProxy.cxx 4 + @@ -4,10 +4,10 @@ 5 + // Bindings 6 + #include "PyROOT.h" 7 + #include "structmember.h" // from Python 8 + -#if PY_VERSION_HEX >= 0x02050000 9 + -#include "code.h" // from Python 10 + -#else 11 + +#if PY_VERSION_HEX < 0x02050000 12 + #include "compile.h" // from Python 13 + +#elif PY_VERSION_HEX < 0x030b0000 14 + +#include "code.h" // from Python 15 + #endif 16 + #ifndef CO_NOFREE 17 + // python2.2 does not have CO_NOFREE defined