summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2021-07-27 07:50:59 -0500
committerGitHub <noreply@github.com>2021-07-27 14:50:59 +0200
commitde3fa5556a7bb0973a324a83622a39e285533341 (patch)
treed63334f001c62edbb36c4fdf7264c61b9043a2fd
parent06a292290e7a65cbcfe91928d2a9f95c433ca3e5 (diff)
downloadspack-de3fa5556a7bb0973a324a83622a39e285533341.tar.gz
spack-de3fa5556a7bb0973a324a83622a39e285533341.tar.bz2
spack-de3fa5556a7bb0973a324a83622a39e285533341.tar.xz
spack-de3fa5556a7bb0973a324a83622a39e285533341.zip
serf: add missing libuuid dependency (#25098)
-rw-r--r--var/spack/repos/builtin/packages/apr-util/package.py8
-rw-r--r--var/spack/repos/builtin/packages/apr/package.py8
-rw-r--r--var/spack/repos/builtin/packages/serf/package.py53
3 files changed, 42 insertions, 27 deletions
diff --git a/var/spack/repos/builtin/packages/apr-util/package.py b/var/spack/repos/builtin/packages/apr-util/package.py
index 061beaefd8..a08f110a7c 100644
--- a/var/spack/repos/builtin/packages/apr-util/package.py
+++ b/var/spack/repos/builtin/packages/apr-util/package.py
@@ -32,6 +32,14 @@ class AprUtil(AutotoolsPackage):
depends_on('sqlite', when='+sqlite')
depends_on('unixodbc', when='+odbc')
+ @property
+ def libs(self):
+ return find_libraries(
+ ['libaprutil-{0}'.format(self.version.up_to(1))],
+ root=self.prefix,
+ recursive=True,
+ )
+
def configure_args(self):
spec = self.spec
diff --git a/var/spack/repos/builtin/packages/apr/package.py b/var/spack/repos/builtin/packages/apr/package.py
index f2d90352ab..cf2417d51e 100644
--- a/var/spack/repos/builtin/packages/apr/package.py
+++ b/var/spack/repos/builtin/packages/apr/package.py
@@ -19,3 +19,11 @@ class Apr(AutotoolsPackage):
patch('missing_includes.patch', when='@1.7.0')
depends_on('uuid', type='link')
+
+ @property
+ def libs(self):
+ return find_libraries(
+ ['libapr-{0}'.format(self.version.up_to(1))],
+ root=self.prefix,
+ recursive=True,
+ )
diff --git a/var/spack/repos/builtin/packages/serf/package.py b/var/spack/repos/builtin/packages/serf/package.py
index fa272fd1a5..8d15cbdb01 100644
--- a/var/spack/repos/builtin/packages/serf/package.py
+++ b/var/spack/repos/builtin/packages/serf/package.py
@@ -25,43 +25,42 @@ class Serf(SConsPackage):
depends_on('apr-util')
depends_on('openssl')
depends_on('zlib')
+ depends_on('uuid')
patch('py3syntax.patch')
def build_args(self, spec, prefix):
- args = [
- 'PREFIX={0}'.format(prefix),
- 'APR={0}'.format(spec['apr'].prefix),
- 'APU={0}'.format(spec['apr-util'].prefix),
- 'OPENSSL={0}'.format(spec['openssl'].prefix),
- 'ZLIB={0}'.format(spec['zlib'].prefix),
- ]
-
- # ZLIB variable is ignored on non-Windows platforms before and
- # including the version 1.3.9:
- # https://www.mail-archive.com/dev@serf.apache.org/msg01359.html
- # The issue is fixed in the trunk. Hopefully, the next stable version
- # will work properly.
- if '@:1.3.9' in self.spec:
- zlib_spec = self.spec['zlib']
- link_flags = [zlib_spec.libs.search_flags]
- link_flags.extend([self.compiler.cc_rpath_arg + d
- for d in zlib_spec.libs.directories])
- args.append('LINKFLAGS=' + ' '.join(link_flags))
- args.append('CPPFLAGS=' + zlib_spec.headers.cpp_flags)
-
- if '+debug' in spec:
- args.append('DEBUG=yes')
- else:
- args.append('DEBUG=no')
+ args = {
+ 'PREFIX': prefix,
+ 'APR': spec['apr'].prefix,
+ 'APU': spec['apr-util'].prefix,
+ 'OPENSSL': spec['openssl'].prefix,
+ 'ZLIB': spec['zlib'].prefix,
+ 'DEBUG': 'yes' if '+debug' in spec else 'no',
+ }
# SCons doesn't pass Spack environment variables to the
# execution environment. Therefore, we can't use Spack's compiler
# wrappers. Use the actual compilers. SCons seems to RPATH things
# on its own anyway.
- args.append('CC={0}'.format(self.compiler.cc))
+ args['CC'] = self.compiler.cc
+
+ # Old versions of serf ignore the ZLIB variable on non-Windows platforms.
+ # Also, there is no UUID variable to specify its installation location.
+ # Pass explicit link flags for both.
+ library_dirs = []
+ include_dirs = []
+ for dep in spec.dependencies(deptype='link'):
+ query = self.spec[dep.name]
+ library_dirs.extend(query.libs.directories)
+ include_dirs.extend(query.headers.directories)
+
+ rpath = self.compiler.cc_rpath_arg
+ args['LINKFLAGS'] = '-L' + ' -L'.join(library_dirs)
+ args['LINKFLAGS'] += ' ' + rpath + (' ' + rpath).join(library_dirs)
+ args['CPPFLAGS'] = '-I' + ' -I'.join(include_dirs)
- return args
+ return [key + '=' + value for key, value in args.items()]
def build_test(self):
# FIXME: Several test failures: