Commits
207 207 | subprocess.check_call(['cmake', sourcedir] + cmake_args) |
208 208 | subprocess.check_call(['cmake', '--build', '.']) |
209 209 | |
210 210 | # Copy GCC libs on Macos. |
211 211 | # TODO: Make this work with non-"standard" gcc location |
212 212 | if (sys.platform == 'darwin'): |
213 213 | gcc_dir = "/opt/local/lib/libgcc/" |
214 214 | casac_lib_dir = extdir + "/casatools/__casac__/lib" |
215 215 | copy_tree(gcc_dir, casac_lib_dir) |
216 216 | |
217 + | |
217 218 | # Collect all the libraries in a private directory and set relative rpaths |
218 219 | if mod_closure: |
219 220 | if isexe("scripts/mod-closure"): |
220 221 | print("generating module closure...") |
221 222 | if Proc([ "scripts/mod-closure", "--preserve-relative-paths", extdir ]) != 0: |
222 223 | sys.exit("\tclosure generation failed...") |
223 224 | if isexe("scripts/find-glibc-private"): |
224 225 | if Proc(["scripts/find-glibc-private", "--delete", extdir]) != 0: |
225 226 | sys.exit("\tGLIBC_PRIVATE cleanup failed...") |
226 227 | |
228 + | #Convert /opt/local/lib to @rpath on macOS |
229 + | if (sys.platform == 'darwin'): |
230 + | casac_lib_dir = extdir + "/casatools/__casac__/lib" |
231 + | from subprocess import call |
232 + | status=call("for f in `ls`; do install_name_tool -rpath /opt/local/lib @loader_path:@loader_path/lib:@rpath $f; done",cwd=casac_lib_dir,shell=True) |
233 + | |
227 234 | |
228 235 | def generate_extensions(): |
229 236 | |
230 237 | extensions = [] |
231 238 | cmdclass = {} |
232 239 | |
233 240 | cmdclass = {'build': XmlCMakeBuild, 'build_ext': XmlCMakeBuildExt} |
234 241 | |
235 242 | casatoolsswig_ext = XmlCMakeExtension('casatoolsswig') |
236 243 | extensions.append(casatoolsswig_ext) |