From 495dd612183ea54393a5a5dc473972fc1790c9fd Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Fri, 8 Apr 2022 21:15:32 +0200 Subject: libgridxc: remove custom phases, make it a Makefile package --- .../repos/builtin/packages/libgridxc/package.py | 30 ++++++++++------------ 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/var/spack/repos/builtin/packages/libgridxc/package.py b/var/spack/repos/builtin/packages/libgridxc/package.py index daac1bec3b..59a87f79d3 100644 --- a/var/spack/repos/builtin/packages/libgridxc/package.py +++ b/var/spack/repos/builtin/packages/libgridxc/package.py @@ -8,9 +8,10 @@ import os from spack import * -class Libgridxc(Package): +class Libgridxc(MakefilePackage): """A library to compute the exchange and correlation energy and potential - in spherical (i.e. an atom) or periodic systems.""" + in spherical (i.e. an atom) or periodic systems. + """ homepage = "https://gitlab.com/siesta-project/libraries/libgridxc" git = "https://gitlab.com/siesta-project/libraries/libgridxc.git" @@ -31,26 +32,23 @@ class Libgridxc(Package): depends_on('m4', type='build') depends_on('libxc@:4.3.4', when='@0.8.0:') - phases = ['configure', 'build', 'install'] + build_directory = 'build' - def configure(self, spec, prefix): + parallel = False + + def edit(self, spec, prefix): sh = which('sh') with working_dir('build', create=True): sh('../src/config.sh') copy('../extra/fortran.mk', 'fortran.mk') - def build(self, spec, prefix): - with working_dir('build'): - if self.version < Version('0.8.0'): - make('PREFIX=%s' % self.prefix, - 'FC=fc', - parallel=False) - else: - make('PREFIX=%s' % self.prefix, - 'FC=fc', - 'WITH_LIBXC=1', - 'LIBXC_ROOT=%s' % self.spec['libxc'].prefix, - parallel=False) + @property + def build_targets(self): + args = ['PREFIX={0}'.format(self.prefix), 'FC=fc'] + if self.spec.satisfies('@0.8.0:'): + args += ['WITH_LIBXC=1', + 'LIBXC_ROOT={0}'.format(self.spec['libxc'].prefix)] + return args def install(self, spec, prefix): mkdirp(join_path(self.prefix, 'share', 'org.siesta-project')) -- cgit v1.2.3-70-g09d2