macOS: Fix emacs Linking (#16106)

* macOS: Fix emacs Linking

Fix linking issue of emacs on macOS (clang and gcc).

Applies the same work-around as conda-forge:
  b051f6c928/recipe/build.sh

Homebrew avoids this by linking against the system ncurses lib:
  https://github.com/Homebrew/homebrew-core/blob/master/Formula/emacs.rb

* ncurses: fix outdated variant comment

this comment was build on the assumption that gnutls
triggers a termlib dependency in emacs. that's not the
case, ncurses itself depends on termlib when build with
this feature.
This commit is contained in:
Axel Huebl 2020-04-16 17:30:24 -07:00 committed by GitHub
parent ddb6e99a28
commit 4d25632e59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -47,6 +47,13 @@ class Emacs(AutotoolsPackage, GNUMirrorPackage):
depends_on('gnutls', when='+tls')
depends_on('jpeg')
@when('platform=darwin')
def setup_build_environment(self, env):
# on macOS, emacs' config does search hard enough for ncurses'
# termlib `-ltinfo` lib, which results in linker errors
if '+termlib' in spec['ncurses']:
env.append_flags('LDFLAGS', '-ltinfo')
def configure_args(self):
spec = self.spec

View File

@ -28,7 +28,8 @@ class Ncurses(AutotoolsPackage, GNUMirrorPackage):
variant('symlinks', default=False,
description='Enables symlinks. Needed on AFS filesystem.')
variant('termlib', default=True,
description='Enables termlib needs for gnutls in emacs.')
description='Enables termlib features. This is an extra '
'lib and optional internal dependency.')
depends_on('pkgconfig', type='build')