spack/var/spack/repos/builtin/packages/dyninst/package.py
2018-03-24 12:13:52 -07:00

91 lines
3.8 KiB
Python

##############################################################################
# Copyright (c) 2013-2018, 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/spack/spack
# Please also see the NOTICE and LICENSE files 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 Dyninst(Package):
"""API for dynamic binary instrumentation. Modify programs while they
are executing without recompiling, re-linking, or re-executing."""
homepage = "https://paradyn.org"
url = "https://github.com/dyninst/dyninst/archive/v9.2.0.tar.gz"
list_url = "http://www.dyninst.org/downloads/dyninst-8.x"
version('9.3.2', git="https://github.com/dyninst/dyninst.git", tag='v9.3.2')
version('9.3.0', git="https://github.com/dyninst/dyninst.git", tag='v9.3.0')
version('9.2.0', git="https://github.com/dyninst/dyninst.git", tag='v9.2.0')
version('9.1.0', git="https://github.com/dyninst/dyninst.git", tag='v9.1.0')
version('8.2.1', git="https://github.com/dyninst/dyninst.git", tag='v8.2.1')
version('8.1.2', git="https://github.com/dyninst/dyninst.git", tag='v8.1.2')
version('8.1.1', git="https://github.com/dyninst/dyninst.git", tag='v8.1.1')
variant('stat_dysect', default=False,
description="patch for STAT's DySectAPI")
depends_on("elf@0", type='link', when='@:9.2.99')
depends_on("elf@1", type='link', when='@9.3.0:')
depends_on("libdwarf")
depends_on("boost@1.42:")
depends_on('cmake', type='build')
patch('stat_dysect.patch', when='+stat_dysect')
patch('stackanalysis_h.patch', when='@9.2.0')
# new version uses cmake
def install(self, spec, prefix):
if spec.satisfies('@:8.1'):
configure("--prefix=" + prefix)
make()
make("install")
return
libelf = spec['elf'].prefix
libdwarf = spec['libdwarf'].prefix
with working_dir('spack-build', create=True):
args = ['..',
'-DBoost_INCLUDE_DIR=%s' % spec['boost'].prefix.include,
'-DBoost_LIBRARY_DIR=%s' % spec['boost'].prefix.lib,
'-DBoost_NO_SYSTEM_PATHS=TRUE',
'-DLIBELF_INCLUDE_DIR=%s' % join_path(
libelf.include, 'libelf'),
'-DLIBELF_LIBRARIES=%s' % join_path(
libelf.lib, 'libelf.so'),
'-DLIBDWARF_INCLUDE_DIR=%s' % libdwarf.include,
'-DLIBDWARF_LIBRARIES=%s' % join_path(
libdwarf.lib, 'libdwarf.so')]
if spec.satisfies('arch=linux-redhat7-ppc64le'):
args.append('-Darch_ppc64_little_endian=1')
args += std_cmake_args
cmake(*args)
make()
make("install")
@when('@:8.1')
def install(self, spec, prefix):
configure("--prefix=" + prefix)
make()
make("install")