From 8c8fc749be47aeb1aee74f74b7129f233afdbe51 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Thu, 30 Oct 2014 15:02:06 -0700 Subject: Initial versions of python and libffi. --- var/spack/packages/libffi/package.py | 16 ++++++++++++++++ var/spack/packages/python/package.py | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 var/spack/packages/libffi/package.py create mode 100644 var/spack/packages/python/package.py (limited to 'var') diff --git a/var/spack/packages/libffi/package.py b/var/spack/packages/libffi/package.py new file mode 100644 index 0000000000..2c1c4eed4d --- /dev/null +++ b/var/spack/packages/libffi/package.py @@ -0,0 +1,16 @@ +from spack import * + +class Libffi(Package): + """The libffi library provides a portable, high level programming + interface to various calling conventions. This allows a programmer + to call any function specified by a call interface description at + run time.""" + homepage = "https://sourceware.org/libffi/" + url = "ftp://sourceware.org/pub/libffi/libffi-3.1.tar.gz" + + version('3.1', 'f5898b29bbfd70502831a212d9249d10') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") diff --git a/var/spack/packages/python/package.py b/var/spack/packages/python/package.py new file mode 100644 index 0000000000..db2d954445 --- /dev/null +++ b/var/spack/packages/python/package.py @@ -0,0 +1,16 @@ +from spack import * + +class Python(Package): + """The Python programming language.""" + homepage = "http://www.python.org" + url = "http://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.xz" + + version('2.7.8', 'd235bdfa75b8396942e360a70487ee00') + + depends_on("openssl") + depends_on("sqlite") + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") -- cgit v1.2.3-70-g09d2 From 1656f62a125232b30235da01e816a3ade4481b8a Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sat, 1 Nov 2014 16:56:19 -0700 Subject: Add bzip2 package and spack pkg add command. --- lib/spack/spack/cmd/pkg.py | 17 ++++++++++++++++- var/spack/packages/bzip2/package.py | 19 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 var/spack/packages/bzip2/package.py (limited to 'var') diff --git a/lib/spack/spack/cmd/pkg.py b/lib/spack/spack/cmd/pkg.py index 82ebd13ff9..da905603fa 100644 --- a/lib/spack/spack/cmd/pkg.py +++ b/lib/spack/spack/cmd/pkg.py @@ -37,6 +37,10 @@ def setup_parser(subparser): sp = subparser.add_subparsers( metavar='SUBCOMMAND', dest='pkg_command') + add_parser = sp.add_parser('add', help=pkg_add.__doc__) + add_parser.add_argument('packages', nargs=argparse.REMAINDER, + help="Names of packages to add to git repo.") + list_parser = sp.add_parser('list', help=pkg_list.__doc__) list_parser.add_argument('rev', default='HEAD', nargs='?', help="Revision to list packages for.") @@ -79,6 +83,16 @@ def list_packages(rev): return sorted(line[len(relpath):] for line in output.split('\n') if line) +def pkg_add(args): + for pkg_name in args.packages: + filename = spack.db.filename_for_package_name(pkg_name) + if not os.path.isfile(filename): + tty.die("No such package: %s. Path does not exist:" % pkg_name, filename) + + git = get_git() + git('-C', spack.packages_path, 'add', filename) + + def pkg_list(args): """List packages associated with a particular spack git revision.""" colify(list_packages(args.rev)) @@ -117,7 +131,8 @@ def pkg_added(args): def pkg(parser, args): - action = { 'diff' : pkg_diff, + action = { 'add' : pkg_add, + 'diff' : pkg_diff, 'list' : pkg_list, 'removed' : pkg_removed, 'added' : pkg_added } diff --git a/var/spack/packages/bzip2/package.py b/var/spack/packages/bzip2/package.py new file mode 100644 index 0000000000..83ae88e564 --- /dev/null +++ b/var/spack/packages/bzip2/package.py @@ -0,0 +1,19 @@ +from spack import * + +class Bzip2(Package): + """bzip2 is a freely available, patent free high-quality data + compressor. It typically compresses files to within 10% to 15% + of the best available techniques (the PPM family of statistical + compressors), whilst being around twice as fast at compression + and six times faster at decompression.""" + homepage = "http://www.bzip.org" + url = "http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz" + + version('1.0.6', '00b516f4704d4a7cb50a1d97e6e8e15b') + + def install(self, spec, prefix): + # No configure system -- have to filter the makefile for this package. + filter_file(r'CC=gcc', 'CC=cc', 'Makefile', string=True) + + make() + make("install", "PREFIX=%s" % prefix) -- cgit v1.2.3-70-g09d2 From 6c8c41da98a01d595b8ef77175e2c717accf02d7 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 3 Nov 2014 00:15:05 -0800 Subject: Working Python 2.7.8, ncurses, readline --- var/spack/packages/ncurses/package.py | 8 ++++++-- var/spack/packages/python/package.py | 11 ++++++++++- var/spack/packages/readline/package.py | 21 +++++++++++++++++++++ 3 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 var/spack/packages/readline/package.py (limited to 'var') diff --git a/var/spack/packages/ncurses/package.py b/var/spack/packages/ncurses/package.py index 4885caa628..2556e600f6 100644 --- a/var/spack/packages/ncurses/package.py +++ b/var/spack/packages/ncurses/package.py @@ -10,10 +10,14 @@ class Ncurses(Package): homepage = "http://invisible-island.net/ncurses/ncurses.html" version('5.9', '8cb9c412e5f2d96bc6f459aa8c6282a1', - url='http://invisible-island.net/datafiles/release/ncurses.tar.gz') + url='http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz') def install(self, spec, prefix): - configure("--prefix=%s" % prefix) + configure("--prefix=%s" % prefix, + "--with-shared", + "--enable-widec", + "--enable-pc-files", + "--without-ada") make() make("install") diff --git a/var/spack/packages/python/package.py b/var/spack/packages/python/package.py index db2d954445..e6c3e28820 100644 --- a/var/spack/packages/python/package.py +++ b/var/spack/packages/python/package.py @@ -8,9 +8,18 @@ class Python(Package): version('2.7.8', 'd235bdfa75b8396942e360a70487ee00') depends_on("openssl") + depends_on("bzip2") + depends_on("readline") + depends_on("ncurses") depends_on("sqlite") def install(self, spec, prefix): - configure("--prefix=%s" % prefix) + # Need this to allow python build to find the Python installation. + env['PYTHONHOME'] = prefix + + # Rest of install is pretty standard. + configure("--prefix=%s" % prefix, + "--with-threads", + "--enable-shared") make() make("install") diff --git a/var/spack/packages/readline/package.py b/var/spack/packages/readline/package.py new file mode 100644 index 0000000000..1b870e0e7f --- /dev/null +++ b/var/spack/packages/readline/package.py @@ -0,0 +1,21 @@ +from spack import * + +class Readline(Package): + """The GNU Readline library provides a set of functions for use by + applications that allow users to edit command li nes as they + are typed in. Both Emacs and vi editing modes are + available. The Readline library includes additional functions + to maintain a list of previously-entered command lines, to + recall and perhaps reedit those lines, and perform csh-like + history expansion on previous commands. """ + homepage = "http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html" + url = "ftp://ftp.cwru.edu/pub/bash/readline-6.3.tar.gz" + + version('6.3', '33c8fb279e981274f485fd91da77e94a') + + depends_on("ncurses") + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make("SHLIB_LIBS=-lncurses") + make("install") -- cgit v1.2.3-70-g09d2