unmaintained a* packages: update to use f-strings (#40467)

This commit is contained in:
Alec Scott 2023-10-26 12:08:55 -07:00 committed by GitHub
parent 7ecb9243c1
commit cbf9dd0aee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 137 additions and 164 deletions

View file

@ -22,4 +22,4 @@ class AbiComplianceChecker(MakefilePackage):
depends_on("universal-ctags") depends_on("universal-ctags")
def install(self, spec, prefix): def install(self, spec, prefix):
make("prefix={0}".format(prefix), "install") make(f"prefix={prefix}", "install")

View file

@ -25,4 +25,4 @@ class AbiDumper(Package):
depends_on("vtable-dumper@1.1:") depends_on("vtable-dumper@1.1:")
def install(self, spec, prefix): def install(self, spec, prefix):
make("prefix={0}".format(prefix), "install") make(f"prefix={prefix}", "install")

View file

@ -101,11 +101,7 @@ class Abinit(AutotoolsPackage):
# TODO: The logic here can be reversed with the new concretizer. Instead of # TODO: The logic here can be reversed with the new concretizer. Instead of
# using `conflicts`, `depends_on` could be used instead. # using `conflicts`, `depends_on` could be used instead.
for fftw in ["amdfftw", "cray-fftw", "fujitsu-fftw", "fftw"]: for fftw in ["amdfftw", "cray-fftw", "fujitsu-fftw", "fftw"]:
conflicts( conflicts("+openmp", when=f"^{fftw}~openmp", msg=f"Need to request {fftw} +openmp")
"+openmp",
when="^{0}~openmp".format(fftw),
msg="Need to request {0} +openmp".format(fftw),
)
mkl_message = "Need to set dependent variant to threads=openmp" mkl_message = "Need to set dependent variant to threads=openmp"
conflicts("+openmp", when="^intel-mkl threads=none", msg=mkl_message) conflicts("+openmp", when="^intel-mkl threads=none", msg=mkl_message)
@ -137,34 +133,28 @@ def configure_args(self):
oapp = options.append oapp = options.append
if "@:8" in spec: if "@:8" in spec:
oapp("--enable-optim={0}".format(self.spec.variants["optimization-flavor"].value)) oapp(f"--enable-optim={self.spec.variants['optimization-flavor'].value}")
else: else:
oapp("--with-optim-flavor={0}".format(self.spec.variants["optimization-flavor"].value)) oapp(f"--with-optim-flavor={self.spec.variants['optimization-flavor'].value}")
if "+wannier90" in spec: if "+wannier90" in spec:
if "@:8" in spec: if "@:8" in spec:
oapp( oapp(f"--with-wannier90-libs=-L{spec['wannier90'].prefix.lib} -lwannier -lm")
"--with-wannier90-libs=-L{0}".format( oapp(f"--with-wannier90-incs=-I{spec['wannier90'].prefix.modules}")
spec["wannier90"].prefix.lib + " -lwannier -lm" oapp(f"--with-wannier90-bins={spec['wannier90'].prefix.bin}")
)
)
oapp("--with-wannier90-incs=-I{0}".format(spec["wannier90"].prefix.modules))
oapp("--with-wannier90-bins={0}".format(spec["wannier90"].prefix.bin))
oapp("--enable-connectors") oapp("--enable-connectors")
oapp("--with-dft-flavor=atompaw+libxc+wannier90") oapp("--with-dft-flavor=atompaw+libxc+wannier90")
else: else:
options.extend( options.extend(
[ [
"WANNIER90_CPPFLAGS=-I{0}".format(spec["wannier90"].prefix.modules), f"WANNIER90_CPPFLAGS=-I{spec['wannier90'].prefix.modules}",
"WANNIER90_LIBS=-L{0} {1}".format( f"WANNIER90_LIBS=-L{spec['wannier90'].prefix.lib} -lwannier",
spec["wannier90"].prefix.lib, "-lwannier"
),
] ]
) )
else: else:
if "@:9.8" in spec: if "@:9.8" in spec:
oapp("--with-fftw={0}".format(spec["fftw-api"].prefix)) oapp(f"--with-fftw={spec['fftw-api'].prefix}")
oapp("--with-hdf5={0}".format(spec["hdf5"].prefix)) oapp(f"--with-hdf5={spec['hdf5'].prefix}")
if "@:8" in spec: if "@:8" in spec:
oapp("--with-dft-flavor=atompaw+libxc") oapp("--with-dft-flavor=atompaw+libxc")
@ -172,9 +162,9 @@ def configure_args(self):
"--without-wannier90", "--without-wannier90",
if "+mpi" in spec: if "+mpi" in spec:
oapp("CC={0}".format(spec["mpi"].mpicc)) oapp(f"CC={spec['mpi'].mpicc}")
oapp("CXX={0}".format(spec["mpi"].mpicxx)) oapp(f"CXX={spec['mpi'].mpicxx}")
oapp("FC={0}".format(spec["mpi"].mpifc)) oapp(f"FC={spec['mpi'].mpifc}")
# MPI version: # MPI version:
# let the configure script auto-detect MPI support from mpi_prefix # let the configure script auto-detect MPI support from mpi_prefix
@ -208,14 +198,14 @@ def configure_args(self):
if "+scalapack" in spec: if "+scalapack" in spec:
linalg = spec["scalapack"].libs + linalg linalg = spec["scalapack"].libs + linalg
if "@:8" in spec: if "@:8" in spec:
linalg_flavor = "scalapack+{0}".format(linalg_flavor) linalg_flavor = f"scalapack+{linalg_flavor}"
if "@:8" in spec: if "@:8" in spec:
oapp("--with-linalg-libs={0}".format(linalg.ld_flags)) oapp(f"--with-linalg-libs={linalg.ld_flags}")
else: else:
oapp("LINALG_LIBS={0}".format(linalg.ld_flags)) oapp(f"LINALG_LIBS={linalg.ld_flags}")
oapp("--with-linalg-flavor={0}".format(linalg_flavor)) oapp(f"--with-linalg-flavor={linalg_flavor}")
if "^mkl" in spec: if "^mkl" in spec:
fftflavor = "dfti" fftflavor = "dfti"
@ -225,32 +215,32 @@ def configure_args(self):
else: else:
fftflavor, fftlibs = "fftw3", "-lfftw3 -lfftw3f" fftflavor, fftlibs = "fftw3", "-lfftw3 -lfftw3f"
oapp("--with-fft-flavor={0}".format(fftflavor)) oapp(f"--with-fft-flavor={fftflavor}")
if "@:8" in spec: if "@:8" in spec:
if "^mkl" in spec: if "^mkl" in spec:
oapp("--with-fft-incs={0}".format(spec["fftw-api"].headers.cpp_flags)) oapp(f"--with-fft-incs={spec['fftw-api'].headers.cpp_flags}")
oapp("--with-fft-libs={0}".format(spec["fftw-api"].libs.ld_flags)) oapp(f"--with-fft-libs={spec['fftw-api'].libs.ld_flags}")
else: else:
options.extend( options.extend(
[ [
"--with-fft-incs={0}".format(spec["fftw-api"].headers.cpp_flags), f"--with-fft-incs={spec['fftw-api'].headers.cpp_flags}",
"--with-fft-libs=-L{0} {1}".format(spec["fftw-api"].prefix.lib, fftlibs), f"--with-fft-libs=-L{spec['fftw-api'].prefix.lib} {fftlibs}",
] ]
) )
else: else:
if "^mkl" in spec: if "^mkl" in spec:
options.extend( options.extend(
[ [
"FFT_CPPFLAGS={0}".format(spec["fftw-api"].headers.cpp_flags), f"FFT_CPPFLAGS={spec['fftw-api'].headers.cpp_flags}",
"FFT_LIBs={0}".format(spec["fftw-api"].libs.ld_flags), f"FFT_LIBs={spec['fftw-api'].libs.ld_flags}",
] ]
) )
else: else:
options.extend( options.extend(
[ [
"FFTW3_CPPFLAGS={0}".format(spec["fftw-api"].headers.cpp_flags), f"FFTW3_CPPFLAGS={spec['fftw-api'].headers.cpp_flags}",
"FFTW3_LIBS=-L{0} {1}".format(spec["fftw-api"].prefix.lib, fftlibs), f"FFTW3_LIBS=-L{spec['fftw-api'].prefix.lib} {fftlibs}",
] ]
) )
@ -259,12 +249,12 @@ def configure_args(self):
if "@:8" in spec: if "@:8" in spec:
options.extend( options.extend(
[ [
"--with-libxc-incs={0}".format(libxc.headers.cpp_flags), f"--with-libxc-incs={libxc.headers.cpp_flags}",
"--with-libxc-libs={0}".format(libxc.libs.ld_flags + " -lm"), f"--with-libxc-libs={libxc.libs.ld_flags + ' -lm'}",
] ]
) )
else: else:
oapp("--with-libxc={0}".format(libxc.prefix)) oapp(f"--with-libxc={libxc.prefix}")
# Netcdf4/HDF5 # Netcdf4/HDF5
hdf5 = spec["hdf5:hl"] hdf5 = spec["hdf5:hl"]
@ -276,24 +266,21 @@ def configure_args(self):
# to link with the high level HDF5 library # to link with the high level HDF5 library
options.extend( options.extend(
[ [
"--with-netcdf-incs={0}".format( "--with-netcdf-incs={}".format(
netcdfc.headers.cpp_flags + " " + netcdff.headers.cpp_flags netcdfc.headers.cpp_flags + " " + netcdff.headers.cpp_flags
), ),
"--with-netcdf-libs={0}".format( "--with-netcdf-libs={}".format(
netcdff.libs.ld_flags + " " + hdf5.libs.ld_flags netcdff.libs.ld_flags + " " + hdf5.libs.ld_flags
), ),
] ]
) )
else: else:
options.extend( options.extend(
[ [f"--with-netcdf={netcdfc.prefix}", f"--with-netcdf-fortran={netcdff.prefix}"]
"--with-netcdf={0}".format(netcdfc.prefix),
"--with-netcdf-fortran={0}".format(netcdff.prefix),
]
) )
if self.spec.satisfies("%fj"): if self.spec.satisfies("%fj"):
oapp("FCFLAGS_MODDIR=-M{0}".format(join_path(self.stage.source_path, "src/mods"))) oapp(f"FCFLAGS_MODDIR=-M{join_path(self.stage.source_path, 'src/mods')}")
return options return options

View file

@ -60,12 +60,12 @@ class Abyss(AutotoolsPackage):
def configure_args(self): def configure_args(self):
maxk = int(self.spec.variants["maxk"].value) maxk = int(self.spec.variants["maxk"].value)
args = [ args = [
"--with-boost=%s" % self.spec["boost"].prefix, f"--with-boost={self.spec['boost'].prefix}",
"--with-sqlite=%s" % self.spec["sqlite"].prefix, f"--with-sqlite={self.spec['sqlite'].prefix}",
"--with-mpi=%s" % self.spec["mpi"].prefix, f"--with-mpi={self.spec['mpi'].prefix}",
] ]
if maxk: if maxk:
args.append("--enable-maxk=%s" % maxk) args.append(f"--enable-maxk={maxk}")
if self.spec["mpi"].name == "mpich": if self.spec["mpi"].name == "mpich":
args.append("--enable-mpich") args.append("--enable-mpich")
return args return args

View file

@ -32,15 +32,15 @@ class Accfft(CMakePackage, CudaPackage):
def cmake_args(self): def cmake_args(self):
spec = self.spec spec = self.spec
args = [ args = [
"-DFFTW_ROOT={0}".format(spec["fftw"].prefix), self.define("FFTW_ROOT", spec["fftw"].prefix),
"-DFFTW_USE_STATIC_LIBS=false", self.define("FFTW_USE_STATIC_LIBS", "false"),
"-DBUILD_GPU={0}".format("true" if "+cuda" in spec else "false"), self.define("BUILD_GPU", str(spec.satisfies("+cuda")).lower()),
"-DBUILD_SHARED={0}".format("true" if "+shared" in spec else "false"), self.define("BUILD_SHARED", str(spec.satisfies("+shared")).lower()),
] ]
if "+cuda" in spec: if "+cuda" in spec:
cuda_arch = [x for x in spec.variants["cuda_arch"].value if x] cuda_arch = [x for x in spec.variants["cuda_arch"].value if x]
if cuda_arch: if cuda_arch:
args.append("-DCUDA_NVCC_FLAGS={0}".format(" ".join(self.cuda_flags(cuda_arch)))) args.append(f"-DCUDA_NVCC_FLAGS={' '.join(self.cuda_flags(cuda_arch))}")
return args return args

View file

@ -43,4 +43,4 @@ def edit(self, spec, prefix):
"include $(ACE_ROOT)/include/makeinclude/" "include $(ACE_ROOT)/include/makeinclude/"
"platform_linux" + supported[self.compiler.name] + ".GNU\n" "platform_linux" + supported[self.compiler.name] + ".GNU\n"
) )
f.write("INSTALL_PREFIX=%s" % prefix) f.write(f"INSTALL_PREFIX={prefix}")

