From cdf587265a3b5aa3c22a65843385dae57cf0a71f Mon Sep 17 00:00:00 2001 From: Mark Reid Date: Sat, 9 Nov 2019 18:23:12 -0800 Subject: [PATCH] Remove homebrew site-package symlink if exists --- scripts/appleseed.package.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/appleseed.package.py b/scripts/appleseed.package.py index a83a711e35..69cef7c420 100755 --- a/scripts/appleseed.package.py +++ b/scripts/appleseed.package.py @@ -744,6 +744,14 @@ def __add_python_to_stage(self): # just copy everything merge_tree(self.settings.python_path, python_dir, symlinks=True) + # Homebrew will create a symlink for site-packages. + # Replace it with a empty directory if found + python_home = os.path.join(python_dir, "Frameworks/Python.framework/Versions/2.7") + site_packages_path = os.path.join(python_home, "lib/python2.7/site-packages") + if os.path.islink(site_packages_path): + os.remove(site_packages_path) + safe_make_directory(site_packages_path) + def __copy_qt_framework(self, framework_name): framework_dir = framework_name + ".framework" src_filepath = os.path.join(self.settings.qt_runtime_path, "lib", framework_dir, "Versions", "5", framework_name)