diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py index 836c018604..e42d977698 100644 --- a/var/spack/repos/builtin/packages/gcc/package.py +++ b/var/spack/repos/builtin/packages/gcc/package.py @@ -100,7 +100,7 @@ class Gcc(AutotoolsPackage): depends_on('isl@0.15:0.18', when='@6:8.9') depends_on('isl@0.15:0.20', when='@9:') depends_on('zlib', when='@6:') - depends_on('libiconv') + depends_on('libiconv', when='platform=darwin') depends_on('gnat', when='languages=ada') depends_on('binutils~libiberty', when='+binutils') depends_on('zip', type='build', when='languages=java') @@ -279,7 +279,6 @@ def configure_args(self): ','.join(spec.variants['languages'].value)), # Drop gettext dependency '--disable-nls', - '--with-libiconv-prefix={0}'.format(spec['libiconv'].prefix), '--with-mpfr={0}'.format(spec['mpfr'].prefix), '--with-gmp={0}'.format(spec['gmp'].prefix), ] @@ -328,7 +327,8 @@ def configure_args(self): if sys.platform == 'darwin': options.extend([ '--with-native-system-header-dir=/usr/include', - '--with-sysroot={0}'.format(macos_sdk_path()) + '--with-sysroot={0}'.format(macos_sdk_path()), + '--with-libiconv-prefix={0}'.format(spec['libiconv'].prefix) ]) return options @@ -424,7 +424,7 @@ def write_rpath_specs(self): self.prefix.lib, self.prefix.lib64)) set_install_permissions(specs_file) - def setup_environment(self, spack_env, run_env): + def setup_run_environment(self, env): # Search prefix directory for possibly modified compiler names from spack.compilers.gcc import Gcc as Compiler @@ -450,6 +450,6 @@ def setup_environment(self, spack_env, run_env): continue # Set the proper environment variable - run_env.set(lang.upper(), abspath) + env.set(lang.upper(), abspath) # Stop searching filename/regex combos for this language break