View file

@ -41,7 +41,7 @@ class Ack(Package):
def install(self, spec, prefix): def install(self, spec, prefix):
mkdirp(prefix.bin) mkdirp(prefix.bin)
ack_source = "ack-{0}-single-file".format(self.version) ack_source = f"ack-{self.version}-single-file"
ack_installed = join_path(prefix.bin, "ack") ack_installed = join_path(prefix.bin, "ack")
# install source # install source

View file

@ -19,4 +19,4 @@ class AcpicaTools(MakefilePackage):
depends_on("bison", type="build") depends_on("bison", type="build")
def install(self, spec, prefix): def install(self, spec, prefix):
make("PREFIX={0}".format(prefix), "install") make(f"PREFIX={prefix}", "install")

View file

@ -29,7 +29,7 @@ def setup_build_environment(self, spack_env):
@when("@:4.5") @when("@:4.5")
def install(self, spec, prefix): def install(self, spec, prefix):
make("install", "PREFIX=%s" % prefix) make("install", f"PREFIX={prefix}")
@when("@4.6.0:") @when("@4.6.0:")
def install(self, spec, prefix): def install(self, spec, prefix):

View file

@ -19,7 +19,7 @@ class Adf(Package):
version("2017.113", sha256="666ef15d253b74c707dd14da35e7cf283ca20e21e24ed43cb953fb9d1f2f1e15") version("2017.113", sha256="666ef15d253b74c707dd14da35e7cf283ca20e21e24ed43cb953fb9d1f2f1e15")
def url_for_version(self, version): def url_for_version(self, version):
return "file://{0}/adf/adf{1}.pc64_linux.openmpi.bin.tgz".format(os.getcwd(), version) return f"file://{os.getcwd()}/adf/adf{version}.pc64_linux.openmpi.bin.tgz"
# Licensing # Licensing
license_required = True license_required = True

