Fix building latest version of flex (#2401)

* Fix building latest version of flex

* Don't need when clause

* Remove perl deps, shebang too long
This commit is contained in:
Adam J. Stewart
2016-11-28 11:48:34 -06:00
committed by Todd Gamblin
parent a2e6de9b5d
commit 664939eeba
7 changed files with 96 additions and 57 deletions

View File

@@ -29,25 +29,40 @@ class Flex(AutotoolsPackage):
"""Flex is a tool for generating scanners."""
homepage = "https://github.com/westes/flex"
url = "https://github.com/westes/flex/archive/v2.6.2.tar.gz"
url = "https://github.com/westes/flex/releases/download/v2.6.2/flex-2.6.2.tar.gz"
version('2.6.2', 'acde3a89ef2b376aac94586fd5fda460')
version('2.6.1', 'c4f31e0e4bd1711b7c91f16ef526ad90')
version('2.6.2', 'cc6d76c333db7653d5caf423a3335239')
version('2.6.1', '05bcd8fb629e0ae130311e8a6106fa82')
version('2.6.0', '760be2ee9433e822b6eb65318311c19d')
version('2.5.39', '5865e76ac69c05699f476515592750d7')
depends_on("bison", type='build')
depends_on("m4", type='build')
depends_on('autoconf', type='build')
depends_on('libtool', type='build')
depends_on('bison', type='build')
depends_on('gettext@0.19:', type='build')
depends_on('help2man', type='build')
# Older tarballs don't come with a configure script
depends_on('m4', type='build', when='@:2.6.0')
depends_on('autoconf', type='build', when='@:2.6.0')
depends_on('automake', type='build', when='@:2.6.0')
depends_on('libtool', type='build', when='@:2.6.0')
def url_for_version(self, version):
base_url = "https://github.com/westes/flex/archive"
if version >= Version("2.6.0"):
return "{0}/v{1}.tar.gz".format(base_url, version)
url = "https://github.com/westes/flex"
if version >= Version('2.6.1'):
url += "/releases/download/v{0}/flex-{0}.tar.gz".format(version)
elif version == Version('2.6.0'):
url += "/archive/v{0}.tar.gz".format(version)
elif version >= Version('2.5.37'):
url += "/archive/flex-{0}.tar.gz".format(version)
else:
return "{0}/flex-{1}.tar.gz".format(base_url, version)
url += "/archive/flex-{0}.tar.gz".format(version.dashed)
return url
def autoreconf(self, spec, prefix):
autogen = Executable('./autogen.sh')
autogen()
pass
@when('@:2.6.0')
def autoreconf(self, spec, prefix):
libtoolize('--install', '--force')
autoreconf('--install', '--force')