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

@ -27,6 +27,7 @@
class Autoconf(AutotoolsPackage): class Autoconf(AutotoolsPackage):
"""Autoconf -- system configuration part of autotools""" """Autoconf -- system configuration part of autotools"""
homepage = 'https://www.gnu.org/software/autoconf/' homepage = 'https://www.gnu.org/software/autoconf/'
url = 'http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz' url = 'http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz'
@ -35,7 +36,7 @@ class Autoconf(AutotoolsPackage):
version('2.59', 'd4d45eaa1769d45e59dcb131a4af17a0') version('2.59', 'd4d45eaa1769d45e59dcb131a4af17a0')
version('2.13', '9de56d4a161a723228220b0f425dc711') version('2.13', '9de56d4a161a723228220b0f425dc711')
depends_on('m4', type='build') depends_on('m4@1.4.6:', type='build')
def _make_executable(self, name): def _make_executable(self, name):
return Executable(join_path(self.prefix.bin, name)) return Executable(join_path(self.prefix.bin, name))

View file

@ -25,10 +25,9 @@
from spack import * from spack import *
class Automake(Package): class Automake(AutotoolsPackage):
""" """Automake -- make file builder part of autotools"""
Automake -- make file builder part of autotools
"""
homepage = 'http://www.gnu.org/software/automake/' homepage = 'http://www.gnu.org/software/automake/'
url = 'http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz' url = 'http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz'
@ -36,7 +35,7 @@ class Automake(Package):
version('1.14.1', 'd052a3e884631b9c7892f2efce542d75') version('1.14.1', 'd052a3e884631b9c7892f2efce542d75')
version('1.11.6', '0286dc30295b62985ca51919202ecfcc') version('1.11.6', '0286dc30295b62985ca51919202ecfcc')
depends_on('autoconf') depends_on('autoconf', type='build')
def _make_executable(self, name): def _make_executable(self, name):
return Executable(join_path(self.prefix.bin, name)) return Executable(join_path(self.prefix.bin, name))
@ -47,8 +46,3 @@ def setup_dependent_package(self, module, dependent_spec):
executables = ['aclocal', 'automake'] executables = ['aclocal', 'automake']
for name in executables: for name in executables:
setattr(module, name, self._make_executable(name)) setattr(module, name, self._make_executable(name))
def install(self, spec, prefix):
configure("--prefix=%s" % prefix)
make()
make("install")

View file

@ -29,25 +29,40 @@ class Flex(AutotoolsPackage):
"""Flex is a tool for generating scanners.""" """Flex is a tool for generating scanners."""
homepage = "https://github.com/westes/flex" 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.2', 'cc6d76c333db7653d5caf423a3335239')
version('2.6.1', 'c4f31e0e4bd1711b7c91f16ef526ad90') version('2.6.1', '05bcd8fb629e0ae130311e8a6106fa82')
version('2.6.0', '760be2ee9433e822b6eb65318311c19d') version('2.6.0', '760be2ee9433e822b6eb65318311c19d')
version('2.5.39', '5865e76ac69c05699f476515592750d7') version('2.5.39', '5865e76ac69c05699f476515592750d7')
depends_on("bison", type='build') depends_on('bison', type='build')
depends_on("m4", type='build') depends_on('gettext@0.19:', type='build')
depends_on('autoconf', type='build') depends_on('help2man', type='build')
depends_on('libtool', 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): def url_for_version(self, version):
base_url = "https://github.com/westes/flex/archive" url = "https://github.com/westes/flex"
if version >= Version("2.6.0"): if version >= Version('2.6.1'):
return "{0}/v{1}.tar.gz".format(base_url, version) 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: 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): def autoreconf(self, spec, prefix):
autogen = Executable('./autogen.sh') pass
autogen()
@when('@:2.6.0')
def autoreconf(self, spec, prefix):
libtoolize('--install', '--force')
autoreconf('--install', '--force')

View file

@ -0,0 +1,37 @@
##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/llnl/spack
# Please also see the LICENSE file for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (as
# published by the Free Software Foundation) version 2.1, February 1999.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
# conditions of the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
class Help2man(AutotoolsPackage):
"""help2man produces simple manual pages from the '--help' and '--version'
output of other commands."""
homepage = "https://www.gnu.org/software/help2man/"
url = "http://gnu.askapache.com/help2man/help2man-1.47.4.tar.xz"
version('1.47.4', '544aca496a7d89de3e5d99e56a2f03d3')
depends_on('gettext', type='build')