View file

@ -30,7 +30,7 @@ def edit(self, spec, prefix):
filter_file(r"so", dso_suffix, make_file) filter_file(r"so", dso_suffix, make_file)
def install(self, spec, prefix): def install(self, spec, prefix):
name = "libalglib.{0}".format(dso_suffix) name = f"libalglib.{dso_suffix}"
with working_dir("src"): with working_dir("src"):
mkdirp(prefix.lib) mkdirp(prefix.lib)
install(name, prefix.lib) install(name, prefix.lib)

View file

@ -30,8 +30,8 @@ def configure_args(self):
spec = self.spec spec = self.spec
args = [] args = []
if spec.satisfies("+python"): if spec.satisfies("+python"):
args.append("--with-pythonlibs={0}".format(spec["python"].libs.ld_flags)) args.append(f"--with-pythonlibs={spec['python'].libs.ld_flags}")
args.append("--with-pythonincludes={0}".format(spec["python"].headers.include_flags)) args.append(f"--with-pythonincludes={spec['python'].headers.include_flags}")
else: else:
args.append("--disable-python") args.append("--disable-python")
return args return args

View file

@ -46,9 +46,9 @@ def build_targets(self):
if "+int64" in self.spec: if "+int64" in self.spec:
include_cflags.append("-DHYPRE_BIGINT") include_cflags.append("-DHYPRE_BIGINT")
targets.append("INCLUDE_CFLAGS={0}".format(" ".join(include_cflags))) targets.append(f"INCLUDE_CFLAGS={' '.join(include_cflags)}")
targets.append("INCLUDE_LFLAGS={0}".format(" ".join(include_lflags))) targets.append(f"INCLUDE_LFLAGS={' '.join(include_lflags)}")
targets.append("CC={0}".format(self.spec["mpi"].mpicc)) targets.append(f"CC={self.spec['mpi'].mpicc}")
return targets return targets

View file

@ -40,7 +40,7 @@ def cmake_args(self):
cmake_options = [] cmake_options = []
cmake_options.append(self.define_from_variant("AMG_WITH_CALIPER", "caliper")) cmake_options.append(self.define_from_variant("AMG_WITH_CALIPER", "caliper"))
cmake_options.append(self.define_from_variant("AMG_WITH_OMP", "openmp")) cmake_options.append(self.define_from_variant("AMG_WITH_OMP", "openmp"))
cmake_options.append("-DHYPRE_PREFIX={0}".format(self.spec["hypre"].prefix)) cmake_options.append(self.define("HYPRE_PREFIX", self.spec["hypre"].prefix))
if self.spec["hypre"].satisfies("+cuda"): if self.spec["hypre"].satisfies("+cuda"):
cmake_options.append("-DAMG_WITH_CUDA=ON") cmake_options.append("-DAMG_WITH_CUDA=ON")
if self.spec["hypre"].satisfies("+rocm"): if self.spec["hypre"].satisfies("+rocm"):

View file

@ -117,9 +117,7 @@ def cmake_args(self):
): ):
if "+" + vname in spec: if "+" + vname in spec:
tpl_list.append(vname.upper()) tpl_list.append(vname.upper())
options.append( options.append(self.define(f"TPL_{vname.upper()}_INSTALL_DIR", spec[vname].prefix))
self.define("TPL_{0}_INSTALL_DIR".format(vname.upper()), spec[vname].prefix)
)
if "+netcdf" in spec: if "+netcdf" in spec:
tpl_list.append("NETCDF") tpl_list.append("NETCDF")

