summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilton Woods <miltonjwoods@gmail.com>2017-05-21 23:33:34 +1000
committerAdam J. Stewart <ajstewart426@gmail.com>2017-05-21 08:33:34 -0500
commitca2755d53268756f8c1c004f4f9e96f78765d8a8 (patch)
tree2b24b76c46cf5dd112dde2923dc3fd5ab941c833
parente4a3295c37f3bc68a659f7400ef3315d75b6e2ca (diff)
downloadspack-ca2755d53268756f8c1c004f4f9e96f78765d8a8.tar.gz
spack-ca2755d53268756f8c1c004f4f9e96f78765d8a8.tar.bz2
spack-ca2755d53268756f8c1c004f4f9e96f78765d8a8.tar.xz
spack-ca2755d53268756f8c1c004f4f9e96f78765d8a8.zip
flex: create variant +lex that creates symlinks for lex and libl.{a,so} (#3894)
* flex: create variant +lex that creates symlinks for lex and libl.{a,so} * flex: enable variant +lex by default * flex: use dso_suffix for portability; replace repetitive code with a loop
-rw-r--r--var/spack/repos/builtin/packages/flex/package.py17
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)