summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvarmaa <varmaa@8b7adc99-b347-0410-ae0a-d9e86c8d69b5>2008-05-05 04:09:57 +0000
committervarmaa <varmaa@8b7adc99-b347-0410-ae0a-d9e86c8d69b5>2008-05-05 04:09:57 +0000
commit115856f5b5b66b76307b9f63507a0dfbd672f58c (patch)
tree1c610c0d74ac906b42d995a71e083d44721b6dfd
parent85d163fd35851ef77fa27226a53575b9cc2b7e66 (diff)
downloadenso-115856f5b5b66b76307b9f63507a0dfbd672f58c.tar.gz
enso-115856f5b5b66b76307b9f63507a0dfbd672f58c.tar.bz2
Fixed the multi-pass scons bug mentioned in my last commit.
git-svn-id: https://enso.googlecode.com/svn/trunk@146 8b7adc99-b347-0410-ae0a-d9e86c8d69b5
-rw-r--r--src/platform/osx/SConscript55
-rw-r--r--src/platform/osx/pycairo/SConscript2
2 files changed, 39 insertions, 18 deletions
diff --git a/src/platform/osx/SConscript b/src/platform/osx/SConscript
index d213d2d..66ae90d 100644
--- a/src/platform/osx/SConscript
+++ b/src/platform/osx/SConscript
@@ -36,6 +36,12 @@ def getOutput( params ):
raise SystemError()
return output
+def installIntoRoot( env, path, files, alwaysInAppResources=False ):
+ if env["STANDALONE"] or alwaysInAppResources:
+ env.Install( "#bin/Enso.app/Contents/Resources/" + path,
+ files )
+ env.Install( "#" + path, files )
+
# ----------------------------------------------------------------------------
# Build Actions
@@ -70,7 +76,7 @@ quartzCairoBridge = qcbEnv.LoadableModule(
target = ["quartz_cairo_bridge.so"],
)
-qcbEnv.Install( "#enso/platform/osx", quartzCairoBridge )
+installIntoRoot( qcbEnv, "enso/platform/osx", quartzCairoBridge )
# key notifier
@@ -79,7 +85,7 @@ keyNotifier = env.Program(
FRAMEWORKS = ["ApplicationServices", "Foundation"]
)
-env.Install( "#bin", keyNotifier )
+installIntoRoot( env, "bin", keyNotifier, alwaysInAppResources=True )
# key utils
@@ -89,7 +95,7 @@ keyUtils = env.LoadableModule(
FRAMEWORKS = ["ApplicationServices"]
)
-env.Install( "#enso/platform/osx/selection", keyUtils )
+installIntoRoot( env, "enso/platform/osx/selection", keyUtils )
# Pycairo
@@ -101,14 +107,14 @@ pycairoEnv.Append( LINKFLAGS=FIND_MISSING_SYMS_AT_RUNTIME_FLAGS )
pycairoEnv["CCFLAGS"].remove( "-Werror" )
SConscript( "pycairo/SConscript", exports="pycairoEnv" )
+Import( "pycairoLib" )
+installIntoRoot( pycairoEnv, "enso/platform/osx/cairo", pycairoLib )
# App
enso = env.Program( "main.m",
FRAMEWORKS=["Cocoa", "Python"] )
env.InstallAs( "#bin/Enso.app/Contents/MacOS/Enso", enso )
-env.Install( "#bin/Enso.app/Contents/Resources/bin",
- keyNotifier )
env.InstallAs( "#bin/Enso.app/Contents/Resources/main.py",
"#scripts/run_enso.py" )
@@ -117,20 +123,35 @@ if env["STANDALONE"]:
SConscript( "appdata/SConscript", exports="env" )
-# Wanted to use the Mkdir() action here, but it's throwing some
-# bizarre exception, so we'll just use the command line.
-Execute( "mkdir -p %s" % Dir("#bin/Enso.app/Contents/Resources/enso") )
-
-basepath = Dir("#").abspath
ensoPkgDir = Dir("#enso").abspath
-ensoAppBundleDir = basepath + "/bin/Enso.app/Contents/Resources/enso"
+ensoAppBundleDir = Dir("#").abspath + "/bin/Enso.app/Contents/Resources/enso"
-Execute( "rm -rf %s" % ensoAppBundleDir )
+def isSymLink( path ):
+ if os.path.exists( path ):
+ try:
+ os.readlink( path )
+ return True
+ except OSError:
+ pass
+ return False
if env["STANDALONE"]:
- # TODO: This needs to be fixed; we're copying the OLD contents
- # of the enso directory before we actually carry out our SCons
- # actions!
- Execute( "cp -R %s %s" % (ensoPkgDir, ensoAppBundleDir) )
+ if isSymLink( ensoAppBundleDir ):
+ Execute( "rm %s" % ensoAppBundleDir )
+ for dirpath, dirnames, filenames in os.walk( ensoPkgDir ):
+ if ".svn" in dirnames:
+ dirnames.remove( ".svn" )
+ pyfiles = [filename for filename in filenames
+ if filename.endswith(".py")]
+ for filename in pyfiles:
+ abspath = os.path.join( dirpath, filename )
+ reldir = dirpath[len(ensoPkgDir)+1:]
+ env.Install( os.path.join(ensoAppBundleDir, reldir),
+ abspath )
else:
- Execute( "ln -s -f %s %s" % (ensoPkgDir, ensoAppBundleDir) )
+ if not isSymLink( ensoAppBundleDir ):
+ if os.path.exists( ensoAppBundleDir ):
+ Execute( "rm -rf %s" % ensoAppBundleDir )
+ else:
+ Execute( "mkdir -p %s" % ensoAppBundleDir )
+ Execute( "ln -s -f %s %s" % (ensoPkgDir, ensoAppBundleDir) )
diff --git a/src/platform/osx/pycairo/SConscript b/src/platform/osx/pycairo/SConscript
index bd8ae5b..b1d83b4 100644
--- a/src/platform/osx/pycairo/SConscript
+++ b/src/platform/osx/pycairo/SConscript
@@ -16,4 +16,4 @@ pycairoLib = pycairoEnv.LoadableModule(
LIBS=["python", cairo["lib"]]
)
-pycairoEnv.Install( "#enso/platform/osx/cairo", pycairoLib )
+Export( "pycairoLib" )