View file

@ -19,7 +19,7 @@ class Anicalculator(Package):
https://spack.readthedocs.io/en/latest/mirrors.html""" https://spack.readthedocs.io/en/latest/mirrors.html"""
homepage = "https://ani.jgi.doe.gov/html/download.php?" homepage = "https://ani.jgi.doe.gov/html/download.php?"
url = "file://{0}/ANIcalculator_v1.tgz".format(os.getcwd()) url = f"file://{os.getcwd()}/ANIcalculator_v1.tgz"
manual_download = True manual_download = True
version("1", sha256="236596a9a204cbcad162fc66be3506b2530b1f48f4f84d9647ccec3ca7483a43") version("1", sha256="236596a9a204cbcad162fc66be3506b2530b1f48f4f84d9647ccec3ca7483a43")

View file

@ -23,9 +23,9 @@ def install(self, spec, prefix):
args = [] args = []
args.extend( args.extend(
[ [
"--prefix=%s" % prefix, f"--prefix={prefix}",
"--with-gsl-prefix=%s" % spec["gsl"].prefix, f"--with-gsl-prefix={spec['gsl'].prefix}",
"--with-libxc-prefix=%s" % spec["libxc"].prefix, f"--with-libxc-prefix={spec['libxc'].prefix}",
] ]
) )

View file

@ -37,16 +37,16 @@ class AprUtil(AutotoolsPackage):
@property @property
def libs(self): def libs(self):
return find_libraries( return find_libraries(
["libaprutil-{0}".format(self.version.up_to(1))], root=self.prefix, recursive=True [f"libaprutil-{self.version.up_to(1)}"], root=self.prefix, recursive=True
) )
def configure_args(self): def configure_args(self):
spec = self.spec spec = self.spec
args = [ args = [
"--with-apr={0}".format(spec["apr"].prefix), f"--with-apr={spec['apr'].prefix}",
"--with-expat={0}".format(spec["expat"].prefix), f"--with-expat={spec['expat'].prefix}",
"--with-iconv={0}".format(spec["iconv"].prefix), f"--with-iconv={spec['iconv'].prefix}",
# TODO: Add support for the following database managers # TODO: Add support for the following database managers
"--without-ndbm", "--without-ndbm",
"--without-berkeley-db", "--without-berkeley-db",
@ -55,34 +55,30 @@ def configure_args(self):
] ]
if "+crypto" in spec: if "+crypto" in spec:
args.extend(["--with-crypto", "--with-openssl={0}".format(spec["openssl"].prefix)]) args.extend(["--with-crypto", f"--with-openssl={spec['openssl'].prefix}"])
else: else:
args.append("--without-crypto") args.append("--without-crypto")
if "+gdbm" in spec: if "+gdbm" in spec:
args.append("--with-gdbm={0}".format(spec["gdbm"].prefix)) args.append(f"--with-gdbm={spec['gdbm'].prefix}")
else: else:
args.append("--without-gdbm") args.append("--without-gdbm")
if "+pgsql" in spec: if "+pgsql" in spec:
args.append("--with-pgsql={0}".format(spec["postgresql"].prefix)) args.append(f"--with-pgsql={spec['postgresql'].prefix}")
else: else:
args.append("--without-pgsql") args.append("--without-pgsql")
if "+sqlite" in spec: if "+sqlite" in spec:
if spec.satisfies("^sqlite@3.0:3"): if spec.satisfies("^sqlite@3.0:3"):
args.extend( args.extend([f"--with-sqlite3={spec['sqlite'].prefix}", "--without-sqlite2"])
["--with-sqlite3={0}".format(spec["sqlite"].prefix), "--without-sqlite2"]
)
elif spec.satisfies("^sqlite@2.0:2"): elif spec.satisfies("^sqlite@2.0:2"):
args.extend( args.extend([f"--with-sqlite2={spec['sqlite'].prefix}", "--without-sqlite3"])
["--with-sqlite2={0}".format(spec["sqlite"].prefix), "--without-sqlite3"]
)
else: else:
args.extend(["--without-sqlite2", "--without-sqlite3"]) args.extend(["--without-sqlite2", "--without-sqlite3"])
if "+odbc" in spec: if "+odbc" in spec:
args.append("--with-odbc={0}".format(spec["unixodbc"].prefix)) args.append(f"--with-odbc={spec['unixodbc'].prefix}")
else: else:
args.append("--without-odbc") args.append("--without-odbc")

View file

@ -26,5 +26,5 @@ class Apr(AutotoolsPackage):
@property @property
def libs(self): def libs(self):
return find_libraries( return find_libraries(
["libapr-{0}".format(self.version.up_to(1))], root=self.prefix, recursive=True [f"libapr-{self.version.up_to(1)}"], root=self.prefix, recursive=True
) )

View file

@ -31,7 +31,7 @@ class Aragorn(Package):
# fix checksum error # fix checksum error
def url_for_version(self, version): def url_for_version(self, version):
return "http://www.ansikte.se/ARAGORN/Downloads/aragorn{0}.c".format(version) return f"http://www.ansikte.se/ARAGORN/Downloads/aragorn{version}.c"
def install(self, spec, prefix): def install(self, spec, prefix):
cc = Executable(spack_cc) cc = Executable(spack_cc)

View file

@ -38,9 +38,9 @@ def patch(self):
def cmake_args(self): def cmake_args(self):
return [ return [
"-DCMAKE_C_COMPILER=clang", self.define("CMAKE_C_COMPILER", "clang"),
"-DCMAKE_CXX_COMPILER=clang++", self.define("CMAKE_CXX_COMPILER", "clang++"),
"-DOMP_PREFIX:PATH=%s" % self.spec["llvm-openmp-ompt"].prefix, self.define("OMP_PREFIX:PATH", self.spec["llvm-openmp-ompt"].prefix),
] ]
@run_after("install") @run_after("install")
@ -56,7 +56,7 @@ def test_run_parallel_example(self):
raise SkipTest("Parallel test directory does not exist") raise SkipTest("Parallel test directory does not exist")
test_exe = "parallel-simple" test_exe = "parallel-simple"
test_src = "{0}.c".format(test_exe) test_src = f"{test_exe}.c"
with working_dir(test_dir): with working_dir(test_dir):
clang = which("clang-archer") clang = which("clang-archer")
clang("-o", test_exe, test_src) clang("-o", test_exe, test_src)

