From 28c0cd5b1731d0d586c15cab88fd9ba309a77f0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Tue, 18 Jul 2023 15:44:56 +0200 Subject: [PATCH] cpython: remove broken include/python3.X/python3.Xm symlink The m flag was removed in Python 3.8: https://docs.python.org/3/whatsnew/3.8.html#build-and-c-api-changes Co-authored-by: Anders Kaseorg <26471+andersk@users.noreply.github.com> --- pkgs/development/interpreters/python/cpython/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index a491c6c1d619..07fdb03a72be 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -429,8 +429,6 @@ in with passthru; stdenv.mkDerivation { done touch $out/lib/${libPrefix}/test/__init__.py - ln -s "$out/include/${executable}m" "$out/include/${executable}" - # Determinism: Windows installers were not deterministic. # We're also not interested in building Windows installers. find "$out" -name 'wininst*.exe' | xargs -r rm -f @@ -458,6 +456,9 @@ in with passthru; stdenv.mkDerivation { # This allows build Python to import host Python's sysconfigdata mkdir -p "$out/${sitePackages}" ln -s "$out/lib/${libPrefix}/"_sysconfigdata*.py "$out/${sitePackages}/" + '' + lib.optionalString (pythonOlder "3.8") '' + # This is gone in Python >= 3.8 + ln -s "$out/include/${executable}m" "$out/include/${executable}" '' + optionalString stripConfig '' rm -R $out/bin/python*-config $out/lib/python*/config-* '' + optionalString stripIdlelib ''