summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/cppcheck/package.py
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2018-08-15 11:30:09 -0500
committerTodd Gamblin <tgamblin@llnl.gov>2018-08-15 09:30:09 -0700
commit73c978ddd99973e29f2ba42078b10455c1de5ca8 (patch)
tree681d7ae0d3699ce8c73c126a2310f3c7430efd69 /var/spack/repos/builtin/packages/cppcheck/package.py
parentc0699539d56bc16271861dc0de61534f369f1bb9 (diff)
downloadspack-73c978ddd99973e29f2ba42078b10455c1de5ca8.tar.gz
spack-73c978ddd99973e29f2ba42078b10455c1de5ca8.tar.bz2
spack-73c978ddd99973e29f2ba42078b10455c1de5ca8.tar.xz
spack-73c978ddd99973e29f2ba42078b10455c1de5ca8.zip
install_tree, copy_tree can install into existing directory structures (#8289)
Replace use of `shutil.copytree` with `copy_tree` and `install_tree` functions in `llnl.util.filesystem`. - `copy_tree` copies without setting permissions. It should be used to copy files around in the build directory. - `install_tree` copies files and sets permissions. It should be used to copy files into the installation directory. - `install` and `copy` are analogous single-file functions. - add more extensive tests for these functions - update packages to use these functions.
Diffstat (limited to 'var/spack/repos/builtin/packages/cppcheck/package.py')
-rw-r--r--var/spack/repos/builtin/packages/cppcheck/package.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/var/spack/repos/builtin/packages/cppcheck/package.py b/var/spack/repos/builtin/packages/cppcheck/package.py
index 6286941b84..dfd2adb4eb 100644
--- a/var/spack/repos/builtin/packages/cppcheck/package.py
+++ b/var/spack/repos/builtin/packages/cppcheck/package.py
@@ -23,11 +23,9 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
-import os
-import shutil
-class Cppcheck(Package):
+class Cppcheck(MakefilePackage):
"""A tool for static C/C++ code analysis."""
homepage = "http://cppcheck.sourceforge.net/"
url = "https://downloads.sourceforge.net/project/cppcheck/cppcheck/1.78/cppcheck-1.78.tar.bz2"
@@ -41,12 +39,13 @@ class Cppcheck(Package):
depends_on('py-pygments', when='+htmlreport', type='run')
+ def build(self, spec, prefix):
+ make('CFGDIR={0}'.format(prefix.cfg))
+
def install(self, spec, prefix):
- # cppcheck does not have a configure script
- make("CFGDIR=%s" % os.path.join(prefix, 'cfg'))
- # manually install the final cppcheck binary
+ # Manually install the final cppcheck binary
mkdirp(prefix.bin)
install('cppcheck', prefix.bin)
- shutil.copytree('cfg', os.path.join(prefix, 'cfg'))
+ install_tree('cfg', prefix.cfg)
if spec.satisfies('+htmlreport'):
install('htmlreport/cppcheck-htmlreport', prefix.bin)