View file

@ -20,4 +20,4 @@ class Argon2(MakefilePackage):
version("20161029", sha256="fe0049728b946b58b94cc6db89b34e2d050c62325d16316a534d2bedd78cd5e7") version("20161029", sha256="fe0049728b946b58b94cc6db89b34e2d050c62325d16316a534d2bedd78cd5e7")
def install(self, spec, prefix): def install(self, spec, prefix):
make("PREFIX={0}".format(prefix), "install", "LIBRARY_REL=lib") make(f"PREFIX={prefix}", "install", "LIBRARY_REL=lib")

View file

@ -66,14 +66,14 @@ def cmake_args(self):
return [ return [
# ARPACK support # ARPACK support
"-DARPACK_LIBRARY={0}".format(spec["arpack-ng"].libs.joined(";")), self.define("ARPACK_LIBRARY", spec["arpack-ng"].libs.joined(";")),
# BLAS support # BLAS support
"-DBLAS_LIBRARY={0}".format(spec["blas"].libs.joined(";")), self.define("BLAS_LIBRARY", spec["blas"].libs.joined(";")),
# LAPACK support # LAPACK support
"-DLAPACK_LIBRARY={0}".format(spec["lapack"].libs.joined(";")), self.define("LAPACK_LIBRARY", spec["lapack"].libs.joined(";")),
# SuperLU support # SuperLU support
"-DSuperLU_INCLUDE_DIR={0}".format(spec["superlu"].prefix.include), self.define("SuperLU_INCLUDE_DIR", spec["superlu"].prefix.include),
"-DSuperLU_LIBRARY={0}".format(spec["superlu"].libs.joined(";")), self.define("SuperLU_LIBRARY", spec["superlu"].libs.joined(";")),
# HDF5 support # HDF5 support
"-DDETECT_HDF5={0}".format("ON" if "+hdf5" in spec else "OFF"), self.define("DETECT_HDF5", "ON" if spec.satisfies("+hdf5") else "OFF"),
] ]

View file

@ -150,14 +150,14 @@ def configure_args(self):
options = ( options = (
self.enable_or_disable("mpi") self.enable_or_disable("mpi")
+ [ + [
"--with-blas={0}".format(spec["blas"].libs.ld_flags), f"--with-blas={spec['blas'].libs.ld_flags}",
"--with-lapack={0}".format(spec["lapack"].libs.ld_flags), f"--with-lapack={spec['lapack'].libs.ld_flags}",
] ]
+ self.enable_or_disable("shared") + self.enable_or_disable("shared")
) )
if "+mpi" in spec: if "+mpi" in spec:
options.append("F77={0}".format(spec["mpi"].mpif77)) options.append(f"F77={spec['mpi'].mpif77}")
return options return options

View file

@ -27,6 +27,6 @@ class Asdcplib(AutotoolsPackage):
def configure_args(self): def configure_args(self):
spec = self.spec spec = self.spec
args = ["--with-openssl={0}".format(spec["openssl"].prefix)] args = [f"--with-openssl={spec['openssl'].prefix}"]
return args return args

View file

@ -35,12 +35,12 @@ def build_targets(self):
targets = [ targets = [
"--directory=exec", "--directory=exec",
"--file=Makefile", "--file=Makefile",
"LIBS={0} {1} {2}".format( "LIBS={} {} {}".format(
self.spec["lapack"].libs.ld_flags, self.spec["lapack"].libs.ld_flags,
self.spec["blas"].libs.ld_flags, self.spec["blas"].libs.ld_flags,
self.spec["hdf5"].libs.ld_flags, self.spec["hdf5"].libs.ld_flags,
), ),
"CXX={0}".format(self.spec["mpi"].mpicxx), f"CXX={self.spec['mpi'].mpicxx}",
] ]
return targets return targets

View file

@ -28,11 +28,9 @@ class Aspcud(CMakePackage):
depends_on("clingo") depends_on("clingo")
def cmake_args(self): def cmake_args(self):
spec = self.spec gringo_path = join_path(self.spec["clingo"].prefix.bin, "gringo")
gringo_path = join_path(spec["clingo"].prefix.bin, "gringo") clasp_path = join_path(self.spec["clingo"].prefix.bin, "clasp")
clasp_path = join_path(spec["clingo"].prefix.bin, "clasp") return [
args = [ self.define("ASPCUD_GRINGO_PATH", gringo_path),
"-DASPCUD_GRINGO_PATH={0}".format(gringo_path), self.define("ASPCUD_CLASP_PATH", clasp_path),
"-DASPCUD_CLASP_PATH={0}".format(clasp_path),
] ]
return args

View file

