[gtk-osx] Bug 766738: Set the python module installation path for Apple python.
- From: John Ralls <jralls src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-osx] Bug 766738: Set the python module installation path for Apple python.
- Date: Thu, 26 May 2016 17:43:12 +0000 (UTC)
commit a4e838693d1fc51b0b5afd2a666a7cadc856a92c
Author: John Ralls <jralls ceridwen us>
Date: Thu May 26 10:36:10 2016 -0700
Bug 766738: Set the python module installation path for Apple python.
Apple's python tries to install libxml2 modules into /System/Library,
which isn't allowed on El Cap and later and requires sudo on previous.
Set the installation path to $PREFIX instead.
jhbuildrc-gtk-osx | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/jhbuildrc-gtk-osx b/jhbuildrc-gtk-osx
index 3ac07fe..6d4110e 100644
--- a/jhbuildrc-gtk-osx
+++ b/jhbuildrc-gtk-osx
@@ -659,6 +659,19 @@ else:
if not _ran_recursively and _gtk_osx_prompt_prefix:
os.environ["JHBUILD_PROMPT"] = "[" + _gtk_osx_prompt_prefix + "] "
+#Bug 766738: Apple's python tries to install extensions in
+#/Library/Python, which requires sudo. Change that to the right place
+#inside prefix. Note that we need the installed python's version to
+#get the right directory name.
+
+if (not "python" in modules and
+ not os.path.exists(os.path.join(prefix, 'bin', 'python2'))):
+ _python_ver = 'python' + '.'.join([str(_x) for _x in sys.version_info[0:2]])
+ _python_install_path = os.path.join(prefix, 'lib',
+ _python_ver, 'site-packages')
+ append_autogenargs('libxml2',
+ '--with-python-install-dir=' + _python_install_path)
+
# Unset this so we don't mess with the check for not starting
# recursively.
os.unsetenv("JHB")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]