From 420346b275c19806bc83e4f421109ee8edded369 Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Wed, 23 Oct 2019 21:15:30 +0200 Subject: [PATCH] mysql: Use correct python command (#13393) * mysql: Use correct python command python~pythoncmd does not provide a python symlink for python3, so make sure we pick the right command. * mysql: Adapt to build env changes --- .../repos/builtin/packages/mysql/package.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/var/spack/repos/builtin/packages/mysql/package.py b/var/spack/repos/builtin/packages/mysql/package.py index ec5d7d183d..497b8568a8 100644 --- a/var/spack/repos/builtin/packages/mysql/package.py +++ b/var/spack/repos/builtin/packages/mysql/package.py @@ -122,7 +122,7 @@ def cmake_args(self): options.append('-DWITHOUT_SERVER:BOOL=ON') return options - def _fix_dtrace_shebang(self, spack_env): + def _fix_dtrace_shebang(self, build_env): # dtrace may cause build to fail because it uses # '/usr/bin/python' in the shebang. To work around that we copy # the original script into a temporary folder, and change the @@ -135,27 +135,28 @@ def _fix_dtrace_shebang(self, spack_env): copy(dtrace, dtrace_copy) filter_file( '^#!/usr/bin/python', - '#!/usr/bin/env python', + '#!/usr/bin/env {0}'.format( + os.path.basename(self.spec['python'].command)), dtrace_copy ) # To have our own copy of dtrace in PATH, we need to # prepend to PATH the temporary folder where it resides. - spack_env.prepend_path('PATH', dtrace_copy_path) + build_env.prepend_path('PATH', dtrace_copy_path) @run_before('cmake') def _maybe_fix_dtrace_shebang(self): if 'python' in self.spec.flat_dependencies() and \ self.spec.satisfies('@:7.99.99'): - self._fix_dtrace_shebang(spack_env) + self._fix_dtrace_shebang(build_env) - def setup_environment(self, spack_env, run_env): + def setup_build_environment(self, env): cxxstd = self.spec.variants['cxxstd'].value flag = getattr(self.compiler, 'cxx{0}_flag'.format(cxxstd)) if flag: - spack_env.append_flags('CXXFLAGS', flag) + env.append_flags('CXXFLAGS', flag) if cxxstd != '98': if int(cxxstd) > 11: - spack_env.append_flags('CXXFLAGS', - '-Wno-deprecated-declarations') + env.append_flags('CXXFLAGS', + '-Wno-deprecated-declarations') if int(cxxstd) > 14: - spack_env.append_flags('CXXFLAGS', '-Wno-error=register') + env.append_flags('CXXFLAGS', '-Wno-error=register')