@ -29,7 +29,7 @@ def install(self, spec, prefix):
# Update destination path # Update destination path
filter_file( filter_file(
"INSTALL_DIR=~/.aspera", "INSTALL_DIR=~/.aspera",
"INSTALL_DIR=%s" % prefix, f"INSTALL_DIR={prefix}",
runfile, runfile,
string=True, string=True,
stop_at="__ARCHIVE_FOLLOWS__", stop_at="__ARCHIVE_FOLLOWS__",

View file

@ -31,7 +31,7 @@ def install(self, spec, prefix):
make() make()
mkdirp(prefix.bin) mkdirp(prefix.bin)
install_tree("lib", prefix.tools.lib) install_tree("lib", prefix.tools.lib)
jar_file = "astral.{v}.jar".format(v=self.version) jar_file = f"astral.{self.version}.jar"
install(jar_file, prefix.tools) install(jar_file, prefix.tools)
script_sh = join_path(os.path.dirname(__file__), "astral.sh") script_sh = join_path(os.path.dirname(__file__), "astral.sh")

View file

@ -30,11 +30,11 @@ def build_directory(self):
def edit(self, spec, prefix): def edit(self, spec, prefix):
makefile = join_path(self.build_directory, "Makefile") makefile = join_path(self.build_directory, "Makefile")
filter_file(r"^CXX\s*=.*", "CXX=%s" % spack_cxx, makefile) filter_file(r"^CXX\s*=.*", f"CXX={spack_cxx}", makefile)
# If the group is not a user account, the installation will fail, # If the group is not a user account, the installation will fail,
# so remove the -o $ (USER) -g $ (USER) parameter. # so remove the -o $ (USER) -g $ (USER) parameter.
filter_file(r"^INSTALL=.*", "INSTALL=install", makefile) filter_file(r"^INSTALL=.*", "INSTALL=install", makefile)
@property @property
def install_targets(self): def install_targets(self):
return ["install", "prefix={0}".format(self.prefix)] return ["install", f"prefix={self.prefix}"]

View file

@ -27,4 +27,4 @@ class AtSpi2Atk(MesonPackage):
def url_for_version(self, version): def url_for_version(self, version):
"""Handle gnome's version-based custom URLs.""" """Handle gnome's version-based custom URLs."""
url = "http://ftp.gnome.org/pub/gnome/sources/at-spi2-atk" url = "http://ftp.gnome.org/pub/gnome/sources/at-spi2-atk"
return url + "/%s/at-spi2-atk-%s.tar.xz" % (version.up_to(2), version) return url + f"/{version.up_to(2)}/at-spi2-atk-{version}.tar.xz"

View file

@ -45,7 +45,7 @@ def patch(self):
def url_for_version(self, version): def url_for_version(self, version):
"""Handle gnome's version-based custom URLs.""" """Handle gnome's version-based custom URLs."""
url = "http://ftp.gnome.org/pub/gnome/sources/at-spi2-core" url = "http://ftp.gnome.org/pub/gnome/sources/at-spi2-core"
return url + "/%s/at-spi2-core-%s.tar.xz" % (version.up_to(2), version) return url + f"/{version.up_to(2)}/at-spi2-core-{version}.tar.xz"
def setup_run_environment(self, env): def setup_run_environment(self, env):
env.prepend_path("GI_TYPELIB_PATH", join_path(self.prefix.lib, "girepository-1.0")) env.prepend_path("GI_TYPELIB_PATH", join_path(self.prefix.lib, "girepository-1.0"))

View file

@ -43,7 +43,7 @@ class Atk(Package):
def url_for_version(self, version): def url_for_version(self, version):
"""Handle gnome's version-based custom URLs.""" """Handle gnome's version-based custom URLs."""
url = "http://ftp.gnome.org/pub/gnome/sources/atk" url = "http://ftp.gnome.org/pub/gnome/sources/atk"
return url + "/%s/atk-%s.tar.xz" % (version.up_to(2), version) return url + f"/{version.up_to(2)}/atk-{version}.tar.xz"
def setup_run_environment(self, env): def setup_run_environment(self, env):
env.prepend_path("GI_TYPELIB_PATH", join_path(self.prefix.lib, "girepository-1.0")) env.prepend_path("GI_TYPELIB_PATH", join_path(self.prefix.lib, "girepository-1.0"))
@ -64,7 +64,7 @@ def install(self, spec, prefix):
@when("@:2.27") @when("@:2.27")
def install(self, spec, prefix): def install(self, spec, prefix):
configure("--prefix={0}".format(prefix)) configure(f"--prefix={prefix}")
make() make()
if self.run_tests: if self.run_tests:
make("check") make("check")

View file

@ -109,11 +109,11 @@ def install(self, spec, prefix):
# Lapack resource to provide full lapack build. Note that # Lapack resource to provide full lapack build. Note that
# ATLAS only provides a few LAPACK routines natively. # ATLAS only provides a few LAPACK routines natively.
options.append("--with-netlib-lapack-tarfile=%s" % self.stage[1].archive_file) options.append(f"--with-netlib-lapack-tarfile={self.stage[1].archive_file}")
with working_dir("spack-build", create=True): with working_dir("spack-build", create=True):
configure = Executable("../configure") configure = Executable("../configure")
configure("--prefix=%s" % prefix, *options) configure(f"--prefix={prefix}", *options)
make() make()
make("check") make("check")
make("ptcheck") make("ptcheck")
@ -147,7 +147,7 @@ def install_test(self):
source_file = join_path(os.path.dirname(self.module.__file__), "test_cblas_dgemm.c") source_file = join_path(os.path.dirname(self.module.__file__), "test_cblas_dgemm.c")
blessed_file = join_path(os.path.dirname(self.module.__file__), "test_cblas_dgemm.output") blessed_file = join_path(os.path.dirname(self.module.__file__), "test_cblas_dgemm.output")
include_flags = ["-I%s" % self.spec.prefix.include] include_flags = [f"-I{self.spec.prefix.include}"]
link_flags = self.spec["atlas"].libs.ld_flags.split() link_flags = self.spec["atlas"].libs.ld_flags.split()
output = compile_c_and_execute(source_file, include_flags, link_flags) output = compile_c_and_execute(source_file, include_flags, link_flags)

View file

@ -24,8 +24,8 @@ def edit(self, spec, prefix):
@property @property
def build_targets(self): def build_targets(self):
return [ return [
"XMLF90_ROOT=%s" % self.spec["xmlf90"].prefix, f"XMLF90_ROOT={self.spec['xmlf90'].prefix}",
"GRIDXC_ROOT=%s" % self.spec["libgridxc"].prefix, f"GRIDXC_ROOT={self.spec['libgridxc'].prefix}",
"FC=fc", "FC=fc",
] ]

View file

@ -49,8 +49,8 @@ def configure_args(self):
spec = self.spec spec = self.spec
linalg = spec["lapack"].libs + spec["blas"].libs linalg = spec["lapack"].libs + spec["blas"].libs
return [ return [
"--with-linalg-libs=%s" % linalg.ld_flags, f"--with-linalg-libs={linalg.ld_flags}",
"--enable-libxc", "--enable-libxc",
"--with-libxc-incs=-I%s" % spec["libxc"].prefix.include, f"--with-libxc-incs=-I{spec['libxc'].prefix.include}",
"--with-libxc-libs=-L%s -lxcf90 -lxc" % spec["libxc"].prefix.lib, f"--with-libxc-libs=-L{spec['libxc'].prefix.lib} -lxcf90 -lxc",
] ]

View file

@ -28,7 +28,7 @@ class Audacious(AutotoolsPackage):
def patch(self): def patch(self):
search_path_args = " ".join(self.autoreconf_search_path_args) search_path_args = " ".join(self.autoreconf_search_path_args)
search_path_str = "-I m4 {0}".format(search_path_args) search_path_str = f"-I m4 {search_path_args}"
filter_file("-I m4", search_path_str, "autogen.sh") filter_file("-I m4", search_path_str, "autogen.sh")
def autoreconf(self, spec, prefix): def autoreconf(self, spec, prefix):

View file

@ -69,7 +69,7 @@ def edit(self, spec, prefix):
filter_file("g++", spack_cxx, "makefile", string=True) filter_file("g++", spack_cxx, "makefile", string=True)
filter_file( filter_file(
"g++ -I/usr/include/boost", "g++ -I/usr/include/boost",
"{0} -I{1}".format(spack_cxx, self.spec["boost"].prefix.include), f"{spack_cxx} -I{self.spec['boost'].prefix.include}",
"src/subdir.mk", "src/subdir.mk",
string=True, string=True,
) )
@ -101,7 +101,7 @@ def edit(self, spec, prefix):
with working_dir(join_path("auxprogs", "filterBam", "src")): with working_dir(join_path("auxprogs", "filterBam", "src")):
makefile = FileFilter("Makefile") makefile = FileFilter("Makefile")
makefile.filter("BAMTOOLS = .*", "BAMTOOLS = {0}".format(bamtools)) makefile.filter("BAMTOOLS = .*", f"BAMTOOLS = {bamtools}")
makefile.filter("INCLUDES = *", "INCLUDES = -I$(BAMTOOLS)/include/bamtools ") makefile.filter("INCLUDES = *", "INCLUDES = -I$(BAMTOOLS)/include/bamtools ")
if "bamtools@2.5:" in spec: if "bamtools@2.5:" in spec:
makefile.filter( makefile.filter(
@ -113,32 +113,30 @@ def edit(self, spec, prefix):
) )
with working_dir(join_path("auxprogs", "bam2hints")): with working_dir(join_path("auxprogs", "bam2hints")):
makefile = FileFilter("Makefile") makefile = FileFilter("Makefile")
makefile.filter("/usr/include/bamtools", "{0}/include/bamtools".format(bamtools)) makefile.filter("/usr/include/bamtools", f"{bamtools}/include/bamtools")
if "bamtools@2.5:" in spec: if "bamtools@2.5:" in spec:
makefile.filter( makefile.filter(
"LIBS = -lbamtools -lz", "LIBS = -lbamtools -lz", f"LIBS = {bamtools}/lib64/libbamtools.a -lz"
"LIBS = {0}/lib64" "/libbamtools.a -lz".format(bamtools),
) )
if "bamtools@:2.4" in spec: if "bamtools@:2.4" in spec:
makefile.filter( makefile.filter(
"LIBS = -lbamtools -lz", "LIBS = -lbamtools -lz", f"LIBS = {bamtools}/lib/bamtools/libbamtools.a -lz"
"LIBS = {0}/lib/bamtools" "/libbamtools.a -lz".format(bamtools),
) )
if self.version < Version("3.4.0"): if self.version < Version("3.4.0"):
with working_dir(join_path("auxprogs", "bam2wig")): with working_dir(join_path("auxprogs", "bam2wig")):
makefile = FileFilter("Makefile") makefile = FileFilter("Makefile")
# point tools to spack installations # point tools to spack installations
makefile.filter("BCFTOOLS=.*$", "BCFTOOLS={0}/include".format(bcftools)) makefile.filter("BCFTOOLS=.*$", f"BCFTOOLS={bcftools}/include")
makefile.filter("SAMTOOLS=.*$", "SAMTOOLS={0}/include".format(samtools)) makefile.filter("SAMTOOLS=.*$", f"SAMTOOLS={samtools}/include")
makefile.filter("HTSLIB=.*$", "HTSLIB={0}/include".format(htslib)) makefile.filter("HTSLIB=.*$", f"HTSLIB={htslib}/include")
# fix bad linking dirs # fix bad linking dirs
makefile.filter("$(SAMTOOLS)/libbam.a", "$(SAMTOOLS)/../lib/libbam.a", string=True) makefile.filter("$(SAMTOOLS)/libbam.a", "$(SAMTOOLS)/../lib/libbam.a", string=True)
makefile.filter("$(HTSLIB)/libhts.a", "$(HTSLIB)/../lib/libhts.a", string=True) makefile.filter("$(HTSLIB)/libhts.a", "$(HTSLIB)/../lib/libhts.a", string=True)
with working_dir(join_path("auxprogs", "checkTargetSortedness")): with working_dir(join_path("auxprogs", "checkTargetSortedness")):
makefile = FileFilter("Makefile") makefile = FileFilter("Makefile")
makefile.filter("SAMTOOLS.*=.*$", "SAMTOOLS={0}/include".format(samtools)) makefile.filter("SAMTOOLS.*=.*$", f"SAMTOOLS={samtools}/include")
makefile.filter("LIBS=-lbam", "LIBS=$(SAMTOOLS)/../lib/libbam.a", string=True) makefile.filter("LIBS=-lbam", "LIBS=$(SAMTOOLS)/../lib/libbam.a", string=True)
else: else:
mysql = self.spec["mysql-client"].prefix mysql = self.spec["mysql-client"].prefix
@ -147,12 +145,12 @@ def edit(self, spec, prefix):
with working_dir("src"): with working_dir("src"):
makefile = FileFilter("Makefile") makefile = FileFilter("Makefile")
makefile.filter(r"/usr/include/mysql\+\+", "{0}/include/mysql++".format(mysqlpp)) makefile.filter(r"/usr/include/mysql\+\+", f"{mysqlpp}/include/mysql++")
if "^mariadb-c-client" in spec: if "^mariadb-c-client" in spec:
makefile.filter("/usr/include/mysql", "{0}/include/mariadb".format(mysql)) makefile.filter("/usr/include/mysql", f"{mysql}/include/mariadb")
else: else:
makefile.filter("/usr/include/mysql", "{0}/include/mysql".format(mysql)) makefile.filter("/usr/include/mysql", f"{mysql}/include/mysql")
makefile.filter("/usr/include/lpsolve", "{0}/include/lpsolve".format(lpsolve)) makefile.filter("/usr/include/lpsolve", f"{lpsolve}/include/lpsolve")
def install(self, spec, prefix): def install(self, spec, prefix):
install_tree("bin", join_path(self.spec.prefix, "bin")) install_tree("bin", join_path(self.spec.prefix, "bin"))
@ -163,12 +161,12 @@ def install(self, spec, prefix):
def filter_sbang(self): def filter_sbang(self):
with working_dir(self.prefix.scripts): with working_dir(self.prefix.scripts):
pattern = "^#!.*" pattern = "^#!.*"
repl = "#!{0}".format(self.spec["perl"].command.path) repl = f"#!{self.spec['perl'].command.path}"
files = glob.glob("*.pl") files = glob.glob("*.pl")
for file in files: for file in files:
filter_file(pattern, repl, *files, backup=False) filter_file(pattern, repl, *files, backup=False)
repl = "#!{0}".format(self.spec["python"].command.path) repl = f"#!{self.spec['python'].command.path}"
files = glob.glob("*.py") files = glob.glob("*.py")
for file in files: for file in files:
filter_file(pattern, repl, *files, backup=False) filter_file(pattern, repl, *files, backup=False)

View file

@ -20,4 +20,4 @@ def setup_run_environment(self, env):
env.prepend_path("PATH", self.prefix.sbin) env.prepend_path("PATH", self.prefix.sbin)
def install(self, spec, prefix): def install(self, spec, prefix):
make("prefix={0}".format(prefix), "install") make(f"prefix={prefix}", "install")

View file

@ -44,10 +44,10 @@ def edit(self, spec, prefix):
with working_dir(self.build_directory): with working_dir(self.build_directory):
makefile = FileFilter("Makefile") makefile = FileFilter("Makefile")
makefile.filter( makefile.filter(
"BOOST_INCLUDE = .*", "BOOST_INCLUDE = %s" % self.spec["boost"].prefix.include "BOOST_INCLUDE = .*", f"BOOST_INCLUDE = {self.spec['boost'].prefix.include}"
) )
makefile.filter("C_PLATFORM=.*", "C_PLATFORM=-pthread") makefile.filter("C_PLATFORM=.*", "C_PLATFORM=-pthread")
makefile.filter("GPP=.*", "GPP=%s" % spack_cxx) makefile.filter("GPP=.*", f"GPP={spack_cxx}")
def build(self, spec, prefix): def build(self, spec, prefix):
with working_dir(self.build_directory): with working_dir(self.build_directory):

View file

@ -36,7 +36,7 @@ def configure_args(self):
] ]
if "+xml" in spec: if "+xml" in spec:
args.append("--with-libxml2={0}".format(spec["libxml2"].prefix)) args.append(f"--with-libxml2={spec['libxml2'].prefix}")
else: else:
args.append("--without-libxml2") args.append("--without-libxml2")

