Commit fcd1dd40 authored by Tres Seaver's avatar Tres Seaver

Avoid prefixing buildout dir to 'special' rpath elements.

Fixes #225.
parent f4dad6b6
......@@ -130,7 +130,7 @@ class Develop(Base):
def build_ext(buildout, options):
result = {}
for be_option in ('include-dirs', 'library-dirs', 'rpath'):
for be_option in ('include-dirs', 'library-dirs'):
value = options.get(be_option)
if value is None:
continue
......@@ -145,6 +145,25 @@ def build_ext(buildout, options):
result[be_option] = os.pathsep.join(value)
options[be_option] = os.pathsep.join(value)
# rpath has special symbolic dirnames which must not be prefixed
# with the buildout dir. See:
# http://man7.org/linux/man-pages/man8/ld.so.8.html
RPATH_SPECIAL = [
'$ORIGIN', '$LIB', '$PLATFORM', '${ORIGIN}', '${LIB}', '${PLATFORM}']
def _prefix_non_special(x):
x = x.strip()
for special in RPATH_SPECIAL:
if x.startswith(special):
return x
return os.path.join( buildout['buildout']['directory'], x)
value = options.get('rpath')
if value is not None:
values = [_prefix_non_special(v)
for v in value.strip().split('\n') if v.strip()]
result['rpath'] = os.pathsep.join(value)
options['rpath'] = os.pathsep.join(value)
swig = options.get('swig')
if swig:
options['swig'] = result['swig'] = os.path.join(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment