libdwarf: remove use of hide_files()
- This was a nasty workaround due to the way our compiler wrappers used
to work. We don't want to have to modify our elfutils installation to
install libdwarf.
- Since cd9691de5
, we no longer need this because the package will always
come before dependencies in our include order.
This commit is contained in:
parent
1ec06e6111
commit
43c77ac3cb
@ -60,7 +60,6 @@
|
|||||||
'fix_darwin_install_name',
|
'fix_darwin_install_name',
|
||||||
'force_remove',
|
'force_remove',
|
||||||
'force_symlink',
|
'force_symlink',
|
||||||
'hide_files',
|
|
||||||
'install',
|
'install',
|
||||||
'install_tree',
|
'install_tree',
|
||||||
'is_exe',
|
'is_exe',
|
||||||
@ -392,18 +391,6 @@ def replace_directory_transaction(directory_name, tmp_root=None):
|
|||||||
tty.debug('TEMPORARY DIRECTORY DELETED [{0}]'.format(tmp_dir))
|
tty.debug('TEMPORARY DIRECTORY DELETED [{0}]'.format(tmp_dir))
|
||||||
|
|
||||||
|
|
||||||
@contextmanager
|
|
||||||
def hide_files(*file_list):
|
|
||||||
try:
|
|
||||||
baks = ['%s.bak' % f for f in file_list]
|
|
||||||
for f, bak in zip(file_list, baks):
|
|
||||||
shutil.move(f, bak)
|
|
||||||
yield
|
|
||||||
finally:
|
|
||||||
for f, bak in zip(file_list, baks):
|
|
||||||
shutil.move(bak, f)
|
|
||||||
|
|
||||||
|
|
||||||
def hash_directory(directory):
|
def hash_directory(directory):
|
||||||
"""Hashes recursively the content of a directory.
|
"""Hashes recursively the content of a directory.
|
||||||
|
|
||||||
|
@ -61,77 +61,69 @@ def patch(self):
|
|||||||
filter_file(r'^typedef struct Elf Elf;$', '', 'libdwarf/libdwarf.h.in')
|
filter_file(r'^typedef struct Elf Elf;$', '', 'libdwarf/libdwarf.h.in')
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
|
# dwarf build does not set arguments for ar properly
|
||||||
|
make.add_default_arg('ARFLAGS=rcs')
|
||||||
|
|
||||||
# elfutils contains a dwarf.h that conflicts with libdwarf's
|
# Dwarf doesn't provide an install, so we have to do it.
|
||||||
# TODO: we should remove this when we can modify the include order
|
mkdirp(prefix.bin, prefix.include, prefix.lib, prefix.man.man1)
|
||||||
hide_list = []
|
|
||||||
if spec.satisfies('^elfutils'):
|
|
||||||
dwarf_h = join_path(spec['elfutils'].prefix, 'include/dwarf.h')
|
|
||||||
hide_list.append(dwarf_h)
|
|
||||||
with hide_files(*hide_list):
|
|
||||||
# dwarf build does not set arguments for ar properly
|
|
||||||
make.add_default_arg('ARFLAGS=rcs')
|
|
||||||
|
|
||||||
# Dwarf doesn't provide an install, so we have to do it.
|
with working_dir('libdwarf'):
|
||||||
mkdirp(prefix.bin, prefix.include, prefix.lib, prefix.man.man1)
|
extra_config_args = []
|
||||||
|
|
||||||
with working_dir('libdwarf'):
|
# this is to prevent picking up system /usr/include/libelf.h
|
||||||
extra_config_args = []
|
if spec.satisfies('^libelf'):
|
||||||
|
libelf_inc_dir = join_path(spec['libelf'].prefix,
|
||||||
|
'include/libelf')
|
||||||
|
extra_config_args.append(
|
||||||
|
'CFLAGS=-I{0} -Wl,-L{1} -Wl,-lelf'.format(
|
||||||
|
libelf_inc_dir, spec['libelf'].prefix.lib))
|
||||||
|
configure("--prefix=" + prefix, "--enable-shared",
|
||||||
|
*extra_config_args)
|
||||||
|
filter_file(r'^dwfzlib\s*=\s*-lz',
|
||||||
|
'dwfzlib=-L{0} -lz'.format(
|
||||||
|
self.spec['zlib'].prefix.lib),
|
||||||
|
'Makefile')
|
||||||
|
make()
|
||||||
|
|
||||||
# this is to prevent picking up system /usr/include/libelf.h
|
libdwarf_name = 'libdwarf.{0}'.format(dso_suffix)
|
||||||
if spec.satisfies('^libelf'):
|
libdwarf1_name = 'libdwarf.{0}'.format(dso_suffix) + ".1"
|
||||||
libelf_inc_dir = join_path(spec['libelf'].prefix,
|
install('libdwarf.a', prefix.lib)
|
||||||
'include/libelf')
|
install('libdwarf.so', join_path(prefix.lib, libdwarf1_name))
|
||||||
extra_config_args.append(
|
if spec.satisfies('@20160507:'):
|
||||||
'CFLAGS=-I{0} -Wl,-L{1} -Wl,-lelf'.format(
|
with working_dir(prefix.lib):
|
||||||
libelf_inc_dir, spec['libelf'].prefix.lib))
|
os.symlink(libdwarf1_name, libdwarf_name)
|
||||||
configure("--prefix=" + prefix, "--enable-shared",
|
install('libdwarf.h', prefix.include)
|
||||||
*extra_config_args)
|
install('dwarf.h', prefix.include)
|
||||||
filter_file(r'^dwfzlib\s*=\s*-lz',
|
|
||||||
'dwfzlib=-L{0} -lz'.format(
|
|
||||||
self.spec['zlib'].prefix.lib),
|
|
||||||
'Makefile')
|
|
||||||
make()
|
|
||||||
|
|
||||||
libdwarf_name = 'libdwarf.{0}'.format(dso_suffix)
|
# It seems like fix_darwin_install_name can't be used
|
||||||
libdwarf1_name = 'libdwarf.{0}'.format(dso_suffix) + ".1"
|
# here directly; the install name of the library in
|
||||||
install('libdwarf.a', prefix.lib)
|
# the stage directory must be fixed in order for dyld
|
||||||
install('libdwarf.so', join_path(prefix.lib, libdwarf1_name))
|
# to locate it on Darwin when spack builds dwarfdump
|
||||||
if spec.satisfies('@20160507:'):
|
if sys.platform == 'darwin':
|
||||||
with working_dir(prefix.lib):
|
install_name_tool = which('install_name_tool')
|
||||||
os.symlink(libdwarf1_name, libdwarf_name)
|
install_name_tool('-id',
|
||||||
install('libdwarf.h', prefix.include)
|
join_path('..', 'libdwarf',
|
||||||
install('dwarf.h', prefix.include)
|
'libdwarf.so'),
|
||||||
|
'libdwarf.so')
|
||||||
|
|
||||||
# It seems like fix_darwin_install_name can't be used
|
if spec.satisfies('@20130126:20130729'):
|
||||||
# here directly; the install name of the library in
|
dwarfdump_dir = 'dwarfdump2'
|
||||||
# the stage directory must be fixed in order for dyld
|
else:
|
||||||
# to locate it on Darwin when spack builds dwarfdump
|
dwarfdump_dir = 'dwarfdump'
|
||||||
if sys.platform == 'darwin':
|
with working_dir(dwarfdump_dir):
|
||||||
install_name_tool = which('install_name_tool')
|
configure("--prefix=" + prefix)
|
||||||
install_name_tool('-id',
|
filter_file(r'^dwfzlib\s*=\s*-lz',
|
||||||
join_path('..', 'libdwarf',
|
'dwfzlib=-L{0} -lz'.format(
|
||||||
'libdwarf.so'),
|
self.spec['zlib'].prefix.lib),
|
||||||
'libdwarf.so')
|
'Makefile')
|
||||||
|
|
||||||
if spec.satisfies('@20130126:20130729'):
|
# This makefile has strings of copy commands that
|
||||||
dwarfdump_dir = 'dwarfdump2'
|
# cause a race in parallel
|
||||||
else:
|
make(parallel=False)
|
||||||
dwarfdump_dir = 'dwarfdump'
|
|
||||||
with working_dir(dwarfdump_dir):
|
|
||||||
configure("--prefix=" + prefix)
|
|
||||||
filter_file(r'^dwfzlib\s*=\s*-lz',
|
|
||||||
'dwfzlib=-L{0} -lz'.format(
|
|
||||||
self.spec['zlib'].prefix.lib),
|
|
||||||
'Makefile')
|
|
||||||
|
|
||||||
# This makefile has strings of copy commands that
|
install('dwarfdump', prefix.bin)
|
||||||
# cause a race in parallel
|
install('dwarfdump.conf', prefix.lib)
|
||||||
make(parallel=False)
|
install('dwarfdump.1', prefix.man.man1)
|
||||||
|
|
||||||
install('dwarfdump', prefix.bin)
|
|
||||||
install('dwarfdump.conf', prefix.lib)
|
|
||||||
install('dwarfdump.1', prefix.man.man1)
|
|
||||||
|
|
||||||
@run_after('install')
|
@run_after('install')
|
||||||
def darwin_fix(self):
|
def darwin_fix(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user