View file

@ -24,25 +24,25 @@ class Avizo(Package):
version( version(
"2020.1", "2020.1",
sha256="9321aaa276567eebf116e268353c33a4c930d768d22793f921338e1d8cefe991", sha256="9321aaa276567eebf116e268353c33a4c930d768d22793f921338e1d8cefe991",
url="file://{0}/Avizo-20201-Linux64-gcc48.bin".format(os.getcwd()), url=f"file://{os.getcwd()}/Avizo-20201-Linux64-gcc48.bin",
expand=False, expand=False,
) )
version( version(
"2019.4", "2019.4",
sha256="a637720535bcbe254ab56368004a9544c64ec36186373fa24f26cee279685248", sha256="a637720535bcbe254ab56368004a9544c64ec36186373fa24f26cee279685248",
url="file://{0}/Avizo-20194-Linux64-gcc48.bin".format(os.getcwd()), url=f"file://{os.getcwd()}/Avizo-20194-Linux64-gcc48.bin",
expand=False, expand=False,
) )
version( version(
"2019.3", "2019.3",
sha256="be109df81e2f7238f234862367841dae05e76cc62218c1f36b1d9bc9514ce5f7", sha256="be109df81e2f7238f234862367841dae05e76cc62218c1f36b1d9bc9514ce5f7",
url="file://{0}/Avizo-20193-Linux64-gcc48.bin".format(os.getcwd()), url=f"file://{os.getcwd()}/Avizo-20193-Linux64-gcc48.bin",
expand=False, expand=False,
) )
version( version(
"9.7.0", "9.7.0",
sha256="9c9b9e81957387f4218df0c5adbb80717e9ae80ab3ca6ff8da523f7f499dcc5b", sha256="9c9b9e81957387f4218df0c5adbb80717e9ae80ab3ca6ff8da523f7f499dcc5b",
url="file://{0}/Avizo-970-Linux64-gcc44.bin".format(os.getcwd()), url=f"file://{os.getcwd()}/Avizo-970-Linux64-gcc44.bin",
expand=False, expand=False,
) )
@ -67,15 +67,11 @@ def setup_run_environment(self, env):
def install(self, spec, prefix): def install(self, spec, prefix):
ver = self.version.joined ver = self.version.joined
sh = which("sh") sh = which("sh")
sh( sh(f"Avizo-{ver}-Linux64-gcc{self.gcc_ver[self.version.string]}.bin", "--noexec", "--keep")
"Avizo-{0}-Linux64-gcc{1}.bin".format(ver, self.gcc_ver[self.version.string]),
"--noexec",
"--keep",
)
with working_dir("Avizo"): with working_dir("Avizo"):
avizo_tar = tarfile.open( avizo_tar = tarfile.open(
name="Avizo-{0}-Linux64-gcc{1}.tar.bz2".format( name="Avizo-{}-Linux64-gcc{}.tar.bz2".format(
self.version, self.gcc_ver[self.version.string] self.version, self.gcc_ver[self.version.string]
) )
) )