Last active
December 15, 2015 03:39
-
-
Save ludwigschwardt/5195760 to your computer and use it in GitHub Desktop.
Patches for pyrap Homebrew formula
This file contains hidden or 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
diff --git a/batchbuild.py b/batchbuild.py | |
index 2af88a6..2b9cbf1 100755 | |
--- a/batchbuild.py | |
+++ b/batchbuild.py | |
@@ -5,7 +5,6 @@ import os | |
import glob | |
import shutil | |
import re | |
-import string | |
import optparse | |
import subprocess | |
@@ -22,9 +21,10 @@ def darwin_sdk(archlist=None): | |
if version[0] != '10' or int(version[1]) < 4: | |
print "Only Mac OS X >= 10.4 is supported" | |
sys.exit(1) | |
- sdk = string.join([""]+archlist.split(","), " -arch ") | |
- sdk += " -isysroot %s" % devpath[version[1]] | |
- return (string.join(version[:2],"."), sdk) | |
+ sdk = " -arch ".join([""] + archlist.split(",")) | |
+ if int(version[1]) < 7: | |
+ sdk += " -isysroot %s" % devpath[version[1]] | |
+ return (".".join(version[:2]), sdk) | |
usage = "usage: %prog [options] <packagename>" | |
diff --git a/libpyrap/tags/pyrap-0.3.2/scons-tools/utils.py b/libpyrap/tags/pyrap-0.3.2/scons-tools/utils.py | |
index fb87b5e..5eebb5a 100644 | |
--- a/libpyrap/tags/pyrap-0.3.2/scons-tools/utils.py | |
+++ b/libpyrap/tags/pyrap-0.3.2/scons-tools/utils.py | |
@@ -98,7 +98,7 @@ def generate(env): | |
if version[0] != '10' or int(version[1]) < 4: | |
print "Only Mac OS X >= 10.4 is supported" | |
env.Exit(1) | |
- return devpath[version[1]] | |
+ return devpath[version[1]] if version[1] in devpath else '' | |
env.DarwinDevSdk = DarwinDevSdk | |
env["ARCHLIBDIR"] = ARCHLIBDIR | |
@@ -223,11 +223,11 @@ def generate(env): | |
uniarch = env.get("universal", False) | |
flags = [] | |
if uniarch: | |
- for i in uniarch.split(','): | |
+ for i in uniarch.split(','): | |
flags += ['-arch', i] | |
- ppflags = flags + ['-isysroot' , env.DarwinDevSdk() ] | |
- linkflags = flags + ['-Wl,-syslibroot,%s'\ | |
- % env.DarwinDevSdk()] | |
+ sdk = env.DarwinDevSdk() | |
+ ppflags = (flags + ['-isysroot' , sdk]) if sdk else flags | |
+ linkflags = (flags + ['-Wl,-syslibroot,%s' % sdk]) if sdk else flags | |
env.Append(CPPFLAGS=ppflags) | |
env.Append(SHLINKFLAGS=linkflags) | |
env.Append(LINKFLAGS=linkflags) |
This file contains hidden or 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
diff --git a/libpyrap/tags/pyrap-0.3.2/pyrap/Converters/PycArrayComCC.h b/libpyrap/tags/pyrap-0.3.2/pyrap/Converters/PycArrayComCC.h | |
index ccf45f5..c23c6ea 100644 | |
--- a/libpyrap/tags/pyrap-0.3.2/pyrap/Converters/PycArrayComCC.h | |
+++ b/libpyrap/tags/pyrap-0.3.2/pyrap/Converters/PycArrayComCC.h | |
@@ -49,7 +49,7 @@ | |
{ | |
if (!PyArray_API) { | |
if (!importArray() || !PyArray_API) { | |
- throw AipsError ("PycArray: failed to load the "PYC_USE_PYARRAY | |
+ throw AipsError ("PycArray: failed to load the " PYC_USE_PYARRAY | |
" API"); | |
} | |
} |
This file contains hidden or 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
diff --git a/batchbuild.py b/batchbuild.py | |
index 2b9cbf1..54fda81 100755 | |
--- a/batchbuild.py | |
+++ b/batchbuild.py | |
@@ -223,7 +223,7 @@ def run_python(pkg, args): | |
if sys.platform == "darwin": | |
vers, sdk = darwin_sdk(args.universal) | |
os.environ["MACOSX_DEPLOYMENT_TARGET"] = vers | |
- os.environ["CFLAGS"] = sdk | |
+ os.environ["CFLAGS"] = sdk + ' -std=c++11' | |
os.environ["LDSHARED"] = 'g++ -g -bundle -undefined dynamic_lookup' | |
if args.enable_rpath: | |
os.environ["LDSHARED"] += ' -Wl,-rpath,%s/lib' % args.prefix | |
@@ -292,6 +292,7 @@ def run_scons(target, args): | |
if sys.platform == "darwin": | |
if args.universal: | |
command += " --universal=%s" % args.universal | |
+ command += " --extra-cxxflags='-std=c++11'" | |
if args.clean: | |
command += " --clean" | |
elif args.test: |
This file contains hidden or 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
diff --git a/pyrap_images/tags/pyrap_images-0.1.1/setup.py b/pyrap_images/tags/pyrap_images-0.1.1/setup.py | |
index 004ce9c..3966004 100644 | |
--- a/pyrap_images/tags/pyrap_images-0.1.1/setup.py | |
+++ b/pyrap_images/tags/pyrap_images-0.1.1/setup.py | |
@@ -6,7 +6,7 @@ from setupext import assay | |
PKGNAME = "pyrap.images" | |
EXTNAME = "_images" | |
-casalibs = ['casa_images', 'casa_components', 'casa_coordinates', | |
+casalibs = ['casa_images', 'casa_coordinates', | |
'casa_fits', 'casa_lattices', 'casa_measures', | |
'casa_scimath', 'casa_scimath_f', 'casa_tables', 'casa_mirlib'] | |
# casa_casa is added by default |
This file contains hidden or 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
diff --git a/libpyrap/tags/pyrap-1.4.0/scons-tools/utils.py b/libpyrap/tags/pyrap-1.4.0/scons-tools/utils.py | |
index fb87b5e..5eebb5a 100644 | |
--- a/libpyrap/tags/pyrap-1.4.0/scons-tools/utils.py | |
+++ b/libpyrap/tags/pyrap-1.4.0/scons-tools/utils.py | |
@@ -98,7 +98,7 @@ def generate(env): | |
if version[0] != '10' or int(version[1]) < 4: | |
print "Only Mac OS X >= 10.4 is supported" | |
env.Exit(1) | |
- return devpath[version[1]] | |
+ return devpath[version[1]] if version[1] in devpath else '' | |
env.DarwinDevSdk = DarwinDevSdk | |
env["ARCHLIBDIR"] = ARCHLIBDIR | |
@@ -223,11 +223,11 @@ def generate(env): | |
uniarch = env.get("universal", False) | |
flags = [] | |
if uniarch: | |
- for i in uniarch.split(','): | |
+ for i in uniarch.split(','): | |
flags += ['-arch', i] | |
- ppflags = flags + ['-isysroot' , env.DarwinDevSdk() ] | |
- linkflags = flags + ['-Wl,-syslibroot,%s'\ | |
- % env.DarwinDevSdk()] | |
+ sdk = env.DarwinDevSdk() | |
+ ppflags = (flags + ['-isysroot' , sdk]) if sdk else flags | |
+ linkflags = (flags + ['-Wl,-syslibroot,%s' % sdk]) if sdk else flags | |
env.Append(CPPFLAGS=ppflags) | |
env.Append(SHLINKFLAGS=linkflags) | |
env.Append(LINKFLAGS=linkflags) | |
diff --git a/libpyrap/trunk/scons-tools/utils.py b/libpyrap/trunk/scons-tools/utils.py | |
index fb87b5e..5eebb5a 100644 | |
--- a/libpyrap/trunk/scons-tools/utils.py | |
+++ b/libpyrap/trunk/scons-tools/utils.py | |
@@ -98,7 +98,7 @@ def generate(env): | |
if version[0] != '10' or int(version[1]) < 4: | |
print "Only Mac OS X >= 10.4 is supported" | |
env.Exit(1) | |
- return devpath[version[1]] | |
+ return devpath[version[1]] if version[1] in devpath else '' | |
env.DarwinDevSdk = DarwinDevSdk | |
env["ARCHLIBDIR"] = ARCHLIBDIR | |
@@ -223,11 +223,11 @@ def generate(env): | |
uniarch = env.get("universal", False) | |
flags = [] | |
if uniarch: | |
- for i in uniarch.split(','): | |
+ for i in uniarch.split(','): | |
flags += ['-arch', i] | |
- ppflags = flags + ['-isysroot' , env.DarwinDevSdk() ] | |
- linkflags = flags + ['-Wl,-syslibroot,%s'\ | |
- % env.DarwinDevSdk()] | |
+ sdk = env.DarwinDevSdk() | |
+ ppflags = (flags + ['-isysroot' , sdk]) if sdk else flags | |
+ linkflags = (flags + ['-Wl,-syslibroot,%s' % sdk]) if sdk else flags | |
env.Append(CPPFLAGS=ppflags) | |
env.Append(SHLINKFLAGS=linkflags) | |
env.Append(LINKFLAGS=linkflags) |
This file contains hidden or 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
diff --git a/pyrap_fitting/tags/pyrap_fitting-0.2.1/setupext.py b/pyrap_fitting/tags/pyrap_fitting-0.2.1/setupext.py | |
index 82428c6..3d21b61 100644 | |
--- a/pyrap_fitting/tags/pyrap_fitting-0.2.1/setupext.py | |
+++ b/pyrap_fitting/tags/pyrap_fitting-0.2.1/setupext.py | |
@@ -121,7 +121,7 @@ class casacorebuild_ext(build_ext.build_ext): | |
self.libraries += [self.boostlib] | |
self.libraries += self.blaslib.split(",") | |
self.libraries += self.lapacklib.split(",") | |
- self.libraries += [self.f2clib] | |
+# self.libraries += [self.f2clib] | |
if self.enable_hdf5: | |
hdf5libdir = os.path.join(self.hdf5, ARCHLIBDIR) | |
diff --git a/pyrap_functionals/tags/pyrap_functionals-0.2.1/setupext.py b/pyrap_functionals/tags/pyrap_functionals-0.2.1/setupext.py | |
index 82428c6..3d21b61 100644 | |
--- a/pyrap_functionals/tags/pyrap_functionals-0.2.1/setupext.py | |
+++ b/pyrap_functionals/tags/pyrap_functionals-0.2.1/setupext.py | |
@@ -121,7 +121,7 @@ class casacorebuild_ext(build_ext.build_ext): | |
self.libraries += [self.boostlib] | |
self.libraries += self.blaslib.split(",") | |
self.libraries += self.lapacklib.split(",") | |
- self.libraries += [self.f2clib] | |
+# self.libraries += [self.f2clib] | |
if self.enable_hdf5: | |
hdf5libdir = os.path.join(self.hdf5, ARCHLIBDIR) | |
diff --git a/pyrap_images/tags/pyrap_images-0.1.1/setupext.py b/pyrap_images/tags/pyrap_images-0.1.1/setupext.py | |
index 34abb7c..903c7a4 100644 | |
--- a/pyrap_images/tags/pyrap_images-0.1.1/setupext.py | |
+++ b/pyrap_images/tags/pyrap_images-0.1.1/setupext.py | |
@@ -136,7 +136,7 @@ class casacorebuild_ext(build_ext.build_ext): | |
self.libraries += [self.cfitsiolib] | |
self.libraries += self.blaslib.split(",") | |
self.libraries += self.lapacklib.split(",") | |
- self.libraries += [self.f2clib] | |
+# self.libraries += [self.f2clib] | |
if self.enable_hdf5: | |
if hdf5libdir not in self.library_dirs: | |
diff --git a/pyrap_measures/tags/pyrap_measures-0.2.1/setupext.py b/pyrap_measures/tags/pyrap_measures-0.2.1/setupext.py | |
index 82428c6..3d21b61 100644 | |
--- a/pyrap_measures/tags/pyrap_measures-0.2.1/setupext.py | |
+++ b/pyrap_measures/tags/pyrap_measures-0.2.1/setupext.py | |
@@ -121,7 +121,7 @@ class casacorebuild_ext(build_ext.build_ext): | |
self.libraries += [self.boostlib] | |
self.libraries += self.blaslib.split(",") | |
self.libraries += self.lapacklib.split(",") | |
- self.libraries += [self.f2clib] | |
+# self.libraries += [self.f2clib] | |
if self.enable_hdf5: | |
hdf5libdir = os.path.join(self.hdf5, ARCHLIBDIR) |
This file contains hidden or 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
diff --git a/pyrap_fitting/trunk/setupext.py b/pyrap_fitting/trunk/setupext.py | |
index 82428c6..3d21b61 100644 | |
--- a/pyrap_fitting/trunk/setupext.py | |
+++ b/pyrap_fitting/trunk/setupext.py | |
@@ -121,7 +121,7 @@ class casacorebuild_ext(build_ext.build_ext): | |
self.libraries += [self.boostlib] | |
self.libraries += self.blaslib.split(",") | |
self.libraries += self.lapacklib.split(",") | |
- self.libraries += [self.f2clib] | |
+# self.libraries += [self.f2clib] | |
if self.enable_hdf5: | |
hdf5libdir = os.path.join(self.hdf5, ARCHLIBDIR) | |
diff --git a/pyrap_functionals/trunk/setupext.py b/pyrap_functionals/trunk/setupext.py | |
index 82428c6..3d21b61 100644 | |
--- a/pyrap_functionals/trunk/setupext.py | |
+++ b/pyrap_functionals/trunk/setupext.py | |
@@ -121,7 +121,7 @@ class casacorebuild_ext(build_ext.build_ext): | |
self.libraries += [self.boostlib] | |
self.libraries += self.blaslib.split(",") | |
self.libraries += self.lapacklib.split(",") | |
- self.libraries += [self.f2clib] | |
+# self.libraries += [self.f2clib] | |
if self.enable_hdf5: | |
hdf5libdir = os.path.join(self.hdf5, ARCHLIBDIR) | |
diff --git a/pyrap_images/trunk/setupext.py b/pyrap_images/trunk/setupext.py | |
index 34abb7c..903c7a4 100644 | |
--- a/pyrap_images/trunk/setupext.py | |
+++ b/pyrap_images/trunk/setupext.py | |
@@ -136,7 +136,7 @@ class casacorebuild_ext(build_ext.build_ext): | |
self.libraries += [self.cfitsiolib] | |
self.libraries += self.blaslib.split(",") | |
self.libraries += self.lapacklib.split(",") | |
- self.libraries += [self.f2clib] | |
+# self.libraries += [self.f2clib] | |
if self.enable_hdf5: | |
if hdf5libdir not in self.library_dirs: | |
diff --git a/pyrap_measures/trunk/setupext.py b/pyrap_measures/trunk/setupext.py | |
index 82428c6..3d21b61 100644 | |
--- a/pyrap_measures/trunk/setupext.py | |
+++ b/pyrap_measures/trunk/setupext.py | |
@@ -121,7 +121,7 @@ class casacorebuild_ext(build_ext.build_ext): | |
self.libraries += [self.boostlib] | |
self.libraries += self.blaslib.split(",") | |
self.libraries += self.lapacklib.split(",") | |
- self.libraries += [self.f2clib] | |
+# self.libraries += [self.f2clib] | |
if self.enable_hdf5: | |
hdf5libdir = os.path.join(self.hdf5, ARCHLIBDIR) |
This file contains hidden or 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
diff --git a/libpyrap/tags/pyrap-0.3.2/SConstruct b/libpyrap/tags/pyrap-0.3.2/SConstruct | |
index 766c0ab..6d22dac 100644 | |
--- a/libpyrap/tags/pyrap-0.3.2/SConstruct | |
+++ b/libpyrap/tags/pyrap-0.3.2/SConstruct | |
@@ -38,7 +38,12 @@ if not env.GetOption('clean') and not env.GetOption('help'): | |
if not conf.CheckHeader("Python.h", language='c'): | |
Exit(1) | |
pylib = 'python'+distutils.sysconfig.get_python_version() | |
- if env['PLATFORM'] == "darwin": | |
+ # Don't use Python framework on Darwin, as this always finds system Python | |
+ # framework regardless whether a different Python is in use, | |
+ # leading to subtle bugs - rework this to use python-config one day | |
+ # (see e.g. http://reviews.gem5.org/r/1933/ for how to do it) | |
+ # if env['PLATFORM'] == "darwin": | |
+ if 0: | |
print "Platform darwin - using python framework" | |
fwpth = env.get("framework_path") | |
if fwpth: |
This file contains hidden or 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
diff --git a/libpyrap/trunk/SConstruct b/libpyrap/trunk/SConstruct | |
index 766c0ab..6d22dac 100644 | |
--- a/libpyrap/trunk/SConstruct | |
+++ b/libpyrap/trunk/SConstruct | |
@@ -38,7 +38,12 @@ if not env.GetOption('clean') and not env.GetOption('help'): | |
if not conf.CheckHeader("Python.h", language='c'): | |
Exit(1) | |
pylib = 'python'+distutils.sysconfig.get_python_version() | |
- if env['PLATFORM'] == "darwin": | |
+ # Don't use Python framework on Darwin, as this always finds system Python | |
+ # framework regardless whether a different Python is in use, | |
+ # leading to subtle bugs - rework this to use python-config one day | |
+ # (see e.g. http://reviews.gem5.org/r/1933/ for how to do it) | |
+ # if env['PLATFORM'] == "darwin": | |
+ if 0: | |
print "Platform darwin - using python framework" | |
fwpth = env.get("framework_path") | |
if fwpth: |
This file contains hidden or 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
diff --git a/libpyrap/trunk/pyrap/Converters/PycArrayComCC.h b/libpyrap/trunk/pyrap/Converters/PycArrayComCC.h | |
index 85d7eee..e6b2d1d 100644 | |
--- a/libpyrap/trunk/pyrap/Converters/PycArrayComCC.h | |
+++ b/libpyrap/trunk/pyrap/Converters/PycArrayComCC.h | |
@@ -49,7 +49,7 @@ | |
{ | |
if (!PyArray_API) { | |
if (!importArray() || !PyArray_API) { | |
- throw AipsError ("PycArray: failed to load the "PYC_USE_PYARRAY | |
+ throw AipsError ("PycArray: failed to load the " PYC_USE_PYARRAY | |
" API"); | |
} | |
} |
This file contains hidden or 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
diff --git a/batchbuild-trunk.py b/batchbuild-trunk.py | |
index 0ccfc27..adc0192 100755 | |
--- a/batchbuild-trunk.py | |
+++ b/batchbuild-trunk.py | |
@@ -227,7 +227,7 @@ def run_python(pkg, args): | |
if sys.platform == "darwin": | |
vers, sdk = darwin_sdk(args.universal) | |
os.environ["MACOSX_DEPLOYMENT_TARGET"] = vers | |
- os.environ["CFLAGS"] = sdk | |
+ os.environ["CFLAGS"] = sdk + ' -std=c++11' | |
os.environ["LDSHARED"] = 'g++ -g -bundle -undefined dynamic_lookup' | |
if args.enable_rpath: | |
os.environ["LDSHARED"] += ' -Wl,-rpath,%s/lib' % args.prefix | |
@@ -296,6 +296,7 @@ def run_scons(target, args): | |
if sys.platform == "darwin": | |
if args.universal: | |
command += " --universal=%s" % args.universal | |
+ command += " --extra-cxxflags='-std=c++11'" | |
if args.clean: | |
command += " --clean" | |
elif args.test: |
This file contains hidden or 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
diff --git a/pyrap_images/trunk/setup.py b/pyrap_images/trunk/setup.py | |
index 251fad6..180e3d8 100644 | |
--- a/pyrap_images/trunk/setup.py | |
+++ b/pyrap_images/trunk/setup.py | |
@@ -6,7 +6,7 @@ from setupext import assay | |
PKGNAME = "pyrap.images" | |
EXTNAME = "_images" | |
-casalibs = ['casa_images', 'casa_components', 'casa_coordinates', | |
+casalibs = ['casa_images', 'casa_coordinates', | |
'casa_fits', 'casa_lattices', 'casa_measures', | |
'casa_scimath', 'casa_scimath_f', 'casa_tables', 'casa_mirlib'] | |
# casa_casa is added by default |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment