forked from mcedit/mcedit2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed building on MacOS 10.10 Yosemite
- Loading branch information
Showing
2 changed files
with
61 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
-r requirements-mceditlib.txt | ||
pyzmq==15.0.0 # v15.4.0 fails to freeze with PyInstaller - see pyinstaller/issues/2147 | ||
pyside>=1.2.0 ; sys.platform != 'darwin' # install this via homebrew, not visible to pip | ||
pyside>=1.2.0 ; sys.platform != 'darwin' # install this via homebrew or macports, not visible to pip | ||
pyopengl | ||
ipython | ||
qtconsole | ||
qtconsole==4.1.1 # later versions may require higher versions of pyzmq | ||
pygments | ||
pastebin | ||
raven |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# -*- coding: utf-8 -*- | ||
# The following file is for fixing the build environment on Mac OS 10.10 Yosemite. It may work | ||
# Steal PySide stuff from MacPorts install locations since HomeBrew dropped support for Yosemite! | ||
# Before running this script, install the following ports using MacPorts: (sudo port install FOO) | ||
# py27-pyside-tools | ||
# py27-pyside | ||
from __future__ import print_function | ||
|
||
__author__ = 'ethan' | ||
|
||
import collections | ||
import os | ||
import shutil | ||
import subprocess | ||
|
||
PathSub_T = collections.namedtuple('PathSub_T', ['old_root', 'new_root']) | ||
|
||
VENV_DIR = os.path.abspath(os.getenv('VIRTUAL_ENV', None)) | ||
assert os.path.isdir(VENV_DIR) # Ensure the virtual env is functional | ||
|
||
|
||
def steal_port(port_name, path_subs): | ||
print("Stealing {}".format(port_name)) | ||
port_contents = [p.strip() for p in subprocess.check_output(['port', '-q', 'contents', port_name]).splitlines()] | ||
for port_content_path in port_contents: | ||
for path_sub in path_subs: # type: PathSub_T | ||
if port_content_path.startswith(path_sub.old_root): | ||
new_content_path = port_content_path.replace(path_sub.old_root, path_sub.new_root, 1) | ||
|
||
if os.path.exists(new_content_path): | ||
print(" --> Skipping re-copying {} -> {}".format(port_content_path, new_content_path)) | ||
else: | ||
if not os.path.isdir(os.path.dirname(new_content_path)): | ||
os.makedirs(os.path.dirname(new_content_path)) | ||
print(" --> Copying {} -> {}".format(port_content_path, new_content_path)) | ||
shutil.copy(port_content_path, new_content_path) | ||
break | ||
else: | ||
print(" --> No steal rule for {}".format(port_content_path)) | ||
print(" --> Done stealing {}".format(port_name)) | ||
|
||
|
||
def main(): | ||
steal_port('py27-pyside-tools', | ||
[PathSub_T('/opt/local/Library/Frameworks/Python.framework/Versions/2.7', VENV_DIR), | ||
PathSub_T('/opt/local/bin', os.path.join(VENV_DIR, 'bin'))] | ||
) | ||
|
||
steal_port('py27-pyside', | ||
[PathSub_T('/opt/local/Library/Frameworks/Python.framework/Versions/2.7', VENV_DIR), | ||
PathSub_T('/opt/local/include', os.path.join(VENV_DIR, 'include')), | ||
PathSub_T('/opt/local/lib/', os.path.join(VENV_DIR, 'lib')), | ||
PathSub_T('/opt/local/share', os.path.join(VENV_DIR, 'share')) | ||
] | ||
) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |