[Bug 260278] Mk/Uses/python.mk: correct C extension shared library suffix

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 08 Dec 2021 18:02:56 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260278

            Bug ID: 260278
           Summary: Mk/Uses/python.mk: correct C extension shared library
                    suffix
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Ports Framework
          Assignee: portmgr@FreeBSD.org
          Reporter: mizhka@FreeBSD.org
                CC: ports-bugs@FreeBSD.org

Created attachment 229979
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=229979&action=edit
Git format-patch

Hi,

When python is built with option DEBUG, the suffix of extension is
".cpython-${PYVER}d", i.e. with additional letter 'd'. It breaks build of ports
like graphics/py-cairo and devel/gobject-introspection with error like:

=======================<phase: package        >============================
===>  Building package for py38-cairo-1.18.1_2,1
pkg-static: Unable to access file
/wrkdirs/usr/ports/graphics/py-cairo/work-py38/stage/usr/local/lib/python3.8/site-packages/cairo/_cairo.cpython-38.so:No
such file or directory
*** Error code 

The reason is different filename of shared library (additional 'd').
To fix it let's retrieve correct suffix if python is installed. This
information can be retrieved by oneliner:
 from distutils.sysconfig import
get_config_var;print('.'.join(get_config_var('EXT_SUFFIX').split('.')[:-1]))

Here is patch to fix this problem. It works for me on 14-current.

-- 
You are receiving this mail because:
You are on the CC list for the bug.