diff options
-rw-r--r-- | var/spack/repos/builtin/packages/flex/package.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/flex/package.py b/var/spack/repos/builtin/packages/flex/package.py index 8f0c46bc56..73d08d98e0 100644 --- a/var/spack/repos/builtin/packages/flex/package.py +++ b/var/spack/repos/builtin/packages/flex/package.py @@ -23,6 +23,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## from spack import * +import os class Flex(AutotoolsPackage): @@ -39,6 +40,9 @@ class Flex(AutotoolsPackage): version('2.6.0', '760be2ee9433e822b6eb65318311c19d') version('2.5.39', '5865e76ac69c05699f476515592750d7') + variant('lex', default=True, + description="Provide symlinks for lex and libl") + depends_on('bison', type='build') depends_on('gettext@0.19:', type='build') depends_on('help2man', type='build') @@ -61,3 +65,16 @@ class Flex(AutotoolsPackage): url += "/archive/flex-{0}.tar.gz".format(version.dashed) return url + + @run_after('install') + def symlink_lex(self): + if self.spec.satisfies('+lex'): + dso = dso_suffix + for dir, flex, lex in \ + ((self.prefix.bin, 'flex', 'lex'), + (self.prefix.lib, 'libfl.a', 'libl.a'), + (self.prefix.lib, 'libfl.' + dso, 'libl.' + dso)): + with working_dir(dir): + if (os.path.isfile(flex) and not + os.path.lexists(lex)): + symlink(flex, lex) |