From bc2c4a14c24370465d3d9cb949fdbdd6baa0eb69 Mon Sep 17 00:00:00 2001 From: Josh Asplund Date: Wed, 14 Jun 2017 10:43:50 -0700 Subject: Updates rose definition (#4411) * Adds z3 package * Adds binwalk package * Updates spot package definition * Updates rose package definition * Modifications for code review * Fixes string formatting * Remove python version requirement --- .../repos/builtin/packages/py-binwalk/package.py | 39 ++++++++++++++ var/spack/repos/builtin/packages/rose/package.py | 62 +++++++++++++++++----- var/spack/repos/builtin/packages/spot/package.py | 11 ++-- var/spack/repos/builtin/packages/z3/package.py | 55 +++++++++++++++++++ 4 files changed, 151 insertions(+), 16 deletions(-) create mode 100644 var/spack/repos/builtin/packages/py-binwalk/package.py create mode 100644 var/spack/repos/builtin/packages/z3/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/py-binwalk/package.py b/var/spack/repos/builtin/packages/py-binwalk/package.py new file mode 100644 index 0000000000..b900274967 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-binwalk/package.py @@ -0,0 +1,39 @@ +############################################################################## +# 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 PyBinwalk(PythonPackage): + """Binwalk is a fast, easy to use tool for analyzing, reverse engineering, + and extracting firmware images.""" + + homepage = "https://github.com/devttys0/binwalk" + url = "https://pypi.io/packages/source/b/binwalk/binwalk-2.1.0.tar.gz" + + version('2.1.0', '054867d9abe6a05f43200cf2591051e6') + + depends_on('python') + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/rose/package.py b/var/spack/repos/builtin/packages/rose/package.py index 5f0d12427c..ed8cca40ad 100644 --- a/var/spack/repos/builtin/packages/rose/package.py +++ b/var/spack/repos/builtin/packages/rose/package.py @@ -35,7 +35,7 @@ class Rose(Package): (Developed at Lawrence Livermore National Lab)""" homepage = "http://rosecompiler.org/" - url = "https://github.com/rose-compiler/rose/archive/v0.9.7.tar.gz" + url = "https://github.com/rose-compiler/rose/archive/v0.9.7.tar.gz" version('0.9.7', 'e14ce5250078df4b09f4f40559d46c75') version('master', branch='master', @@ -46,20 +46,56 @@ class Rose(Package): depends_on("autoconf@2.69", type='build') depends_on("automake@1.14", type='build') depends_on("libtool@2.4", type='build') - depends_on("boost@1.54.0") - depends_on("jdk@8u25") + depends_on("boost@1.47.0:") - def install(self, spec, prefix): - # Bootstrap with autotools + variant('tests', default=False, description='Build the tests directory') + + variant('binanalysis', default=False, description='Enable binary analysis tooling') + depends_on('libgcrypt', when='+binanalysis', type='build') + depends_on('py-binwalk', when='+binanalysis', type='run') + + variant('c', default=True, description='Enable c language support') + variant('cxx', default=True, description='Enable c++ language support') + + variant('fortran', default=False, description='Enable fortran language support') + + variant('java', default=False, description='Enable java language support') + depends_on('jdk', when='+java') + + variant('z3', default=False, description='Enable z3 theorem prover') + depends_on('z3', when='+z3') + + build_directory = 'spack-build' + + def autoreconf(self, spec, prefix): bash = which('bash') bash('build') - # Configure, compile & install - with working_dir('rose-build', create=True): - boost = spec['boost'] + @property + def languages(self): + spec = self.spec + langs = [ + 'binaries' if '+binanalysis' in spec else '', + 'c' if '+c' in spec else '', + 'c++' if '+cxx' in spec else '', + 'java' if '+java' in spec else '', + 'fortran' if '+fortran' in spec else '' + ] + return list(filter(None, langs)) + + def configure_args(self): + spec = self.spec + cc = self.compiler.cc + cxx = self.compiler.cxx + return [ + '--disable-boost-version-check', + "--with-alternate_backend_C_compiler={0}".format(cc), + "--with-alternate_backend_Cxx_compiler={0}".format(cxx), + "--with-boost={0}".format(spec['boost'].prefix), + "--enable-languages={0}".format(",".join(self.languages)), + "--with-z3={0}".format(spec['z3'].prefix) if '+z3' in spec else '', + '--disable-tests-directory' if '+tests' not in spec else '', + '--enable-tutorial-directory={0}'.format('no'), + ] - configure = Executable('../configure') - configure("--prefix=" + prefix, - "--with-boost=" + boost.prefix, - "--disable-boost-version-check") - make("install-core") + install_targets = ["install-core"] diff --git a/var/spack/repos/builtin/packages/spot/package.py b/var/spack/repos/builtin/packages/spot/package.py index abb1776aaf..24787e3adc 100644 --- a/var/spack/repos/builtin/packages/spot/package.py +++ b/var/spack/repos/builtin/packages/spot/package.py @@ -28,10 +28,15 @@ from spack import * class Spot(AutotoolsPackage): """Spot is a C++11 library for omega-automata manipulation and model checking.""" - homepage = "https://spot.lrde.epita.fr/index.html" + homepage = "https://spot.lrde.epita.fr/" url = "http://www.lrde.epita.fr/dload/spot/spot-1.99.3.tar.gz" version('1.99.3', 'd53adcb2d0fe7c69f45d4e595a58254e') + version('1.2.6', '799bf59ccdee646d12e00f0fe6c23902') - # depends_on("gcc@4.8:", type='build') - depends_on("python@3.2:") + variant('python', default=True, description='Enable python API') + + depends_on("python@3.3:", when='@1.99.5: +python') + depends_on("python@3.2:", when='@1.99: +python') + depends_on("python@2:", when='+python') + depends_on('boost', when='@:1.2.6') diff --git a/var/spack/repos/builtin/packages/z3/package.py b/var/spack/repos/builtin/packages/z3/package.py new file mode 100644 index 0000000000..d2f8fb9d7a --- /dev/null +++ b/var/spack/repos/builtin/packages/z3/package.py @@ -0,0 +1,55 @@ +############################################################################## +# 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 Z3(MakefilePackage): + """Z3 is a theorem prover from Microsoft Research. + It is licensed under the MIT license.""" + + homepage = "https://github.com/Z3Prover/z3/wiki" + url = "https://github.com/Z3Prover/z3/archive/z3-4.5.0.tar.gz" + + version('4.5.0', 'f332befa0d66d81818a06279a0973e25') + version('4.4.1', '4336a9df24f090e711c6d42fd4e2b1fc') + version('4.4.0', '2bcbb0381cc1572cace99aac8af08990') + + phases = ['bootstrap', 'build', 'install'] + + variant('python', default=False, description='Enable python support') + depends_on('python', when='+python') + + build_directory = 'build' + + def configure_args(self): + spec = self.spec + return [ + '--python' if '+python' in spec else '' + ] + + def bootstrap(self, spec, prefix): + options = ['--prefix={0}'.format(prefix)] + self.configure_args() + spec['python'].command('scripts/mk_make.py', *options) -- cgit v1.2.3-60-g2f50