From c1ad4bde28a09f39dbae0f6488dc7b7182d11f93 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 24 Oct 2016 16:41:20 -0700 Subject: Rename EditableMakefile to MakefilePackage --- lib/spack/spack/__init__.py | 4 +- lib/spack/spack/build_systems/editable_makefile.py | 77 ---------------------- lib/spack/spack/build_systems/makefile.py | 77 ++++++++++++++++++++++ 3 files changed, 79 insertions(+), 79 deletions(-) delete mode 100644 lib/spack/spack/build_systems/editable_makefile.py create mode 100644 lib/spack/spack/build_systems/makefile.py (limited to 'lib') diff --git a/lib/spack/spack/__init__.py b/lib/spack/spack/__init__.py index 918e17323b..67c64276ee 100644 --- a/lib/spack/spack/__init__.py +++ b/lib/spack/spack/__init__.py @@ -189,14 +189,14 @@ sys_type = None __all__ = ['Package', 'CMakePackage', 'AutotoolsPackage', - 'EditableMakefile', + 'MakefilePackage', 'Version', 'when', 'ver', 'alldeps', 'nolink'] from spack.package import Package, ExtensionConflictError -from spack.build_systems.editable_makefile import EditableMakefile +from spack.build_systems.makefile import MakefilePackage from spack.build_systems.autotools import AutotoolsPackage from spack.build_systems.cmake import CMakePackage from spack.version import Version, ver diff --git a/lib/spack/spack/build_systems/editable_makefile.py b/lib/spack/spack/build_systems/editable_makefile.py deleted file mode 100644 index e3adea8363..0000000000 --- a/lib/spack/spack/build_systems/editable_makefile.py +++ /dev/null @@ -1,77 +0,0 @@ -############################################################################## -# 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 -############################################################################## - -import inspect - -from llnl.util.filesystem import working_dir -from spack.package import PackageBase - - -class EditableMakefile(PackageBase): - """Specialized class for packages that are built using editable Makefiles - - This class provides three phases that can be overridden: - - edit - - build - - install - - It is necessary to override the 'edit' phase, while 'build' and 'install' - have sensible defaults. - """ - phases = ['edit', 'build', 'install'] - # To be used in UI queries that require to know which - # build-system class we are using - build_system_class = 'EditableMakefile' - - def build_directory(self): - """Directory where the main Makefile is located""" - return self.stage.source_path - - def build_args(self): - """List of arguments that should be passed to make at build time""" - return [] - - def install_args(self): - """List of arguments that should be passed to make at install time""" - return [] - - def edit(self, spec, prefix): - """This phase cannot be defaulted for obvious reasons...""" - raise NotImplementedError('\'edit\' function not implemented') - - def build(self, spec, prefix): - """Default build phase : call make passing build_args""" - args = self.build_args() - with working_dir(self.build_directory()): - inspect.getmodule(self).make(*args) - - def install(self, spec, prefix): - """Default install phase : call make passing install_args""" - args = self.install_args() + ['install'] - with working_dir(self.build_directory()): - inspect.getmodule(self).make(*args) - - # Check that self.prefix is there after installation - PackageBase.sanity_check('install')(PackageBase.sanity_check_prefix) diff --git a/lib/spack/spack/build_systems/makefile.py b/lib/spack/spack/build_systems/makefile.py new file mode 100644 index 0000000000..dcddadeedc --- /dev/null +++ b/lib/spack/spack/build_systems/makefile.py @@ -0,0 +1,77 @@ +############################################################################## +# 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 +############################################################################## + +import inspect + +from llnl.util.filesystem import working_dir +from spack.package import PackageBase + + +class MakefilePackage(PackageBase): + """Specialized class for packages that are built using editable Makefiles + + This class provides three phases that can be overridden: + - edit + - build + - install + + It is necessary to override the 'edit' phase, while 'build' and 'install' + have sensible defaults. + """ + phases = ['edit', 'build', 'install'] + # To be used in UI queries that require to know which + # build-system class we are using + build_system_class = 'MakefilePackage' + + def build_directory(self): + """Directory where the main Makefile is located""" + return self.stage.source_path + + def build_args(self): + """List of arguments that should be passed to make at build time""" + return [] + + def install_args(self): + """List of arguments that should be passed to make at install time""" + return [] + + def edit(self, spec, prefix): + """This phase cannot be defaulted for obvious reasons...""" + raise NotImplementedError('\'edit\' function not implemented') + + def build(self, spec, prefix): + """Default build phase : call make passing build_args""" + args = self.build_args() + with working_dir(self.build_directory()): + inspect.getmodule(self).make(*args) + + def install(self, spec, prefix): + """Default install phase : call make passing install_args""" + args = self.install_args() + ['install'] + with working_dir(self.build_directory()): + inspect.getmodule(self).make(*args) + + # Check that self.prefix is there after installation + PackageBase.sanity_check('install')(PackageBase.sanity_check_prefix) -- cgit v1.2.3-70-g09d2