patch older config.guess for newer architectures (#2221)
This commit is contained in:
parent
296a349d49
commit
ee6eb508cb
@ -2026,8 +2026,8 @@ The last element of a package is its ``install()`` method. This is
|
|||||||
where the real work of installation happens, and it's the main part of
|
where the real work of installation happens, and it's the main part of
|
||||||
the package you'll need to customize for each piece of software.
|
the package you'll need to customize for each piece of software.
|
||||||
|
|
||||||
.. literalinclude:: ../../../var/spack/repos/builtin/packages/libelf/package.py
|
.. literalinclude:: ../../../var/spack/repos/builtin/packages/libpng/package.py
|
||||||
:pyobject: Libelf.install
|
:pyobject: Libpng.install
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
``install`` takes a ``spec``: a description of how the package should
|
``install`` takes a ``spec``: a description of how the package should
|
||||||
|
@ -24,7 +24,11 @@
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
import inspect
|
import inspect
|
||||||
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
|
import shutil
|
||||||
|
from subprocess import PIPE
|
||||||
|
from subprocess import check_call
|
||||||
|
|
||||||
import llnl.util.tty as tty
|
import llnl.util.tty as tty
|
||||||
from spack.package import PackageBase
|
from spack.package import PackageBase
|
||||||
@ -46,6 +50,79 @@ class AutotoolsPackage(PackageBase):
|
|||||||
# To be used in UI queries that require to know which
|
# To be used in UI queries that require to know which
|
||||||
# build-system class we are using
|
# build-system class we are using
|
||||||
build_system_class = 'AutotoolsPackage'
|
build_system_class = 'AutotoolsPackage'
|
||||||
|
patch_config_guess = True
|
||||||
|
|
||||||
|
def do_patch_config_guess(self):
|
||||||
|
"""Some packages ship with an older config.guess and need to have
|
||||||
|
this updated when installed on a newer architecture."""
|
||||||
|
|
||||||
|
my_config_guess = None
|
||||||
|
config_guess = None
|
||||||
|
if os.path.exists('config.guess'):
|
||||||
|
# First search the top-level source directory
|
||||||
|
my_config_guess = 'config.guess'
|
||||||
|
else:
|
||||||
|
# Then search in all sub directories.
|
||||||
|
# We would like to use AC_CONFIG_AUX_DIR, but not all packages
|
||||||
|
# ship with their configure.in or configure.ac.
|
||||||
|
d = '.'
|
||||||
|
dirs = [os.path.join(d, o) for o in os.listdir(d)
|
||||||
|
if os.path.isdir(os.path.join(d, o))]
|
||||||
|
for dirname in dirs:
|
||||||
|
path = os.path.join(dirname, 'config.guess')
|
||||||
|
if os.path.exists(path):
|
||||||
|
my_config_guess = path
|
||||||
|
|
||||||
|
if my_config_guess is not None:
|
||||||
|
try:
|
||||||
|
check_call([my_config_guess], stdout=PIPE, stderr=PIPE)
|
||||||
|
# The package's config.guess already runs OK, so just use it
|
||||||
|
return True
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
# Look for a spack-installed automake package
|
||||||
|
if 'automake' in self.spec:
|
||||||
|
automake_path = os.path.join(self.spec['automake'].prefix, 'share',
|
||||||
|
'automake-' +
|
||||||
|
str(self.spec['automake'].version))
|
||||||
|
path = os.path.join(automake_path, 'config.guess')
|
||||||
|
if os.path.exists(path):
|
||||||
|
config_guess = path
|
||||||
|
if config_guess is not None:
|
||||||
|
try:
|
||||||
|
check_call([config_guess], stdout=PIPE, stderr=PIPE)
|
||||||
|
shutil.copyfile(config_guess, my_config_guess)
|
||||||
|
return True
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
# Look for the system's config.guess
|
||||||
|
if os.path.exists('/usr/share'):
|
||||||
|
automake_dir = [s for s in os.listdir('/usr/share') if
|
||||||
|
"automake" in s]
|
||||||
|
if automake_dir:
|
||||||
|
automake_path = os.path.join('/usr/share', automake_dir[0])
|
||||||
|
path = os.path.join(automake_path, 'config.guess')
|
||||||
|
if os.path.exists(path):
|
||||||
|
config_guess = path
|
||||||
|
if config_guess is not None:
|
||||||
|
try:
|
||||||
|
check_call([config_guess], stdout=PIPE, stderr=PIPE)
|
||||||
|
shutil.copyfile(config_guess, my_config_guess)
|
||||||
|
return True
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
|
def patch(self):
|
||||||
|
"""Perform any required patches."""
|
||||||
|
|
||||||
|
if self.patch_config_guess and self.spec.satisfies(
|
||||||
|
'arch=linux-redhat7-ppc64le'):
|
||||||
|
if not self.do_patch_config_guess():
|
||||||
|
raise RuntimeError('Failed to find suitable config.guess')
|
||||||
|
|
||||||
def autoreconf(self, spec, prefix):
|
def autoreconf(self, spec, prefix):
|
||||||
"""Not needed usually, configure should be already there"""
|
"""Not needed usually, configure should be already there"""
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
from spack import *
|
from spack import *
|
||||||
|
|
||||||
|
|
||||||
class Cairo(Package):
|
class Cairo(AutotoolsPackage):
|
||||||
"""Cairo is a 2D graphics library with support for multiple output
|
"""Cairo is a 2D graphics library with support for multiple output
|
||||||
devices."""
|
devices."""
|
||||||
homepage = "http://cairographics.org"
|
homepage = "http://cairographics.org"
|
||||||
@ -40,9 +40,7 @@ class Cairo(Package):
|
|||||||
depends_on("pkg-config", type="build")
|
depends_on("pkg-config", type="build")
|
||||||
depends_on("fontconfig@2.10.91:") # Require newer version of fontconfig.
|
depends_on("fontconfig@2.10.91:") # Require newer version of fontconfig.
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def configure_args(self):
|
||||||
configure("--prefix=%s" % prefix,
|
args = ["--disable-trace", # can cause problems with libiberty
|
||||||
"--disable-trace", # can cause problems with libiberty
|
"--enable-tee"]
|
||||||
"--enable-tee")
|
return args
|
||||||
make()
|
|
||||||
make("install")
|
|
||||||
|
@ -33,6 +33,13 @@ class Dyninst(Package):
|
|||||||
url = "https://github.com/dyninst/dyninst/archive/v9.2.0.tar.gz"
|
url = "https://github.com/dyninst/dyninst/archive/v9.2.0.tar.gz"
|
||||||
list_url = "http://www.dyninst.org/downloads/dyninst-8.x"
|
list_url = "http://www.dyninst.org/downloads/dyninst-8.x"
|
||||||
|
|
||||||
|
# version 9.2.1b was the latest git commit when trying to port to a
|
||||||
|
# ppc64le system to get fixes in computeAddrWidth independent of
|
||||||
|
# endianness. This version can be removed if the next release includes
|
||||||
|
# this change. The actual commit was
|
||||||
|
# b8596ad4023ec40ac07e669ff8ea3ec06e262703
|
||||||
|
version('9.2.1b', git='https://github.com/dyninst/dyninst.git',
|
||||||
|
commit='859cb778e20b619443c943c96dd1851da763142b')
|
||||||
version('9.2.0', 'ad023f85e8e57837ed9de073b59d6bab',
|
version('9.2.0', 'ad023f85e8e57837ed9de073b59d6bab',
|
||||||
url="https://github.com/dyninst/dyninst/archive/v9.2.0.tar.gz")
|
url="https://github.com/dyninst/dyninst/archive/v9.2.0.tar.gz")
|
||||||
version('9.1.0', '5c64b77521457199db44bec82e4988ac',
|
version('9.1.0', '5c64b77521457199db44bec82e4988ac',
|
||||||
@ -67,7 +74,7 @@ def install(self, spec, prefix):
|
|||||||
libdwarf = spec['libdwarf'].prefix
|
libdwarf = spec['libdwarf'].prefix
|
||||||
|
|
||||||
with working_dir('spack-build', create=True):
|
with working_dir('spack-build', create=True):
|
||||||
cmake('..',
|
args = ['..',
|
||||||
'-DBoost_INCLUDE_DIR=%s' % spec['boost'].prefix.include,
|
'-DBoost_INCLUDE_DIR=%s' % spec['boost'].prefix.include,
|
||||||
'-DBoost_LIBRARY_DIR=%s' % spec['boost'].prefix.lib,
|
'-DBoost_LIBRARY_DIR=%s' % spec['boost'].prefix.lib,
|
||||||
'-DBoost_NO_SYSTEM_PATHS=TRUE',
|
'-DBoost_NO_SYSTEM_PATHS=TRUE',
|
||||||
@ -77,9 +84,11 @@ def install(self, spec, prefix):
|
|||||||
libelf.lib, 'libelf.so'),
|
libelf.lib, 'libelf.so'),
|
||||||
'-DLIBDWARF_INCLUDE_DIR=%s' % libdwarf.include,
|
'-DLIBDWARF_INCLUDE_DIR=%s' % libdwarf.include,
|
||||||
'-DLIBDWARF_LIBRARIES=%s' % join_path(
|
'-DLIBDWARF_LIBRARIES=%s' % join_path(
|
||||||
libdwarf.lib, 'libdwarf.so'),
|
libdwarf.lib, 'libdwarf.so')]
|
||||||
*std_cmake_args)
|
if spec.satisfies('arch=linux-redhat7-ppc64le'):
|
||||||
|
args.append('-Darch_ppc64_little_endian=1')
|
||||||
|
args += std_cmake_args
|
||||||
|
cmake(*args)
|
||||||
make()
|
make()
|
||||||
make("install")
|
make("install")
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
from spack import *
|
from spack import *
|
||||||
|
|
||||||
|
|
||||||
class Fontconfig(Package):
|
class Fontconfig(AutotoolsPackage):
|
||||||
"""Fontconfig customizing font access"""
|
"""Fontconfig customizing font access"""
|
||||||
homepage = "http://www.freedesktop.org/wiki/Software/fontconfig/"
|
homepage = "http://www.freedesktop.org/wiki/Software/fontconfig/"
|
||||||
url = "http://www.freedesktop.org/software/fontconfig/release/fontconfig-2.11.1.tar.gz"
|
url = "http://www.freedesktop.org/software/fontconfig/release/fontconfig-2.11.1.tar.gz"
|
||||||
@ -36,10 +36,6 @@ class Fontconfig(Package):
|
|||||||
depends_on('libxml2')
|
depends_on('libxml2')
|
||||||
depends_on('pkg-config', type='build')
|
depends_on('pkg-config', type='build')
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def configure_args(self):
|
||||||
configure("--prefix=%s" % prefix,
|
args = ["--enable-libxml2", "--disable-docs"]
|
||||||
"--enable-libxml2",
|
return args
|
||||||
"--disable-docs")
|
|
||||||
|
|
||||||
make()
|
|
||||||
make("install")
|
|
||||||
|
@ -24,9 +24,10 @@
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
from spack import *
|
from spack import *
|
||||||
import sys
|
import sys
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
|
||||||
class Graphviz(Package):
|
class Graphviz(AutotoolsPackage):
|
||||||
"""Graph Visualization Software"""
|
"""Graph Visualization Software"""
|
||||||
homepage = "http://www.graphviz.org"
|
homepage = "http://www.graphviz.org"
|
||||||
url = "http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.38.0.tar.gz"
|
url = "http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.38.0.tar.gz"
|
||||||
@ -46,11 +47,13 @@ class Graphviz(Package):
|
|||||||
depends_on("swig")
|
depends_on("swig")
|
||||||
depends_on("python")
|
depends_on("python")
|
||||||
depends_on("ghostscript")
|
depends_on("ghostscript")
|
||||||
|
depends_on("freetype")
|
||||||
|
depends_on("libtool", type='build')
|
||||||
depends_on("pkg-config", type='build')
|
depends_on("pkg-config", type='build')
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def configure_args(self):
|
||||||
options = ['--prefix=%s' % prefix]
|
options = []
|
||||||
if '+perl' not in spec:
|
if '+perl' not in self.spec:
|
||||||
options.append('--disable-perl')
|
options.append('--disable-perl')
|
||||||
|
|
||||||
# On OSX fix the compiler error:
|
# On OSX fix the compiler error:
|
||||||
@ -59,7 +62,9 @@ def install(self, spec, prefix):
|
|||||||
# include <X11/Xlib.h>
|
# include <X11/Xlib.h>
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
options.append('CFLAGS=-I/opt/X11/include')
|
options.append('CFLAGS=-I/opt/X11/include')
|
||||||
|
options.append('--with-ltdl-lib=%s/lib' % self.spec['libtool'].prefix)
|
||||||
|
|
||||||
configure(*options)
|
# A hack to patch config.guess in the libltdl sub directory
|
||||||
make()
|
shutil.copyfile('./config/config.guess', 'libltdl/config/config.guess')
|
||||||
make("install")
|
|
||||||
|
return options
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
from spack import *
|
from spack import *
|
||||||
|
|
||||||
|
|
||||||
class Libelf(Package):
|
class Libelf(AutotoolsPackage):
|
||||||
"""libelf lets you read, modify or create ELF object files in an
|
"""libelf lets you read, modify or create ELF object files in an
|
||||||
architecture-independent way. The library takes care of size
|
architecture-independent way. The library takes care of size
|
||||||
and endian issues, e.g. you can process a file for SPARC
|
and endian issues, e.g. you can process a file for SPARC
|
||||||
@ -38,13 +38,13 @@ class Libelf(Package):
|
|||||||
version('0.8.12', 'e21f8273d9f5f6d43a59878dc274fec7')
|
version('0.8.12', 'e21f8273d9f5f6d43a59878dc274fec7')
|
||||||
|
|
||||||
provides('elf')
|
provides('elf')
|
||||||
|
depends_on('automake', type='build')
|
||||||
|
|
||||||
|
def configure_args(self):
|
||||||
|
args = ["--enable-shared",
|
||||||
|
"--disable-dependency-tracking",
|
||||||
|
"--disable-debug"]
|
||||||
|
return args
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
configure("--prefix=" + prefix,
|
make('install', parallel=False)
|
||||||
"--enable-shared",
|
|
||||||
"--disable-dependency-tracking",
|
|
||||||
"--disable-debug")
|
|
||||||
make()
|
|
||||||
|
|
||||||
# The mkdir commands in libelf's install can fail in parallel
|
|
||||||
make("install", parallel=False)
|
|
||||||
|
@ -23,9 +23,10 @@
|
|||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
##############################################################################
|
##############################################################################
|
||||||
from spack import *
|
from spack import *
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
|
||||||
class Libiconv(Package):
|
class Libiconv(AutotoolsPackage):
|
||||||
"""GNU libiconv provides an implementation of the iconv() function
|
"""GNU libiconv provides an implementation of the iconv() function
|
||||||
and the iconv program for character set conversion."""
|
and the iconv program for character set conversion."""
|
||||||
|
|
||||||
@ -38,10 +39,10 @@ class Libiconv(Package):
|
|||||||
# of C11 any more and thus might not exist.
|
# of C11 any more and thus might not exist.
|
||||||
patch("gets.patch")
|
patch("gets.patch")
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def configure_args(self):
|
||||||
configure('--prefix={0}'.format(prefix),
|
args = ['--enable-extra-encodings']
|
||||||
'--enable-extra-encodings')
|
|
||||||
|
|
||||||
make()
|
# A hack to patch config.guess in the libcharset sub directory
|
||||||
make('check')
|
shutil.copyfile('./build-aux/config.guess',
|
||||||
make('install')
|
'libcharset/build-aux/config.guess')
|
||||||
|
return args
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
from spack import *
|
from spack import *
|
||||||
|
|
||||||
|
|
||||||
class Libtiff(Package):
|
class Libtiff(AutotoolsPackage):
|
||||||
"""libtiff graphics format library"""
|
"""libtiff graphics format library"""
|
||||||
homepage = "http://www.simplesystems.org/libtiff/"
|
homepage = "http://www.simplesystems.org/libtiff/"
|
||||||
url = "ftp://download.osgeo.org/libtiff/tiff-4.0.3.tar.gz"
|
url = "ftp://download.osgeo.org/libtiff/tiff-4.0.3.tar.gz"
|
||||||
@ -36,9 +36,3 @@ class Libtiff(Package):
|
|||||||
depends_on('jpeg')
|
depends_on('jpeg')
|
||||||
depends_on('zlib')
|
depends_on('zlib')
|
||||||
depends_on('xz')
|
depends_on('xz')
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
|
||||||
configure("--prefix=%s" % prefix)
|
|
||||||
|
|
||||||
make()
|
|
||||||
make("install")
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
from spack import *
|
from spack import *
|
||||||
|
|
||||||
|
|
||||||
class Lzma(Package):
|
class Lzma(AutotoolsPackage):
|
||||||
"""LZMA Utils are legacy data compression software with high compression
|
"""LZMA Utils are legacy data compression software with high compression
|
||||||
ratio. LZMA Utils are no longer developed, although critical bugs may be
|
ratio. LZMA Utils are no longer developed, although critical bugs may be
|
||||||
fixed as long as fixing them doesn't require huge changes to the code.
|
fixed as long as fixing them doesn't require huge changes to the code.
|
||||||
@ -39,11 +39,3 @@ class Lzma(Package):
|
|||||||
url = "http://tukaani.org/lzma/lzma-4.32.7.tar.gz"
|
url = "http://tukaani.org/lzma/lzma-4.32.7.tar.gz"
|
||||||
|
|
||||||
version('4.32.7', '2a748b77a2f8c3cbc322dbd0b4c9d06a')
|
version('4.32.7', '2a748b77a2f8c3cbc322dbd0b4c9d06a')
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
|
||||||
configure('--prefix={0}'.format(prefix))
|
|
||||||
|
|
||||||
make()
|
|
||||||
if self.run_tests:
|
|
||||||
make('check') # one of the tests fails for me
|
|
||||||
make('install')
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
from spack import *
|
from spack import *
|
||||||
|
|
||||||
|
|
||||||
class PyPygobject(Package):
|
class PyPygobject(AutotoolsPackage):
|
||||||
"""bindings for the GLib, and GObject,
|
"""bindings for the GLib, and GObject,
|
||||||
to be used in Python."""
|
to be used in Python."""
|
||||||
|
|
||||||
@ -43,6 +43,4 @@ class PyPygobject(Package):
|
|||||||
patch('pygobject-2.28.6-introspection-1.patch')
|
patch('pygobject-2.28.6-introspection-1.patch')
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
configure("--prefix=%s" % prefix)
|
make('install', parallel=False)
|
||||||
make()
|
|
||||||
make("install", parallel=False)
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
from spack import *
|
from spack import *
|
||||||
|
|
||||||
|
|
||||||
class PyPygtk(Package):
|
class PyPygtk(AutotoolsPackage):
|
||||||
"""bindings for the Gtk in Python"""
|
"""bindings for the Gtk in Python"""
|
||||||
homepage = "http://www.pygtk.org/"
|
homepage = "http://www.pygtk.org/"
|
||||||
url = "http://ftp.gnome.org/pub/GNOME/sources/pygtk/2.24/pygtk-2.24.0.tar.gz"
|
url = "http://ftp.gnome.org/pub/GNOME/sources/pygtk/2.24/pygtk-2.24.0.tar.gz"
|
||||||
@ -41,6 +41,4 @@ class PyPygtk(Package):
|
|||||||
depends_on('py-py2cairo')
|
depends_on('py-py2cairo')
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
configure("--prefix=%s" % prefix)
|
make('install', parallel=False)
|
||||||
make()
|
|
||||||
make("install", parallel=False)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user