View file

@ -25,8 +25,9 @@
from spack import * from spack import *
class Libsigsegv(Package): class Libsigsegv(AutotoolsPackage):
"""GNU libsigsegv is a library for handling page faults in user mode.""" """GNU libsigsegv is a library for handling page faults in user mode."""
homepage = "https://www.gnu.org/software/libsigsegv/" homepage = "https://www.gnu.org/software/libsigsegv/"
url = "ftp://ftp.gnu.org/gnu/libsigsegv/libsigsegv-2.10.tar.gz" url = "ftp://ftp.gnu.org/gnu/libsigsegv/libsigsegv-2.10.tar.gz"
@ -34,9 +35,5 @@ class Libsigsegv(Package):
version('2.10', '7f96fb1f65b3b8cbc1582fb7be774f0f') version('2.10', '7f96fb1f65b3b8cbc1582fb7be774f0f')
def install(self, spec, prefix): def configure_args(self):
configure('--prefix=%s' % prefix, return ['--enable-shared']
'--enable-shared')
make()
make("install")

View file

@ -25,17 +25,16 @@
from spack import * from spack import *
class Libtool(Package): class Libtool(AutotoolsPackage):
""" """libtool -- library building part of autotools."""
libtool -- library building part of autotools
"""
homepage = 'https://www.gnu.org/software/libtool/' homepage = 'https://www.gnu.org/software/libtool/'
url = 'http://ftpmirror.gnu.org/libtool/libtool-2.4.2.tar.gz' url = 'http://ftpmirror.gnu.org/libtool/libtool-2.4.2.tar.gz'
version('2.4.6', 'addf44b646ddb4e3919805aa88fa7c5e') version('2.4.6', 'addf44b646ddb4e3919805aa88fa7c5e')
version('2.4.2', 'd2f3b7d4627e69e13514a40e72a24d50') version('2.4.2', 'd2f3b7d4627e69e13514a40e72a24d50')
depends_on('m4', type='build') depends_on('m4@1.4.6:', type='build')
def _make_executable(self, name): def _make_executable(self, name):
return Executable(join_path(self.prefix.bin, name)) return Executable(join_path(self.prefix.bin, name))
@ -46,8 +45,3 @@ def setup_dependent_package(self, module, dependent_spec):
executables = ['libtoolize', 'libtool'] executables = ['libtoolize', 'libtool']
for name in executables: for name in executables:
setattr(module, name, self._make_executable(name)) setattr(module, name, self._make_executable(name))
def install(self, spec, prefix):
configure("--prefix=%s" % prefix)
make()
make("install")

View file

@ -26,8 +26,9 @@
import sys import sys
class M4(Package): class M4(AutotoolsPackage):
"""GNU M4 is an implementation of the traditional Unix macro processor.""" """GNU M4 is an implementation of the traditional Unix macro processor."""
homepage = "https://www.gnu.org/software/m4/m4.html" homepage = "https://www.gnu.org/software/m4/m4.html"
url = "ftp://ftp.gnu.org/gnu/m4/m4-1.4.17.tar.gz" url = "ftp://ftp.gnu.org/gnu/m4/m4-1.4.17.tar.gz"
@ -40,19 +41,19 @@ class M4(Package):
depends_on('libsigsegv', when='+sigsegv') depends_on('libsigsegv', when='+sigsegv')
def install(self, spec, prefix): def configure_args(self):
configure_args = [] spec = self.spec
if 'libsigsegv' in spec: args = ['--enable-c++']
configure_args.append('--with-libsigsegv-prefix=%s' %
spec['libsigsegv'].prefix) if '+sigsegv' in spec:
args.append('--with-libsigsegv-prefix={0}'.format(
spec['libsigsegv'].prefix))
else: else:
configure_args.append('--without-libsigsegv-prefix') args.append('--without-libsigsegv-prefix')
# http://lists.gnu.org/archive/html/bug-m4/2016-09/msg00002.html # http://lists.gnu.org/archive/html/bug-m4/2016-09/msg00002.html
if (sys.platform == "darwin") and (spec.satisfies('%gcc')) and \ if (sys.platform == 'darwin') and (spec.satisfies('%gcc')) and \
(spec.architecture.platform_os.version == "10.12"): (spec.architecture.platform_os.version == '10.12'):
configure_args.append('ac_cv_type_struct_sched_param=yes') args.append('ac_cv_type_struct_sched_param=yes')
configure("--prefix=%s" % prefix, *configure_args) return args
make()
make("install")