Bug 92085

Summary: "python-config" might not be at the same directory as "python" executable
Product: dbus Reporter: Yamashita, Yuu <peek824545201>
Component: pythonAssignee: Simon McVittie <smcv>
Status: RESOLVED FIXED QA Contact: D-Bus Maintainers <dbus>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: a patch for autoconf to find python-config from PATH

Description Yamashita, Yuu 2015-09-23 07:52:27 UTC
Created attachment 118406 [details]
a patch for autoconf to find python-config from PATH

Hi,

In dbus-python-1.2.0, its build script is invoking "python-config" as "$PYTHON-config". It means it is expecting "python-config" should always be at the same directory as "python" executable. It would not be true if user is trying to install the package into virtualenv or venv, though.

* https://virtualenv.pypa.io/en/latest/
* https://docs.python.org/3/library/venv.html

I believe basically the build script should find "python-config" from "$PATH" as standard manner as *nix. I prepared a patch for autoconf script to do so. Please consider merging it.

// originally I posted the patch to the fork at https://github.com/posborne/dbus-python/pull/1

Best,
Comment 1 Simon McVittie 2015-12-04 15:39:40 UTC
(In reply to Yamashita, Yuu from comment #0)
> I believe basically the build script should find "python-config" from
> "$PATH" as standard manner as *nix.

As stated here, this is wrong: it needs to find the python$VERSION-config that matches the python$VERSION that we're using. Luckily, what you're actually doing in the patch is more elaborate than described, and seems OK for arbitrary Python versions.

Your patch isn't going to work as-is for Debian's special debug-enabled builds of Python, which look like python3.4-dbg{,-config}, but I think I can work around that in the packaging by overriding PYTHON_CONFIG.

I can't help wondering whether there's a more standard solution to this.
Comment 2 Simon McVittie 2015-12-06 17:49:06 UTC
(In reply to Simon McVittie from comment #1)
> Your patch isn't going to work as-is for Debian's special debug-enabled
> builds of Python, which look like python3.4-dbg{,-config}, but I think I can
> work around that in the packaging by overriding PYTHON_CONFIG.

I applied your patch, then made some additional changes so it also picks up python3.4-dbg-config. Thanks!

Fixed in git master for 1.2.1 (or whatever I end up calling it).

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.