Skip to content

Commit

Permalink
more build tweaks for OSX
Browse files Browse the repository at this point in the history
  • Loading branch information
rfk committed Dec 1, 2010
1 parent 1ec3e64 commit 6c0f463
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
3 changes: 2 additions & 1 deletion ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@

v0.9.0p1
v0.9.1

* Fix some build issues on OSX:
* varname typo in f_py2app.
* undo py2app's changes to env["MACOSX_DEPLOYMENT_TARGET"] after
it has finished its work.
* don't let get_platform() change its value due to changes in the
build environment; if it does the build files get corrupted.
* correctly handle dots etc in sys.executable
* Fix some built issues on win32:
* the py2exe custom chainloader tried to use 'nt' module before
it was imported, giving an UnboundLocalError.
Expand Down
4 changes: 2 additions & 2 deletions esky/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@

__ver_major__ = 0
__ver_minor__ = 9
__ver_patch__ = 0
__ver_sub__ = "p1"
__ver_patch__ = 1
__ver_sub__ = ""
__ver_tuple__ = (__ver_major__,__ver_minor__,__ver_patch__,__ver_sub__)
__version__ = "%d.%d.%d%s" % __ver_tuple__

Expand Down
14 changes: 11 additions & 3 deletions esky/bdist_esky/f_py2app.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import sys
import imp
import time
import errno
import zipfile
import shutil
import tempfile
Expand Down Expand Up @@ -112,7 +113,14 @@ def copy_to_bootstrap_env(src,dst=None):
else:
# Copy the core dependencies into the bootstrap env.
pydir = "python%d.%d" % sys.version_info[:2]
copy_to_bootstrap_env("Contents/Frameworks/Python.framework")
for nm in ("Python.framework","lib"+pydir+".dylib",):
try:
copy_to_bootstrap_env("Contents/Frameworks/" + nm)
except Exception, e:
# Distutils does its own crazy exception-raising which I
# have no interest in examining right now. Eventually this
# guard will be more conservative.
pass
copy_to_bootstrap_env("Contents/Resources/include")
copy_to_bootstrap_env("Contents/Resources/lib/"+pydir+"/config")
if "fcntl" not in sys.builtin_module_names:
Expand Down Expand Up @@ -140,9 +148,9 @@ def copy_to_bootstrap_env(src,dst=None):
copy_to_bootstrap_env("Contents/Info.plist")
copy_to_bootstrap_env("Contents/PkgInfo")
with open(os.path.join(app_dir,"Contents","Info.plist"),"rt") as f:
infotxt = f .read()
infotxt = f.read()
for nm in os.listdir(os.path.join(app_dir,"Contents","Resources")):
if nm in infotxt:
if "<string>%s</string>" % (nm,) in infotxt:
copy_to_bootstrap_env("Contents/Resources/"+nm)


Expand Down
3 changes: 2 additions & 1 deletion esky/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def appdir_from_executable(exepath):
but when running via a bundle on OSX the executable will be located at
<appdir>/Contents/MacOS/<exe>.
"""
appdir = dirname(exepath)
appdir = dirname(abspath(exepath))
if sys.platform == "darwin" and basename(appdir) == "MacOS":
# Looks like we might be in an app bundle.
appdir = dirname(appdir)
Expand Down Expand Up @@ -408,6 +408,7 @@ def _chainload(target_dir):
raise exc_type,exc_value,traceback
else:
raise exc_value
raise RuntimeError("couldn't chainload any executables")


def get_best_version(appdir,include_partial_installs=False,appname=None):
Expand Down

0 comments on commit 6c0f463

Please sign in to comment.