gst-uninstalled: symlink mesonconfig in site-packages
authorMathieu Duponchelle <mathieu@centricular.com>
Mon, 15 Jan 2018 04:18:34 +0000 (05:18 +0100)
committerMathieu Duponchelle <mathieu@centricular.com>
Fri, 19 Jan 2018 20:07:08 +0000 (21:07 +0100)
This is still incredibly ugly, but at least now mesonconfig
gets found, unlike before where the path where it was looked
for was the path of the sitecustomize symlink, not of its target
(https://bugs.python.org/issue6386)

gst-uninstalled.py

index 07832d734b20b18bc6cff9485861681680dc8e80..befceef300d668c4756102d17881489560456c0b 100755 (executable)
@@ -166,6 +166,8 @@ def python_env(options, unset_env=False):
 
     sitecustomize = os.path.join(sitepackages, "sitecustomize.py")
     overrides_hack = os.path.join(gst_python_path, "testsuite", "overrides_hack.py")
+    mesonconfig = os.path.join(gst_python_path, "testsuite", "mesonconfig.py")
+    mesonconfig_link = os.path.join(sitepackages, "mesonconfig.py")
 
     if not unset_env:
         if os.path.exists(sitecustomize):
@@ -180,12 +182,14 @@ def python_env(options, unset_env=False):
             os.makedirs(sitepackages)
 
         os.symlink(overrides_hack, sitecustomize)
+        os.symlink(mesonconfig, mesonconfig_link)
         return os.path.realpath(sitecustomize) == overrides_hack
     else:
         if not os.path.realpath(sitecustomize) == overrides_hack:
             return False
 
         os.remove(sitecustomize)
+        os.remove (mesonconfig_link)
         old_sitecustomize = os.path.join(sitepackages,
                                             "old.sitecustomize.gstuninstalled.py")