black: reformat entire repository with black

This commit is contained in:
Todd Gamblin
2022-07-30 15:19:18 -07:00
parent 549ba1ed32
commit f52f6e99db
7220 changed files with 183074 additions and 166803 deletions

View File

@@ -10,37 +10,32 @@ class A(AutotoolsPackage):
"""Simple package with one optional dependency"""
homepage = "http://www.example.com"
url = "http://www.example.com/a-1.0.tar.gz"
url = "http://www.example.com/a-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version('2.0', 'abcdef0123456789abcdef0123456789')
version("1.0", "0123456789abcdef0123456789abcdef")
version("2.0", "abcdef0123456789abcdef0123456789")
variant(
'foo', description='',
values=any_combination_of('bar', 'baz', 'fee').with_default('bar'),
"foo",
description="",
values=any_combination_of("bar", "baz", "fee").with_default("bar"),
)
variant(
'foobar',
values=('bar', 'baz', 'fee'),
default='bar',
description='',
multi=False
)
variant("foobar", values=("bar", "baz", "fee"), default="bar", description="", multi=False)
variant('lorem_ipsum', description='', default=False)
variant("lorem_ipsum", description="", default=False)
variant('bvv', default=True, description='The good old BV variant')
variant("bvv", default=True, description="The good old BV variant")
depends_on('b', when='foobar=bar')
depends_on('test-dependency', type='test')
depends_on("b", when="foobar=bar")
depends_on("test-dependency", type="test")
parallel = False
def with_or_without_fee(self, activated):
if not activated:
return '--no-fee'
return '--fee-all-the-time'
return "--no-fee"
return "--fee-all-the-time"
def autoreconf(self, spec, prefix):
pass

View File

@@ -12,12 +12,12 @@ class ArchiveFiles(AutotoolsPackage):
homepage = "http://www.example.com"
url = "http://www.example.com/a-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version('2.0', 'abcdef0123456789abcdef0123456789')
version("1.0", "0123456789abcdef0123456789abcdef")
version("2.0", "abcdef0123456789abcdef0123456789")
@property
def archive_files(self):
return super(ArchiveFiles, self).archive_files + ['../../outside.log']
return super(ArchiveFiles, self).archive_files + ["../../outside.log"]
def autoreconf(self, spec, prefix):
pass
@@ -27,8 +27,8 @@ def configure(self, spec, prefix):
def build(self, spec, prefix):
mkdirp(self.build_directory)
config_log = join_path(self.build_directory, 'config.log')
config_log = join_path(self.build_directory, "config.log")
touch(config_log)
def install(self, spec, prefix):
touch(join_path(prefix, 'deleteme'))
touch(join_path(prefix, "deleteme"))

View File

@@ -7,6 +7,6 @@
class AttributesFooApp(BundlePackage):
version('1.0')
depends_on('bar')
depends_on('baz')
version("1.0")
depends_on("bar")
depends_on("baz")

View File

@@ -7,51 +7,51 @@
class AttributesFoo(BundlePackage):
phases = ['install']
version('1.0')
phases = ["install"]
version("1.0")
provides('bar')
provides('baz')
provides("bar")
provides("baz")
def install(self, spec, prefix):
if 'platform=windows' in spec:
lib_suffix = '.lib'
elif 'platform=darwin' in spec:
lib_suffix = '.dylib'
if "platform=windows" in spec:
lib_suffix = ".lib"
elif "platform=darwin" in spec:
lib_suffix = ".dylib"
else:
lib_suffix = '.so'
lib_suffix = ".so"
mkdirp(prefix.include)
touch(prefix.include.join('foo.h'))
touch(prefix.include.join("foo.h"))
mkdirp(prefix.include.bar)
touch(prefix.include.bar.join('bar.h'))
touch(prefix.include.bar.join("bar.h"))
mkdirp(prefix.lib64)
touch(prefix.lib64.join('libFoo' + lib_suffix))
touch(prefix.lib64.join('libFooBar' + lib_suffix))
touch(prefix.lib64.join("libFoo" + lib_suffix))
touch(prefix.lib64.join("libFooBar" + lib_suffix))
mkdirp(prefix.baz.include.baz)
touch(prefix.baz.include.baz.join('baz.h'))
touch(prefix.baz.include.baz.join("baz.h"))
mkdirp(prefix.baz.lib)
touch(prefix.baz.lib.join('libFooBaz' + lib_suffix))
touch(prefix.baz.lib.join("libFooBaz" + lib_suffix))
# Headers provided by Foo
@property
def headers(self):
return find_headers('foo', root=self.home.include, recursive=False)
return find_headers("foo", root=self.home.include, recursive=False)
# Libraries provided by Foo
@property
def libs(self):
return find_libraries('libFoo', root=self.home, recursive=True)
return find_libraries("libFoo", root=self.home, recursive=True)
# Header provided by the bar virutal package
@property
def bar_headers(self):
return find_headers('bar/bar', root=self.home.include, recursive=False)
return find_headers("bar/bar", root=self.home.include, recursive=False)
# Libary provided by the bar virtual package
@property
def bar_libs(self):
return find_libraries('libFooBar', root=self.home, recursive=True)
return find_libraries("libFooBar", root=self.home, recursive=True)
# The baz virtual package home
@property
@@ -61,9 +61,9 @@ def baz_home(self):
# Header provided by the baz virtual package
@property
def baz_headers(self):
return find_headers('baz/baz', root=self.baz_home.include, recursive=False)
return find_headers("baz/baz", root=self.baz_home.include, recursive=False)
# Library provided by the baz virtual package
@property
def baz_libs(self):
return find_libraries('libFooBaz', root=self.baz_home, recursive=True)
return find_libraries("libFooBaz", root=self.baz_home, recursive=True)

View File

@@ -10,5 +10,5 @@
class AutotoolsConditionalVariantsTest(AutotoolsPackage):
homepage = "https://www.example.com"
has_code = False
version('1.0')
variant('example', default=True, description='nope', when='@2.0:')
version("1.0")
variant("example", default=True, description="nope", when="@2.0:")

View File

@@ -17,15 +17,15 @@ class AutotoolsConfigReplacement(AutotoolsPackage):
has_code = False
version('1.0.0')
variant('patch_config_files', default=False)
variant('gnuconfig', default=False)
version("1.0.0")
variant("patch_config_files", default=False)
variant("gnuconfig", default=False)
depends_on('gnuconfig', type='build', when='+gnuconfig')
depends_on("gnuconfig", type="build", when="+gnuconfig")
@property
def patch_config_files(self):
return self.spec.satisfies('+patch_config_files')
return self.spec.satisfies("+patch_config_files")
def autoreconf(self, spec, prefix):
pass
@@ -37,12 +37,12 @@ def build(self, spec, prefix):
pass
def install(self, spec, prefix):
broken = os.path.join(self.stage.source_path, 'broken')
working = os.path.join(self.stage.source_path, 'working')
broken = os.path.join(self.stage.source_path, "broken")
working = os.path.join(self.stage.source_path, "working")
install_tree(broken, self.prefix.broken)
install_tree(working, self.prefix.working)
@run_before('autoreconf')
@run_before("autoreconf")
def create_the_package_sources(self):
# Creates the following file structure:
# ./broken/config.sub -- not executable
@@ -52,37 +52,37 @@ def create_the_package_sources(self):
# Automatic config helper script substitution should replace the two
# broken scripts with those from the gnuconfig package.
broken = os.path.join(self.stage.source_path, 'broken')
working = os.path.join(self.stage.source_path, 'working')
broken = os.path.join(self.stage.source_path, "broken")
working = os.path.join(self.stage.source_path, "working")
mkdirp(broken)
mkdirp(working)
# a configure script is required
configure_script = join_path(self.stage.source_path, 'configure')
with open(configure_script, 'w') as f:
configure_script = join_path(self.stage.source_path, "configure")
with open(configure_script, "w") as f:
f.write("#!/bin/sh\nexit 0")
os.chmod(configure_script, 0o775)
# broken config.sub (not executable)
broken_config_sub = join_path(broken, 'config.sub')
with open(broken_config_sub, 'w') as f:
broken_config_sub = join_path(broken, "config.sub")
with open(broken_config_sub, "w") as f:
f.write("#!/bin/sh\nexit 0")
# broken config.guess (exectuable but with error return code)
broken_config_guess = join_path(broken, 'config.guess')
with open(broken_config_guess, 'w') as f:
broken_config_guess = join_path(broken, "config.guess")
with open(broken_config_guess, "w") as f:
f.write("#!/bin/sh\nexit 1")
os.chmod(broken_config_guess, 0o775)
# working config.sub
working_config_sub = join_path(working, 'config.sub')
with open(working_config_sub, 'w') as f:
working_config_sub = join_path(working, "config.sub")
with open(working_config_sub, "w") as f:
f.write("#!/bin/sh\nexit 0")
os.chmod(working_config_sub, 0o775)
# working config.guess
working_config_guess = join_path(working, 'config.guess')
with open(working_config_guess, 'w') as f:
working_config_guess = join_path(working, "config.guess")
with open(working_config_guess, "w") as f:
f.write("#!/bin/sh\nexit 0")
os.chmod(working_config_guess, 0o775)

View File

@@ -10,9 +10,9 @@ class B(Package):
"""Simple package with no dependencies"""
homepage = "http://www.example.com"
url = "http://www.example.com/b-1.0.tar.gz"
url = "http://www.example.com/b-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version('0.9', 'abcd456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
version("0.9", "abcd456789abcdef0123456789abcdef")
depends_on('test-dependency', type='test')
depends_on("test-dependency", type="test")

View File

@@ -10,52 +10,56 @@ class Boost(Package):
"""Fake boost package."""
homepage = "http://www.boost.org"
url = "http://downloads.sourceforge.net/project/boost/boost/1.63.0/boost_1_63_0.tar.bz2"
url = "http://downloads.sourceforge.net/project/boost/boost/1.63.0/boost_1_63_0.tar.bz2"
version('1.63.0', '1c837ecd990bb022d07e7aab32b09847')
version("1.63.0", "1c837ecd990bb022d07e7aab32b09847")
default_install_libs = set(['atomic',
'chrono',
'date_time',
'filesystem',
'graph',
'iostreams',
'locale',
'log',
'math',
'program_options',
'random',
'regex',
'serialization',
'signals',
'system',
'test',
'thread',
'timer',
'wave'])
default_install_libs = set(
[
"atomic",
"chrono",
"date_time",
"filesystem",
"graph",
"iostreams",
"locale",
"log",
"math",
"program_options",
"random",
"regex",
"serialization",
"signals",
"system",
"test",
"thread",
"timer",
"wave",
]
)
# mpi/python are not installed by default because they pull in many
# dependencies and/or because there is a great deal of customization
# possible (and it would be difficult to choose sensible defaults)
default_noinstall_libs = set(['mpi', 'python'])
default_noinstall_libs = set(["mpi", "python"])
all_libs = default_install_libs | default_noinstall_libs
for lib in all_libs:
variant(lib, default=(lib not in default_noinstall_libs),
description="Compile with {0} library".format(lib))
variant(
lib,
default=(lib not in default_noinstall_libs),
description="Compile with {0} library".format(lib),
)
variant('debug', default=False,
description='Switch to the debug version of Boost')
variant('shared', default=True,
description="Additionally build shared libraries")
variant('multithreaded', default=True,
description="Build multi-threaded versions of libraries")
variant('singlethreaded', default=False,
description="Build single-threaded versions of libraries")
variant('icu', default=False,
description="Build with Unicode and ICU suport")
variant('graph', default=False,
description="Build the Boost Graph library")
variant('taggedlayout', default=False,
description="Augment library names with build options")
variant("debug", default=False, description="Switch to the debug version of Boost")
variant("shared", default=True, description="Additionally build shared libraries")
variant(
"multithreaded", default=True, description="Build multi-threaded versions of libraries"
)
variant(
"singlethreaded", default=False, description="Build single-threaded versions of libraries"
)
variant("icu", default=False, description="Build with Unicode and ICU suport")
variant("graph", default=False, description="Build the Boost Graph library")
variant("taggedlayout", default=False, description="Augment library names with build options")

View File

@@ -8,17 +8,17 @@
class BothLinkAndBuildDepA(Package):
"""
Structure where c occurs as a build dep down the line and as a direct
link dep. Useful for testing situations where you copy the parent spec
just with link deps, and you want to make sure b is not part of that.
a <--build-- b <-link-- c
a <--link--- c
Structure where c occurs as a build dep down the line and as a direct
link dep. Useful for testing situations where you copy the parent spec
just with link deps, and you want to make sure b is not part of that.
a <--build-- b <-link-- c
a <--link--- c
"""
homepage = "http://www.example.com"
url = "http://www.example.com/1.0.tar.gz"
url = "http://www.example.com/1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
depends_on('both-link-and-build-dep-b', type='build')
depends_on('both-link-and-build-dep-c', type='link')
depends_on("both-link-and-build-dep-b", type="build")
depends_on("both-link-and-build-dep-c", type="link")

View File

@@ -8,16 +8,16 @@
class BothLinkAndBuildDepB(Package):
"""
Structure where c occurs as a build dep down the line and as a direct
link dep. Useful for testing situations where you copy the parent spec
just with link deps, and you want to make sure b is not part of that.
a <--build-- b <-link-- c
a <--link--- c
Structure where c occurs as a build dep down the line and as a direct
link dep. Useful for testing situations where you copy the parent spec
just with link deps, and you want to make sure b is not part of that.
a <--build-- b <-link-- c
a <--link--- c
"""
homepage = "http://www.example.com"
url = "http://www.example.com/1.0.tar.gz"
url = "http://www.example.com/1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
depends_on('both-link-and-build-dep-c', type='link')
depends_on("both-link-and-build-dep-c", type="link")

View File

@@ -8,14 +8,14 @@
class BothLinkAndBuildDepC(Package):
"""
Structure where c occurs as a build dep down the line and as a direct
link dep. Useful for testing situations where you copy the parent spec
just with link deps, and you want to make sure b is not part of that.
a <--build-- b <-link-- c
a <--link--- c
Structure where c occurs as a build dep down the line and as a direct
link dep. Useful for testing situations where you copy the parent spec
just with link deps, and you want to make sure b is not part of that.
a <--build-- b <-link-- c
a <--link--- c
"""
homepage = "http://www.example.com"
url = "http://www.example.com/1.0.tar.gz"
url = "http://www.example.com/1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")

View File

@@ -11,8 +11,8 @@ class Bowtie(Package):
homepage = "http://www.example.org"
url = "http://bowtie-1.2.2.tar.bz2"
version('1.3.0', '1c837ecd990bb022d07e7aab32b09847')
version('1.2.2', '1c837ecd990bb022d07e7aab32b09847')
version('1.2.0', '1c837ecd990bb022d07e7aab32b09847')
version("1.3.0", "1c837ecd990bb022d07e7aab32b09847")
version("1.2.2", "1c837ecd990bb022d07e7aab32b09847")
version("1.2.0", "1c837ecd990bb022d07e7aab32b09847")
conflicts('%gcc@:4.5.0', when='@1.2.2')
conflicts("%gcc@:4.5.0", when="@1.2.2")

View File

@@ -8,10 +8,10 @@
class Brillig(Package):
""" Mock package to test the spack versions command."""
"""Mock package to test the spack versions command."""
homepage = "https://www.example.com"
url = "https://github.com/vvolkl/brillig/archive/v2.0.0.tar.gz"
url = "https://github.com/vvolkl/brillig/archive/v2.0.0.tar.gz"
version('2.0.0', sha256='d4bb8f1737d5a7c0321e1675cceccb59dbcb66a94f3a9dd66a37f58bc6df7f15')
version('1.0.0', sha256='fcef53f45e82b881af9a6f0530b2732cdaf8c5c60e49b27671594ea658bfe315')
version("2.0.0", sha256="d4bb8f1737d5a7c0321e1675cceccb59dbcb66a94f3a9dd66a37f58bc6df7f15")
version("1.0.0", sha256="fcef53f45e82b881af9a6f0530b2732cdaf8c5c60e49b27671594ea658bfe315")

View File

@@ -10,13 +10,14 @@ class BuildError(Package):
"""This package has an install method that fails in a build script."""
homepage = "http://www.example.com/trivial_install"
url = "http://www.unit-test-should-replace-this-url/trivial_install-1.0.tar.gz"
url = "http://www.unit-test-should-replace-this-url/trivial_install-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
def install(self, spec, prefix):
with open('configure', 'w') as f:
f.write("""#!/bin/sh\n
with open("configure", "w") as f:
f.write(
"""#!/bin/sh\n
echo 'checking build system type... x86_64-apple-darwin16.6.0'
echo 'checking host system type... x86_64-apple-darwin16.6.0'
echo 'checking for gcc... /Users/gamblin2/src/spack/lib/spack/env/clang/clang'
@@ -26,5 +27,6 @@ def install(self, spec, prefix):
echo 'configure: error: in /path/to/some/file:'
echo 'configure: error: cannot run C compiled programs.'
exit 1
""")
"""
)
configure()

View File

@@ -10,13 +10,14 @@ class BuildWarnings(Package):
"""This package's install fails but only emits warnings."""
homepage = "http://www.example.com/trivial_install"
url = "http://www.unit-test-should-replace-this-url/trivial_install-1.0.tar.gz"
url = "http://www.unit-test-should-replace-this-url/trivial_install-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
def install(self, spec, prefix):
with open('configure', 'w') as f:
f.write("""#!/bin/sh\n
with open("configure", "w") as f:
f.write(
"""#!/bin/sh\n
echo 'checking for gcc... /Users/gamblin2/src/spack/lib/spack/env/clang/clang'
echo 'checking whether the C compiler works... yes'
echo 'checking for C compiler default output file name... a.out'
@@ -24,5 +25,6 @@ def install(self, spec, prefix):
echo 'checking for suffix of executables...'
echo 'foo.c:89: warning: some weird warning!'
exit 1
""")
"""
)
configure()

View File

@@ -10,6 +10,6 @@ class C(Package):
"""Simple package with no dependencies"""
homepage = "http://www.example.com"
url = "http://www.example.com/c-1.0.tar.gz"
url = "http://www.example.com/c-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")

View File

@@ -8,11 +8,11 @@
class Callpath(Package):
homepage = "https://github.com/tgamblin/callpath"
url = "http://github.com/tgamblin/callpath-1.0.tar.gz"
url = "http://github.com/tgamblin/callpath-1.0.tar.gz"
version(0.8, '0123456789abcdef0123456789abcdef')
version(0.9, '0123456789abcdef0123456789abcdef')
version(1.0, '0123456789abcdef0123456789abcdef')
version(0.8, "0123456789abcdef0123456789abcdef")
version(0.9, "0123456789abcdef0123456789abcdef")
version(1.0, "0123456789abcdef0123456789abcdef")
depends_on("dyninst")
depends_on("mpi")
@@ -23,4 +23,4 @@ def install(self, spec, prefix):
make("install")
def setup_run_environment(self, env):
env.set('FOOBAR', self.name)
env.set("FOOBAR", self.name)

View File

@@ -10,13 +10,13 @@ class Canfail(Package):
"""Package which fails install unless a special attribute is set"""
homepage = "http://www.example.com"
url = "http://www.example.com/a-1.0.tar.gz"
url = "http://www.example.com/a-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
succeed = False
def install(self, spec, prefix):
if not self.succeed:
raise InstallError("'succeed' was false")
touch(join_path(prefix, 'an_installation_file'))
touch(join_path(prefix, "an_installation_file"))

View File

@@ -16,18 +16,19 @@ def check(condition, msg):
class CmakeClient(CMakePackage):
"""A dumy package that uses cmake."""
homepage = 'https://www.example.com'
url = 'https://www.example.com/cmake-client-1.0.tar.gz'
version('1.0', '4cb3ff35b2472aae70f542116d616e63')
homepage = "https://www.example.com"
url = "https://www.example.com/cmake-client-1.0.tar.gz"
version("1.0", "4cb3ff35b2472aae70f542116d616e63")
variant(
'multi', description='',
values=any_combination_of('up', 'right', 'back').with_default('up')
"multi",
description="",
values=any_combination_of("up", "right", "back").with_default("up"),
)
variant('single', description='', default='blue',
values=('blue', 'red', 'green'), multi=False)
variant('truthy', description='', default=True)
variant("single", description="", default="blue", values=("blue", "red", "green"), multi=False)
variant("truthy", description="", default=True)
callback_counter = 0
@@ -36,47 +37,56 @@ class CmakeClient(CMakePackage):
check_this_is_none = None
did_something = False
@run_after('cmake')
@run_before('cmake', 'build', 'install')
@run_after("cmake")
@run_before("cmake", "build", "install")
def increment(self):
self.callback_counter += 1
@run_after('cmake')
@run_after("cmake")
@on_package_attributes(run_this=True, check_this_is_none=None)
def flip(self):
self.flipped = True
@run_after('cmake')
@run_after("cmake")
@on_package_attributes(does_not_exist=None)
def do_not_execute(self):
self.did_something = True
def setup_build_environment(self, spack_env):
spack_cc # Ensure spack module-scope variable is avaiabl
check(from_cmake == "from_cmake",
"setup_build_environment couldn't read global set by cmake.")
spack_cc # Ensure spack module-scope variable is avaiabl
check(
from_cmake == "from_cmake",
"setup_build_environment couldn't read global set by cmake.",
)
check(self.spec['cmake'].link_arg == "test link arg",
"link arg on dependency spec not readable from "
"setup_build_environment.")
check(
self.spec["cmake"].link_arg == "test link arg",
"link arg on dependency spec not readable from " "setup_build_environment.",
)
def setup_dependent_build_environment(self, env, dependent_spec):
spack_cc # Ensure spack module-scope variable is avaiable
check(from_cmake == "from_cmake",
"setup_dependent_build_environment couldn't read global set by cmake.")
spack_cc # Ensure spack module-scope variable is avaiable
check(
from_cmake == "from_cmake",
"setup_dependent_build_environment couldn't read global set by cmake.",
)
check(self.spec['cmake'].link_arg == "test link arg",
"link arg on dependency spec not readable from "
"setup_dependent_build_environment.")
check(
self.spec["cmake"].link_arg == "test link arg",
"link arg on dependency spec not readable from " "setup_dependent_build_environment.",
)
def setup_dependent_package(self, module, dspec):
spack_cc # Ensure spack module-scope variable is avaiable
check(from_cmake == "from_cmake",
"setup_dependent_package couldn't read global set by cmake.")
spack_cc # Ensure spack module-scope variable is avaiable
check(
from_cmake == "from_cmake",
"setup_dependent_package couldn't read global set by cmake.",
)
check(self.spec['cmake'].link_arg == "test link arg",
"link arg on dependency spec not readable from "
"setup_dependent_package.")
check(
self.spec["cmake"].link_arg == "test link arg",
"link arg on dependency spec not readable from " "setup_dependent_package.",
)
def cmake(self, spec, prefix):
assert self.callback_counter == 1
@@ -93,17 +103,20 @@ def install(self, spec, prefix):
check(cmake is not None, "No cmake was in environment!")
# check that which('cmake') returns the right one.
cmake = which('cmake')
cmake = which("cmake")
print(cmake)
print(cmake.exe)
check(cmake.exe[0].startswith(spec['cmake'].prefix.bin),
"Wrong cmake was in environment: %s" % cmake)
check(
cmake.exe[0].startswith(spec["cmake"].prefix.bin),
"Wrong cmake was in environment: %s" % cmake,
)
check(from_cmake == "from_cmake",
"Couldn't read global set by cmake.")
check(from_cmake == "from_cmake", "Couldn't read global set by cmake.")
check(os.environ['from_cmake'] == 'from_cmake',
"Couldn't read env var set in envieonmnt by dependency")
check(
os.environ["from_cmake"] == "from_cmake",
"Couldn't read env var set in envieonmnt by dependency",
)
mkdirp(prefix.bin)
touch(join_path(prefix.bin, 'dummy'))
touch(join_path(prefix.bin, "dummy"))

View File

@@ -8,5 +8,5 @@
class CmakeConditionalVariantsTest(CMakePackage):
homepage = "https://dev.null"
version('1.0')
variant('example', default=True, description='nope', when='@2.0:')
version("1.0")
variant("example", default=True, description="nope", when="@2.0:")

View File

@@ -8,7 +8,7 @@
from spack.package import *
is_windows = sys.platform == 'win32'
is_windows = sys.platform == "win32"
def check(condition, msg):
@@ -19,22 +19,26 @@ def check(condition, msg):
class Cmake(Package):
"""A dumy package for the cmake build system."""
homepage = 'https://www.cmake.org'
url = 'https://cmake.org/files/v3.4/cmake-3.4.3.tar.gz'
version('3.4.3', '4cb3ff35b2472aae70f542116d616e63',
url='https://cmake.org/files/v3.4/cmake-3.4.3.tar.gz')
homepage = "https://www.cmake.org"
url = "https://cmake.org/files/v3.4/cmake-3.4.3.tar.gz"
version(
"3.4.3",
"4cb3ff35b2472aae70f542116d616e63",
url="https://cmake.org/files/v3.4/cmake-3.4.3.tar.gz",
)
def setup_build_environment(self, env):
spack_cc # Ensure spack module-scope variable is avaiable
env.set('for_install', 'for_install')
spack_cc # Ensure spack module-scope variable is avaiable
env.set("for_install", "for_install")
def setup_dependent_build_environment(self, env, dependent_spec):
spack_cc # Ensure spack module-scope variable is avaiable
env.set('from_cmake', 'from_cmake')
spack_cc # Ensure spack module-scope variable is avaiable
env.set("from_cmake", "from_cmake")
def setup_dependent_package(self, module, dspec):
spack_cc # Ensure spack module-scope variable is avaiable
spack_cc # Ensure spack module-scope variable is avaiable
self.spec.from_cmake = "from_cmake"
module.from_cmake = "from_cmake"
@@ -44,9 +48,11 @@ def setup_dependent_package(self, module, dspec):
def install(self, spec, prefix):
mkdirp(prefix.bin)
check(os.environ['for_install'] == 'for_install',
"Couldn't read env var set in compile envieonmnt")
cmake_exe_ext = ".exe" if is_windows else ''
cmake_exe = join_path(prefix.bin, 'cmake{}'.format(cmake_exe_ext))
check(
os.environ["for_install"] == "for_install",
"Couldn't read env var set in compile envieonmnt",
)
cmake_exe_ext = ".exe" if is_windows else ""
cmake_exe = join_path(prefix.bin, "cmake{}".format(cmake_exe_ext))
touch(cmake_exe)
set_executable(cmake_exe)

View File

@@ -9,11 +9,12 @@ class ConditionalConstrainedDependencies(Package):
"""Package that has a variant which adds a dependency forced to
use non default values.
"""
homepage = "https://dev.null"
version('1.0')
version("1.0")
# This variant is on by default and attaches a dependency
# with a lot of variants set at their non-default values
variant('dep', default=True, description='nope')
depends_on('dep-with-variants+foo+bar+baz', when='+dep')
variant("dep", default=True, description="nope")
depends_on("dep-with-variants+foo+bar+baz", when="+dep")

View File

@@ -9,13 +9,14 @@ class ConditionalProvider(Package):
"""Mimic the real netlib-lapack, that may be built on top of an
optimized blas.
"""
homepage = "https://dev.null"
version('1.0')
version("1.0")
variant('disable-v1', default=False, description='nope')
variant("disable-v1", default=False, description="nope")
provides('v2')
provides('v1', when='~disable-v1')
provides("v2")
provides("v1", when="~disable-v1")
depends_on('v1', when='+disable-v1')
depends_on("v1", when="+disable-v1")

View File

@@ -7,31 +7,34 @@
class ConditionalValuesInVariant(Package):
"""Package with conditional possible values in a variant"""
homepage = "https://dev.null"
version('1.73.0')
version('1.72.0')
version('1.62.0')
version('1.60.0')
version('1.50.0')
version("1.73.0")
version("1.72.0")
version("1.62.0")
version("1.60.0")
version("1.50.0")
variant(
'cxxstd', default='98',
"cxxstd",
default="98",
values=(
'98', '11', '14',
"98",
"11",
"14",
# C++17 is not supported by Boost < 1.63.0.
conditional('17', when='@1.63.0:'),
conditional("17", when="@1.63.0:"),
# C++20/2a is not support by Boost < 1.73.0
conditional('2a', when='@1.73.0:')
conditional("2a", when="@1.73.0:"),
),
multi=False,
description='Use the specified C++ standard when building.',
when='@1.60.0:'
description="Use the specified C++ standard when building.",
when="@1.60.0:",
)
variant(
'staging', values=any_combination_of(
conditional('flexpath', 'dataspaces', when='@1.73.0:')
),
description='Enable dataspaces and/or flexpath staging transports'
"staging",
values=any_combination_of(conditional("flexpath", "dataspaces", when="@1.73.0:")),
description="Enable dataspaces and/or flexpath staging transports",
)

View File

@@ -8,20 +8,29 @@
class ConditionalVariantPkg(Package):
"""This package is used to test conditional variants."""
homepage = "http://www.example.com/conditional-variant-pkg"
url = "http://www.unit-test-should-replace-this-url/conditional-variant-1.0.tar.gz"
url = "http://www.unit-test-should-replace-this-url/conditional-variant-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version('2.0', 'abcdef0123456789abcdef0123456789')
version("1.0", "0123456789abcdef0123456789abcdef")
version("2.0", "abcdef0123456789abcdef0123456789")
variant('version_based', default=True, when='@2.0:',
description="Check that version constraints work")
variant(
"version_based",
default=True,
when="@2.0:",
description="Check that version constraints work",
)
variant('variant_based', default=False, when='+version_based',
description="Check that variants can depend on variants")
variant(
"variant_based",
default=False,
when="+version_based",
description="Check that variants can depend on variants",
)
variant('two_whens', default=False, when='@1.0')
variant('two_whens', default=False, when='+variant_based')
variant("two_whens", default=False, when="@1.0")
variant("two_whens", default=False, when="+variant_based")
def install(self, spec, prefix):
assert False

View File

@@ -7,12 +7,13 @@
class ConditionalVirtualDependency(Package):
"""Brings in a virtual dependency if certain conditions are met."""
homepage = "https://dev.null"
version('1.0')
version("1.0")
variant('stuff', default=True, description='nope')
variant('mpi', default=False, description='nope')
variant("stuff", default=True, description="nope")
variant("mpi", default=False, description="nope")
depends_on('stuff', when='+stuff')
depends_on('mpi', when='+mpi')
depends_on("stuff", when="+stuff")
depends_on("mpi", when="+mpi")

View File

@@ -14,6 +14,6 @@ class ConditionallyPatchDependency(Package):
homepage = "http://www.example.com"
url = "http://www.example.com/patch-a-dependency-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
variant('jasper', default=False)
depends_on('libelf@0.8.10', patches=[patch('uuid.patch')], when='+jasper')
version("1.0", "0123456789abcdef0123456789abcdef")
variant("jasper", default=False)
depends_on("libelf@0.8.10", patches=[patch("uuid.patch")], when="+jasper")

View File

@@ -8,12 +8,12 @@
class ConfigureWarning(AutotoolsPackage):
"""This package prints output that looks like an error during configure, but
it actually installs successfully."""
it actually installs successfully."""
homepage = "http://www.example.com"
url = "http://www.example.com/configure-warning-1.0.tar.gz"
url = "http://www.example.com/configure-warning-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
parallel = False
@@ -21,7 +21,7 @@ def autoreconf(self, spec, prefix):
pass
def configure(self, spec, prefix):
print('foo: No such file or directory')
print("foo: No such file or directory")
return 0
def build(self, spec, prefix):

View File

@@ -7,16 +7,16 @@
class ConflictParent(Package):
homepage = 'https://github.com/tgamblin/callpath'
url = 'http://github.com/tgamblin/callpath-1.0.tar.gz'
homepage = "https://github.com/tgamblin/callpath"
url = "http://github.com/tgamblin/callpath-1.0.tar.gz"
version(0.8, '0123456789abcdef0123456789abcdef')
version(0.9, '0123456789abcdef0123456789abcdef')
version(1.0, '0123456789abcdef0123456789abcdef')
version(0.8, "0123456789abcdef0123456789abcdef")
version(0.9, "0123456789abcdef0123456789abcdef")
version(1.0, "0123456789abcdef0123456789abcdef")
depends_on('conflict')
depends_on("conflict")
conflicts('^conflict~foo', when='@0.9')
conflicts("^conflict~foo", when="@0.9")
def install(self, spec, prefix):
configure("--prefix=%s" % prefix)
@@ -24,4 +24,4 @@ def install(self, spec, prefix):
make("install")
def setup_run_environment(self, env):
env.set('FOOBAR', self.name)
env.set("FOOBAR", self.name)

View File

@@ -7,16 +7,16 @@
class Conflict(Package):
homepage = 'https://github.com/tgamblin/callpath'
url = 'http://github.com/tgamblin/callpath-1.0.tar.gz'
homepage = "https://github.com/tgamblin/callpath"
url = "http://github.com/tgamblin/callpath-1.0.tar.gz"
version(0.8, '0123456789abcdef0123456789abcdef')
version(0.9, '0123456789abcdef0123456789abcdef')
version(1.0, '0123456789abcdef0123456789abcdef')
version(0.8, "0123456789abcdef0123456789abcdef")
version(0.9, "0123456789abcdef0123456789abcdef")
version(1.0, "0123456789abcdef0123456789abcdef")
variant('foo', default=True, description='')
variant("foo", default=True, description="")
conflicts('%clang', when='+foo')
conflicts("%clang", when="+foo")
def install(self, spec, prefix):
configure("--prefix=%s" % prefix)
@@ -24,4 +24,4 @@ def install(self, spec, prefix):
make("install")
def setup_run_environment(self, env):
env.set('FOOBAR', self.name)
env.set("FOOBAR", self.name)

View File

@@ -8,12 +8,12 @@
class ConflictingDependent(Package):
"""By itself this package does not have conflicts, but it is used to
ensure that if a user tries to build with an installed instance
of dependency-install@2 that there is a failure."""
ensure that if a user tries to build with an installed instance
of dependency-install@2 that there is a failure."""
homepage = "http://www.example.com"
url = "http://www.example.com/a-1.0.tar.gz"
url = "http://www.example.com/a-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
depends_on('dependency-install@:1.0')
depends_on("dependency-install@:1.0")

View File

@@ -15,12 +15,12 @@ class Corge(Package):
homepage = "https://www.example.com"
has_code = False
version('3.0.0')
version("3.0.0")
depends_on('quux')
depends_on("quux")
def install(self, spec, prefix):
corge_cc = '''#include <iostream>
corge_cc = """#include <iostream>
#include <stdexcept>
#include "corge.h"
#include "corge_version.h"
@@ -56,8 +56,8 @@ def install(self, spec, prefix):
return corge_version;
}
'''
corge_h = '''#ifndef CORGE_H_
"""
corge_h = """#ifndef CORGE_H_
class Corge
{
@@ -72,12 +72,12 @@ class Corge
};
#endif // CORGE_H_
'''
corge_version_h = '''
"""
corge_version_h = """
const int corge_version_major = %s;
const int corge_version_minor = %s;
'''
corgegator_cc = '''
"""
corgegator_cc = """
#include <iostream>
#include "corge.h"
@@ -100,81 +100,120 @@ class Corge
std::cout << "done."<<std::endl;
return 0;
}
'''
mkdirp('%s/corge' % prefix.include)
mkdirp('%s/corge' % self.stage.source_path)
with open('%s/corge_version.h' % self.stage.source_path, 'w') as f:
f.write(corge_version_h % (self.version[0], self.version[1:]))
with open('%s/corge/corge.cc' % self.stage.source_path, 'w') as f:
"""
mkdirp("%s/corge" % prefix.include)
mkdirp("%s/corge" % self.stage.source_path)
with open("%s/corge_version.h" % self.stage.source_path, "w") as f:
f.write(corge_version_h % (self.version[0], self.version[1:]))
with open("%s/corge/corge.cc" % self.stage.source_path, "w") as f:
f.write(corge_cc % prefix.config)
with open('%s/corge/corge.h' % self.stage.source_path, 'w') as f:
with open("%s/corge/corge.h" % self.stage.source_path, "w") as f:
f.write(corge_h)
with open('%s/corge/corgegator.cc' % self.stage.source_path, 'w') as f:
with open("%s/corge/corgegator.cc" % self.stage.source_path, "w") as f:
f.write(corgegator_cc)
gpp = which('/usr/bin/g++')
if sys.platform == 'darwin':
gpp = which('/usr/bin/clang++')
gpp('-Dcorge_EXPORTS',
'-I%s' % self.stage.source_path,
'-I%s' % spec['quux'].prefix.include,
'-I%s' % spec['garply'].prefix.include,
'-O2', '-g', '-DNDEBUG', '-fPIC',
'-o', 'corge.cc.o',
'-c', 'corge/corge.cc')
gpp('-Dcorge_EXPORTS',
'-I%s' % self.stage.source_path,
'-I%s' % spec['quux'].prefix.include,
'-I%s' % spec['garply'].prefix.include,
'-O2', '-g', '-DNDEBUG', '-fPIC',
'-o', 'corgegator.cc.o',
'-c', 'corge/corgegator.cc')
if sys.platform == 'darwin':
gpp('-fPIC', '-O2', '-g', '-DNDEBUG', '-dynamiclib',
'-install_name', '@rpath/libcorge.dylib',
'-o', 'libcorge.dylib', 'corge.cc.o',
'-Wl,-rpath,%s' % spec['quux'].prefix.lib64,
'-Wl,-rpath,%s' % spec['garply'].prefix.lib64,
'%s/libquux.dylib' % spec['quux'].prefix.lib64,
'%s/libgarply.dylib' % spec['garply'].prefix.lib64)
gpp('-O2', '-g', '-DNDEBUG', '-rdynamic',
'corgegator.cc.o', '-o', 'corgegator',
'-Wl,-rpath,%s' % prefix.lib64,
'-Wl,-rpath,%s' % spec['quux'].prefix.lib64,
'-Wl,-rpath,%s' % spec['garply'].prefix.lib64,
'libcorge.dylib',
'%s/libquux.dylib.3.0' % spec['quux'].prefix.lib64,
'%s/libgarply.dylib.3.0' % spec['garply'].prefix.lib64)
gpp = which("/usr/bin/g++")
if sys.platform == "darwin":
gpp = which("/usr/bin/clang++")
gpp(
"-Dcorge_EXPORTS",
"-I%s" % self.stage.source_path,
"-I%s" % spec["quux"].prefix.include,
"-I%s" % spec["garply"].prefix.include,
"-O2",
"-g",
"-DNDEBUG",
"-fPIC",
"-o",
"corge.cc.o",
"-c",
"corge/corge.cc",
)
gpp(
"-Dcorge_EXPORTS",
"-I%s" % self.stage.source_path,
"-I%s" % spec["quux"].prefix.include,
"-I%s" % spec["garply"].prefix.include,
"-O2",
"-g",
"-DNDEBUG",
"-fPIC",
"-o",
"corgegator.cc.o",
"-c",
"corge/corgegator.cc",
)
if sys.platform == "darwin":
gpp(
"-fPIC",
"-O2",
"-g",
"-DNDEBUG",
"-dynamiclib",
"-install_name",
"@rpath/libcorge.dylib",
"-o",
"libcorge.dylib",
"corge.cc.o",
"-Wl,-rpath,%s" % spec["quux"].prefix.lib64,
"-Wl,-rpath,%s" % spec["garply"].prefix.lib64,
"%s/libquux.dylib" % spec["quux"].prefix.lib64,
"%s/libgarply.dylib" % spec["garply"].prefix.lib64,
)
gpp(
"-O2",
"-g",
"-DNDEBUG",
"-rdynamic",
"corgegator.cc.o",
"-o",
"corgegator",
"-Wl,-rpath,%s" % prefix.lib64,
"-Wl,-rpath,%s" % spec["quux"].prefix.lib64,
"-Wl,-rpath,%s" % spec["garply"].prefix.lib64,
"libcorge.dylib",
"%s/libquux.dylib.3.0" % spec["quux"].prefix.lib64,
"%s/libgarply.dylib.3.0" % spec["garply"].prefix.lib64,
)
mkdirp(prefix.lib64)
copy('libcorge.dylib', '%s/libcorge.dylib' % prefix.lib64)
os.link('%s/libcorge.dylib' % prefix.lib64,
'%s/libcorge.dylib.3.0' % prefix.lib64)
copy("libcorge.dylib", "%s/libcorge.dylib" % prefix.lib64)
os.link("%s/libcorge.dylib" % prefix.lib64, "%s/libcorge.dylib.3.0" % prefix.lib64)
else:
gpp('-fPIC', '-O2', '-g', '-DNDEBUG', '-shared',
'-Wl,-soname,libcorge.so', '-o', 'libcorge.so', 'corge.cc.o',
'-Wl,-rpath,%s:%s::::' %
(spec['quux'].prefix.lib64, spec['garply'].prefix.lib64),
'%s/libquux.so' % spec['quux'].prefix.lib64,
'%s/libgarply.so' % spec['garply'].prefix.lib64)
gpp('-O2', '-g', '-DNDEBUG', '-rdynamic',
'corgegator.cc.o', '-o', 'corgegator',
'-Wl,-rpath,%s' % prefix.lib64,
'-Wl,-rpath,%s' % spec['quux'].prefix.lib64,
'-Wl,-rpath,%s' % spec['garply'].prefix.lib64,
'libcorge.so',
'%s/libquux.so.3.0' % spec['quux'].prefix.lib64,
'%s/libgarply.so.3.0' % spec['garply'].prefix.lib64)
gpp(
"-fPIC",
"-O2",
"-g",
"-DNDEBUG",
"-shared",
"-Wl,-soname,libcorge.so",
"-o",
"libcorge.so",
"corge.cc.o",
"-Wl,-rpath,%s:%s::::" % (spec["quux"].prefix.lib64, spec["garply"].prefix.lib64),
"%s/libquux.so" % spec["quux"].prefix.lib64,
"%s/libgarply.so" % spec["garply"].prefix.lib64,
)
gpp(
"-O2",
"-g",
"-DNDEBUG",
"-rdynamic",
"corgegator.cc.o",
"-o",
"corgegator",
"-Wl,-rpath,%s" % prefix.lib64,
"-Wl,-rpath,%s" % spec["quux"].prefix.lib64,
"-Wl,-rpath,%s" % spec["garply"].prefix.lib64,
"libcorge.so",
"%s/libquux.so.3.0" % spec["quux"].prefix.lib64,
"%s/libgarply.so.3.0" % spec["garply"].prefix.lib64,
)
mkdirp(prefix.lib64)
copy('libcorge.so', '%s/libcorge.so' % prefix.lib64)
os.link('%s/libcorge.so' % prefix.lib64,
'%s/libcorge.so.3.0' % prefix.lib64)
copy('corgegator', '%s/corgegator' % prefix.lib64)
copy('%s/corge/corge.h' % self.stage.source_path,
'%s/corge/corge.h' % prefix.include)
copy("libcorge.so", "%s/libcorge.so" % prefix.lib64)
os.link("%s/libcorge.so" % prefix.lib64, "%s/libcorge.so.3.0" % prefix.lib64)
copy("corgegator", "%s/corgegator" % prefix.lib64)
copy("%s/corge/corge.h" % self.stage.source_path, "%s/corge/corge.h" % prefix.include)
mkdirp(prefix.bin)
copy('corge_version.h', '%s/corge_version.h' % prefix.bin)
os.symlink('%s/corgegator' % prefix.lib64,
'%s/corgegator' % prefix.bin)
os.symlink('%s/quuxifier' % spec['quux'].prefix.lib64,
'%s/quuxifier' % prefix.bin)
os.symlink('%s/garplinator' % spec['garply'].prefix.lib64,
'%s/garplinator' % prefix.bin)
copy("corge_version.h", "%s/corge_version.h" % prefix.bin)
os.symlink("%s/corgegator" % prefix.lib64, "%s/corgegator" % prefix.bin)
os.symlink("%s/quuxifier" % spec["quux"].prefix.lib64, "%s/quuxifier" % prefix.bin)
os.symlink("%s/garplinator" % spec["garply"].prefix.lib64, "%s/garplinator" % prefix.bin)

View File

@@ -10,10 +10,11 @@ class CumulativeVrangeBottom(Package):
form X.Y:X works and allows for the selection of all the
versions >= X.Y with major == X
"""
homepage = 'https://www.example.org'
url = 'https://example.org/files/v3.4/cmake-3.4.3.tar.gz'
version('3.0', '4cb3ff35b2472aae70f542116d616e63')
version('2.2', '4cb3ff35b2472aae70f542116d616e63')
version('2.1', '4cb3ff35b2472aae70f542116d616e63')
version('2.0', '4cb3ff35b2472aae70f542116d616e63')
homepage = "https://www.example.org"
url = "https://example.org/files/v3.4/cmake-3.4.3.tar.gz"
version("3.0", "4cb3ff35b2472aae70f542116d616e63")
version("2.2", "4cb3ff35b2472aae70f542116d616e63")
version("2.1", "4cb3ff35b2472aae70f542116d616e63")
version("2.0", "4cb3ff35b2472aae70f542116d616e63")

View File

@@ -10,9 +10,10 @@ class CumulativeVrangeMiddle(Package):
form X.Y:X works and allows for the selection of all the
versions >= X.Y with major == X
"""
homepage = 'https://www.example.org'
url = 'https://example.org/files/v3.4/cmake-3.4.3.tar.gz'
version('1.0', '4cb3ff35b2472aae70f542116d616e63')
homepage = "https://www.example.org"
url = "https://example.org/files/v3.4/cmake-3.4.3.tar.gz"
depends_on('cumulative-vrange-bottom@2.1:')
version("1.0", "4cb3ff35b2472aae70f542116d616e63")
depends_on("cumulative-vrange-bottom@2.1:")

View File

@@ -10,10 +10,11 @@ class CumulativeVrangeRoot(Package):
form X.Y:X works and allows for the selection of all the
versions >= X.Y with major == X
"""
homepage = 'https://www.example.org'
url = 'https://example.org/files/v3.4/cmake-3.4.3.tar.gz'
version('1.0', '4cb3ff35b2472aae70f542116d616e63')
homepage = "https://www.example.org"
url = "https://example.org/files/v3.4/cmake-3.4.3.tar.gz"
depends_on('cumulative-vrange-middle')
depends_on('cumulative-vrange-bottom@:2')
version("1.0", "4cb3ff35b2472aae70f542116d616e63")
depends_on("cumulative-vrange-middle")
depends_on("cumulative-vrange-bottom@:2")

View File

@@ -8,6 +8,7 @@
class CvsTest(Package):
"""Mock package that uses cvs for fetching."""
homepage = "http://www.cvs-fetch-example.com"
version('cvs', cvs='to-be-filled-in-by-test')
version("cvs", cvs="to-be-filled-in-by-test")

View File

@@ -21,7 +21,7 @@ class DepDiamondPatchMid1(Package):
homepage = "http://www.example.com"
url = "http://www.example.com/patch-a-dependency-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
# single patch file in repo
depends_on('patch', patches='mid1.patch')
depends_on("patch", patches="mid1.patch")

View File

@@ -21,10 +21,15 @@ class DepDiamondPatchMid2(Package):
homepage = "http://www.example.com"
url = "http://www.example.com/patch-a-dependency-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
# single patch file in repo
depends_on('patch', patches=[
patch('http://example.com/urlpatch.patch',
sha256='mid21234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234'),
])
depends_on(
"patch",
patches=[
patch(
"http://example.com/urlpatch.patch",
sha256="mid21234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234",
),
],
)

View File

@@ -21,9 +21,9 @@ class DepDiamondPatchTop(Package):
homepage = "http://www.example.com"
url = "http://www.example.com/patch-a-dependency-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
# single patch file in repo
depends_on('patch', patches='top.patch')
depends_on('dep-diamond-patch-mid1')
depends_on('dep-diamond-patch-mid2')
depends_on("patch", patches="top.patch")
depends_on("dep-diamond-patch-mid1")
depends_on("dep-diamond-patch-mid2")

View File

@@ -7,8 +7,9 @@
class DepWithVariantsIfDevelopRoot(Package):
"""Package that adds a dependency with many variants only at @develop"""
homepage = "https://dev.null"
version('1.0')
version("1.0")
depends_on('dep-with-variants-if-develop')
depends_on("dep-with-variants-if-develop")

View File

@@ -7,9 +7,10 @@
class DepWithVariantsIfDevelop(Package):
"""Package that adds a dependency with many variants only at @develop"""
homepage = "https://dev.null"
version('develop')
version('1.0')
version("develop")
version("1.0")
depends_on('dep-with-variants', when='@develop')
depends_on("dep-with-variants", when="@develop")

View File

@@ -9,10 +9,11 @@ class DepWithVariants(Package):
"""Package that has a variant which adds a dependency forced to
use non default values.
"""
homepage = "https://dev.null"
version('1.0')
version("1.0")
variant('foo', default=False, description='nope')
variant('bar', default=False, description='nope')
variant('baz', default=False, description='nope')
variant("foo", default=False, description="nope")
variant("bar", default=False, description="nope")
variant("baz", default=False, description="nope")

View File

@@ -10,11 +10,11 @@ class Depb(AutotoolsPackage):
"""Simple package with one build dependency"""
homepage = "http://www.example.com"
url = "http://www.example.com/a-1.0.tar.gz"
url = "http://www.example.com/a-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
depends_on('b')
depends_on("b")
def install(self, spec, prefix):
# sanity_check_prefix requires something in the install directory

View File

@@ -10,10 +10,10 @@ class DependencyInstall(Package):
"""Dependency which has a working install method"""
homepage = "http://www.example.com"
url = "http://www.example.com/a-1.0.tar.gz"
url = "http://www.example.com/a-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version('2.0', 'abcdef0123456789abcdef0123456789')
version("1.0", "0123456789abcdef0123456789abcdef")
version("2.0", "abcdef0123456789abcdef0123456789")
def install(self, spec, prefix):
touch(join_path(prefix, 'an_installation_file'))
touch(join_path(prefix, "an_installation_file"))

View File

@@ -10,13 +10,13 @@ class DependentInstall(Package):
"""Dependent which has a working install method"""
homepage = "http://www.example.com"
url = "http://www.example.com/a-1.0.tar.gz"
url = "http://www.example.com/a-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version('2.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
version("2.0", "0123456789abcdef0123456789abcdef")
depends_on('dependency-install@2.0', when='@2.0')
depends_on('dependency-install@1.0', when='@1.0')
depends_on("dependency-install@2.0", when="@2.0")
depends_on("dependency-install@1.0", when="@1.0")
def install(self, spec, prefix):
touch(join_path(prefix, 'an_installation_file'))
touch(join_path(prefix, "an_installation_file"))

View File

@@ -11,10 +11,10 @@ class DependentOfDevBuild(Package):
homepage = "example.com"
url = "fake.com"
version('0.0.0', sha256='0123456789abcdef0123456789abcdef')
version("0.0.0", sha256="0123456789abcdef0123456789abcdef")
depends_on('dev-build-test-install')
depends_on("dev-build-test-install")
def install(self, spec, prefix):
with open(prefix.filename, 'w') as f:
with open(prefix.filename, "w") as f:
f.write("This file is installed")

View File

@@ -8,9 +8,9 @@
class DependsOnOpenmpi(Package):
"""For testing concretization of packages that use
`spack external read-cray-manifest`"""
`spack external read-cray-manifest`"""
depends_on('openmpi')
depends_on("openmpi")
version('1.0')
version('0.9')
version("1.0")
version("0.9")

View File

@@ -8,15 +8,15 @@
class DependsOnRunEnv(Package):
"""This package has a runtime dependency on another package which needs
to perform shell modifications to run.
to perform shell modifications to run.
"""
homepage = "http://www.example.com"
url = "http://www.example.com/a-1.0.tar.gz"
url = "http://www.example.com/a-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
depends_on('modifies-run-env', type=('run',))
depends_on("modifies-run-env", type=("run",))
def install(self, spec, prefix):
mkdirp(prefix.bin)

View File

@@ -11,5 +11,5 @@ class DeprecatedVersions(Package):
homepage = "http://www.example.com"
url = "http://www.example.com/c-1.0.tar.gz"
version('1.1.0', '0123456789abcdef0123456789abcdef', deprecated=True)
version('1.0.0', '0123456789abcdef0123456789abcdef')
version("1.1.0", "0123456789abcdef0123456789abcdef", deprecated=True)
version("1.0.0", "0123456789abcdef0123456789abcdef")

View File

@@ -11,18 +11,18 @@ class DevBuildTestDependent(Package):
homepage = "example.com"
url = "fake.com"
version('0.0.0', sha256='0123456789abcdef0123456789abcdef')
version("0.0.0", sha256="0123456789abcdef0123456789abcdef")
phases = ['edit', 'install']
phases = ["edit", "install"]
filename = 'dev-build-test-file.txt'
filename = "dev-build-test-file.txt"
original_string = "This file should be edited"
replacement_string = "This file has been edited"
depends_on('dev-build-test-install')
depends_on("dev-build-test-install")
def edit(self, spec, prefix):
with open(self.filename, 'r+') as f:
with open(self.filename, "r+") as f:
assert f.read() == self.original_string
f.seek(0)
f.truncate()

View File

@@ -12,9 +12,9 @@ class DevBuildTestInstallPhases(Package):
homepage = "example.com"
url = "fake.com"
version('0.0.0', sha256='0123456789abcdef0123456789abcdef')
version("0.0.0", sha256="0123456789abcdef0123456789abcdef")
phases = ['one', 'two', 'three', 'install']
phases = ["one", "two", "three", "install"]
def one(self, spec, prefix):
sleep(1)

View File

@@ -11,16 +11,16 @@ class DevBuildTestInstall(Package):
homepage = "example.com"
url = "fake.com"
version('0.0.0', sha256='0123456789abcdef0123456789abcdef')
version("0.0.0", sha256="0123456789abcdef0123456789abcdef")
phases = ['edit', 'install']
phases = ["edit", "install"]
filename = 'dev-build-test-file.txt'
filename = "dev-build-test-file.txt"
original_string = "This file should be edited"
replacement_string = "This file has been edited"
def edit(self, spec, prefix):
with open(self.filename, 'r+') as f:
with open(self.filename, "r+") as f:
assert f.read() == self.original_string
f.seek(0)
f.truncate()

View File

@@ -8,8 +8,9 @@
class DevelopTest(Package):
"""Dummy package with develop version"""
homepage = "http://www.openblas.net"
url = "http://github.com/xianyi/OpenBLAS/archive/v0.2.15.tar.gz"
version('develop', git='https://github.com/dummy/repo.git')
version('0.2.15', 'b1190f3d3471685f17cfd1ec1d252ac9')
homepage = "http://www.openblas.net"
url = "http://github.com/xianyi/OpenBLAS/archive/v0.2.15.tar.gz"
version("develop", git="https://github.com/dummy/repo.git")
version("0.2.15", "b1190f3d3471685f17cfd1ec1d252ac9")

View File

@@ -8,8 +8,9 @@
class DevelopTest2(Package):
"""Dummy package with develop version"""
homepage = "http://www.openblas.net"
url = "http://github.com/xianyi/OpenBLAS/archive/v0.2.15.tar.gz"
version('0.2.15.develop', git='https://github.com/dummy/repo.git')
version('0.2.15', 'b1190f3d3471685f17cfd1ec1d252ac9')
homepage = "http://www.openblas.net"
url = "http://github.com/xianyi/OpenBLAS/archive/v0.2.15.tar.gz"
version("0.2.15.develop", git="https://github.com/dummy/repo.git")
version("0.2.15", "b1190f3d3471685f17cfd1ec1d252ac9")

View File

@@ -8,8 +8,8 @@
class DirectMpich(Package):
homepage = "http://www.example.com"
url = "http://www.example.com/direct_mpich-1.0.tar.gz"
url = "http://www.example.com/direct_mpich-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
depends_on('mpich')
depends_on("mpich")

View File

@@ -8,7 +8,8 @@
class DtDiamondBottom(Package):
"""This package has an indirect diamond dependency on dt-diamond-bottom"""
homepage = "http://www.example.com"
url = "http://www.example.com/dt-diamond-bottom-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")

View File

@@ -8,9 +8,10 @@
class DtDiamondLeft(Package):
"""This package has an indirect diamond dependency on dt-diamond-bottom"""
homepage = "http://www.example.com"
url = "http://www.example.com/dt-diamond-left-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
depends_on('dt-diamond-bottom', type='build')
depends_on("dt-diamond-bottom", type="build")

View File

@@ -8,9 +8,10 @@
class DtDiamondRight(Package):
"""This package has an indirect diamond dependency on dt-diamond-bottom"""
homepage = "http://www.example.com"
url = "http://www.example.com/dt-diamond-right-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
depends_on('dt-diamond-bottom', type=('build', 'link', 'run'))
depends_on("dt-diamond-bottom", type=("build", "link", "run"))

View File

@@ -8,10 +8,11 @@
class DtDiamond(Package):
"""This package has an indirect diamond dependency on dt-diamond-bottom"""
homepage = "http://www.example.com"
url = "http://www.example.com/dt-diamond-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
depends_on('dt-diamond-left')
depends_on('dt-diamond-right')
depends_on("dt-diamond-left")
depends_on("dt-diamond-right")

View File

@@ -13,9 +13,9 @@ class Dtbuild1(Package):
homepage = "http://www.example.com"
url = "http://www.example.com/dtbuild1-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version('0.5', 'fedcba9876543210fedcba9876543210')
version("1.0", "0123456789abcdef0123456789abcdef")
version("0.5", "fedcba9876543210fedcba9876543210")
depends_on('dtbuild2', type='build')
depends_on('dtlink2')
depends_on('dtrun2', type='run')
depends_on("dtbuild2", type="build")
depends_on("dtlink2")
depends_on("dtrun2", type="run")

View File

@@ -12,4 +12,4 @@ class Dtbuild2(Package):
homepage = "http://www.example.com"
url = "http://www.example.com/dtbuild2-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")

View File

@@ -12,4 +12,4 @@ class Dtbuild3(Package):
homepage = "http://www.example.com"
url = "http://www.example.com/dtbuild3-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")

View File

@@ -12,6 +12,6 @@ class Dtlink1(Package):
homepage = "http://www.example.com"
url = "http://www.example.com/dtlink1-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
depends_on('dtlink3')
depends_on("dtlink3")

View File

@@ -12,4 +12,4 @@ class Dtlink2(Package):
homepage = "http://www.example.com"
url = "http://www.example.com/dtlink2-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")

View File

@@ -12,7 +12,7 @@ class Dtlink3(Package):
homepage = "http://www.example.com"
url = "http://www.example.com/dtlink3-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
depends_on('dtbuild2', type='build')
depends_on('dtlink4')
depends_on("dtbuild2", type="build")
depends_on("dtlink4")

View File

@@ -12,4 +12,4 @@ class Dtlink4(Package):
homepage = "http://www.example.com"
url = "http://www.example.com/dtlink4-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")

View File

@@ -12,4 +12,4 @@ class Dtlink5(Package):
homepage = "http://www.example.com"
url = "http://www.example.com/dtlink5-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")

View File

@@ -12,7 +12,7 @@ class Dtrun1(Package):
homepage = "http://www.example.com"
url = "http://www.example.com/dtrun1-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
depends_on('dtlink5')
depends_on('dtrun3', type='run')
depends_on("dtlink5")
depends_on("dtrun3", type="run")

View File

@@ -12,4 +12,4 @@ class Dtrun2(Package):
homepage = "http://www.example.com"
url = "http://www.example.com/dtrun2-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")

View File

@@ -12,6 +12,6 @@ class Dtrun3(Package):
homepage = "http://www.example.com"
url = "http://www.example.com/dtrun3-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
depends_on('dtbuild3', type='build')
depends_on("dtbuild3", type="build")

View File

@@ -12,8 +12,8 @@ class Dttop(Package):
homepage = "http://www.example.com"
url = "http://www.example.com/dttop-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
depends_on('dtbuild1', type='build')
depends_on('dtlink1')
depends_on('dtrun1', type='run')
depends_on("dtbuild1", type="build")
depends_on("dtlink1")
depends_on("dtrun1", type="run")

View File

@@ -12,6 +12,6 @@ class Dtuse(Package):
homepage = "http://www.example.com"
url = "http://www.example.com/dtuse-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
depends_on('dttop')
depends_on("dttop")

View File

@@ -8,14 +8,23 @@
class Dyninst(Package):
homepage = "https://paradyn.org"
url = "http://www.paradyn.org/release8.1/DyninstAPI-8.1.1.tgz"
url = "http://www.paradyn.org/release8.1/DyninstAPI-8.1.1.tgz"
version('8.2', '0123456789abcdef0123456789abcdef',
url='http://www.paradyn.org/release8.2/DyninstAPI-8.2.tgz')
version('8.1.2', 'fedcba9876543210fedcba9876543210',
url='http://www.paradyn.org/release8.1.2/DyninstAPI-8.1.2.tgz')
version('8.1.1', '123456789abcdef0123456789abcdef0',
url='http://www.paradyn.org/release8.1/DyninstAPI-8.1.1.tgz')
version(
"8.2",
"0123456789abcdef0123456789abcdef",
url="http://www.paradyn.org/release8.2/DyninstAPI-8.2.tgz",
)
version(
"8.1.2",
"fedcba9876543210fedcba9876543210",
url="http://www.paradyn.org/release8.1.2/DyninstAPI-8.1.2.tgz",
)
version(
"8.1.1",
"123456789abcdef0123456789abcdef0",
url="http://www.paradyn.org/release8.1/DyninstAPI-8.1.1.tgz",
)
depends_on("libelf")
depends_on("libdwarf")

View File

@@ -10,6 +10,6 @@ class E(Package):
"""Simple package with no dependencies"""
homepage = "http://www.example.com"
url = "http://www.example.com/e-1.0.tar.gz"
url = "http://www.example.com/e-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")

View File

@@ -10,8 +10,9 @@ class EcpVizSdk(Package):
adds a transitive dependency forced to use non default
values.
"""
homepage = "https://dev.null"
version('1.0')
version("1.0")
depends_on('conditional-constrained-dependencies')
depends_on("conditional-constrained-dependencies")

View File

@@ -10,11 +10,11 @@ class Extendee(Package):
"""A package with extensions"""
homepage = "http://www.example.com"
url = "http://www.example.com/extendee-1.0.tar.gz"
url = "http://www.example.com/extendee-1.0.tar.gz"
extendable = True
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
def install(self, spec, prefix):
mkdirp(prefix.bin)

View File

@@ -12,6 +12,6 @@ class ExtendsSpec(Package):
homepage = "http://www.example.com"
url = "http://www.example.com/example-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
extends('extendee@1:')
extends("extendee@1:")

View File

@@ -12,14 +12,14 @@ class Extension1(Package):
"""A package which extends another package"""
homepage = "http://www.example.com"
url = "http://www.example.com/extension1-1.0.tar.gz"
url = "http://www.example.com/extension1-1.0.tar.gz"
extends('extendee')
extends("extendee")
version('1.0', '0123456789abcdef0123456789abcdef')
version('2.0', 'abcdef0123456789abcdef0123456789')
version("1.0", "0123456789abcdef0123456789abcdef")
version("2.0", "abcdef0123456789abcdef0123456789")
def install(self, spec, prefix):
mkdirp(prefix.bin)
with open(os.path.join(prefix.bin, 'extension1'), 'w+') as fout:
with open(os.path.join(prefix.bin, "extension1"), "w+") as fout:
fout.write(str(spec.version))

View File

@@ -10,17 +10,17 @@
class Extension2(Package):
"""A package which extends another package. It also depends on another
package which extends the same package."""
package which extends the same package."""
homepage = "http://www.example.com"
url = "http://www.example.com/extension2-1.0.tar.gz"
url = "http://www.example.com/extension2-1.0.tar.gz"
extends('extendee')
depends_on('extension1', type=('build', 'run'))
extends("extendee")
depends_on("extension1", type=("build", "run"))
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
def install(self, spec, prefix):
mkdirp(prefix.bin)
with open(os.path.join(prefix.bin, 'extension2'), 'w+') as fout:
with open(os.path.join(prefix.bin, "extension2"), "w+") as fout:
fout.write(str(spec.version))

View File

@@ -10,9 +10,9 @@ class ExternalBuildableWithVariant(Package):
homepage = "http://somewhere.com"
url = "http://somewhere.com/module-1.0.tar.gz"
version('1.0', '1234567890abcdef1234567890abcdef')
version('0.9', '1234567890abcdef1234567890abcdef')
version("1.0", "1234567890abcdef1234567890abcdef")
version("0.9", "1234567890abcdef1234567890abcdef")
variant('baz', default=False, description='nope')
variant("baz", default=False, description="nope")
depends_on('c@1.0', when='@0.9')
depends_on("c@1.0", when="@0.9")

View File

@@ -8,6 +8,6 @@
class ExternalCommonGdbm(Package):
homepage = "http://www.gnu.org.ua/software/gdbm/gdbm.html"
url = "https://ftpmirror.gnu.org/gdbm/gdbm-1.18.1.tar.gz"
url = "https://ftpmirror.gnu.org/gdbm/gdbm-1.18.1.tar.gz"
version('1.18.1', 'be78e48cdfc1a7ad90efff146dce6cfe')
version("1.18.1", "be78e48cdfc1a7ad90efff146dce6cfe")

View File

@@ -8,7 +8,7 @@
class ExternalCommonOpenssl(Package):
homepage = "http://www.openssl.org"
url = "http://www.openssl.org/source/openssl-1.1.1i.tar.gz"
url = "http://www.openssl.org/source/openssl-1.1.1i.tar.gz"
version('1.1.1i', 'be78e48cdfc1a7ad90efff146dce6cfe')
depends_on('external-common-perl')
version("1.1.1i", "be78e48cdfc1a7ad90efff146dce6cfe")
depends_on("external-common-perl")

View File

@@ -8,7 +8,7 @@
class ExternalCommonPerl(Package):
homepage = "http://www.perl.org"
url = "http://www.cpan.org/src/5.0/perl-5.32.0.tar.gz"
url = "http://www.cpan.org/src/5.0/perl-5.32.0.tar.gz"
version('5.32.0', 'be78e48cdfc1a7ad90efff146dce6cfe')
depends_on('external-common-gdbm')
version("5.32.0", "be78e48cdfc1a7ad90efff146dce6cfe")
depends_on("external-common-gdbm")

View File

@@ -8,8 +8,8 @@
class ExternalCommonPython(Package):
homepage = "http://www.python.org"
url = "http://www.python.org/ftp/python/3.8.7/Python-3.8.7.tgz"
url = "http://www.python.org/ftp/python/3.8.7/Python-3.8.7.tgz"
version('3.8.7', 'be78e48cdfc1a7ad90efff146dce6cfe')
depends_on('external-common-openssl')
depends_on('external-common-gdbm')
version("3.8.7", "be78e48cdfc1a7ad90efff146dce6cfe")
depends_on("external-common-openssl")
depends_on("external-common-gdbm")

View File

@@ -7,10 +7,11 @@
class ExternalNonDefaultVariant(Package):
"""An external that is registered with a non-default value"""
homepage = "http://www.python.org"
url = "http://www.python.org/ftp/python/3.8.7/Python-3.8.7.tgz"
version('3.8.7', 'be78e48cdfc1a7ad90efff146dce6cfe')
version("3.8.7", "be78e48cdfc1a7ad90efff146dce6cfe")
variant('foo', default=True, description='just a variant')
variant('bar', default=True, description='just a variant')
variant("foo", default=True, description="just a variant")
variant("bar", default=True, description="just a variant")

View File

@@ -8,8 +8,8 @@
class Externalmodule(Package):
homepage = "http://somewhere.com"
url = "http://somewhere.com/module-1.0.tar.gz"
url = "http://somewhere.com/module-1.0.tar.gz"
version('1.0', '1234567890abcdef1234567890abcdef')
version("1.0", "1234567890abcdef1234567890abcdef")
depends_on('externalprereq')
depends_on("externalprereq")

View File

@@ -8,6 +8,6 @@
class Externalprereq(Package):
homepage = "http://somewhere.com"
url = "http://somewhere.com/prereq-1.0.tar.gz"
url = "http://somewhere.com/prereq-1.0.tar.gz"
version('1.4', 'f1234567890abcdef1234567890abcde')
version("1.4", "f1234567890abcdef1234567890abcde")

View File

@@ -8,12 +8,12 @@
class Externaltest(Package):
homepage = "http://somewhere.com"
url = "http://somewhere.com/test-1.0.tar.gz"
url = "http://somewhere.com/test-1.0.tar.gz"
version('1.0', '1234567890abcdef1234567890abcdef')
version("1.0", "1234567890abcdef1234567890abcdef")
depends_on('stuff')
depends_on('externaltool')
depends_on("stuff")
depends_on("externaltool")
def install(self, spec, prefix):
touch(join_path(prefix, 'an_installation_file'))
touch(join_path(prefix, "an_installation_file"))

View File

@@ -8,10 +8,10 @@
class Externaltool(Package):
homepage = "http://somewhere.com"
url = "http://somewhere.com/tool-1.0.tar.gz"
url = "http://somewhere.com/tool-1.0.tar.gz"
version('1.0', '1234567890abcdef1234567890abcdef')
version('0.9', '1234567890abcdef1234567890abcdef')
version('0.8.1', '1234567890abcdef1234567890abcdef')
version("1.0", "1234567890abcdef1234567890abcdef")
version("0.9", "1234567890abcdef1234567890abcdef")
version("0.8.1", "1234567890abcdef1234567890abcdef")
depends_on('externalprereq')
depends_on("externalprereq")

View File

@@ -8,11 +8,11 @@
class Externalvirtual(Package):
homepage = "http://somewhere.com"
url = "http://somewhere.com/stuff-1.0.tar.gz"
url = "http://somewhere.com/stuff-1.0.tar.gz"
version('1.0', '1234567890abcdef1234567890abcdef')
version('2.0', '234567890abcdef1234567890abcdef1')
version('2.1', '34567890abcdef1234567890abcdef12')
version('2.2', '4567890abcdef1234567890abcdef123')
version("1.0", "1234567890abcdef1234567890abcdef")
version("2.0", "234567890abcdef1234567890abcdef1")
version("2.1", "34567890abcdef1234567890abcdef12")
version("2.2", "4567890abcdef1234567890abcdef123")
provides('stuff', when='@1.0:')
provides("stuff", when="@1.0:")

View File

@@ -10,9 +10,9 @@ class FailingBuild(Package):
"""This package has a trivial install method that fails."""
homepage = "http://www.example.com/trivial_install"
url = "http://www.unit-test-should-replace-this-url/trivial_install-1.0.tar.gz"
url = "http://www.unit-test-should-replace-this-url/trivial_install-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
def install(self, spec, prefix):
raise InstallError("Expected failure.")

View File

@@ -7,10 +7,11 @@
class FailingEmptyInstall(Package):
"""This package installs nothing, install should fail."""
homepage = "http://www.example.com/trivial_install"
url = "http://www.unit-test-should-replace-this-url/trivial_install-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
homepage = "http://www.example.com/trivial_install"
url = "http://www.unit-test-should-replace-this-url/trivial_install-1.0.tar.gz"
version("1.0", "0123456789abcdef0123456789abcdef")
def install(self, spec, prefix):
pass

View File

@@ -8,6 +8,6 @@
class Fake(Package):
homepage = "http://www.fake-spack-example.org"
url = "http://www.fake-spack-example.org/downloads/fake-1.0.tar.gz"
url = "http://www.fake-spack-example.org/downloads/fake-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")

View File

@@ -11,12 +11,12 @@ class FetchOptions(Package):
homepage = "http://www.fetch-options-example.com"
url = 'https://example.com/some/tarball-1.0.tar.gz'
url = "https://example.com/some/tarball-1.0.tar.gz"
fetch_options = {'timeout': 42, 'cookie': 'foobar'}
timeout = {'timeout': 65}
cookie = {'cookie': 'baz'}
fetch_options = {"timeout": 42, "cookie": "foobar"}
timeout = {"timeout": 65}
cookie = {"cookie": "baz"}
version('1.2', '00000000000000000000000000000012', fetch_options=cookie)
version('1.1', '00000000000000000000000000000011', fetch_options=timeout)
version('1.0', '00000000000000000000000000000010')
version("1.2", "00000000000000000000000000000012", fetch_options=cookie)
version("1.1", "00000000000000000000000000000011", fetch_options=timeout)
version("1.0", "00000000000000000000000000000010")

View File

@@ -10,12 +10,13 @@ class Fftw(Package):
cases with the old concretizer have been solved by the
new ones.
"""
homepage = "http://www.example.com"
url = "http://www.example.com/fftw-1.0.tar.gz"
version(2.0, 'abcdef1234567890abcdef1234567890')
version(1.0, '1234567890abcdef1234567890abcdef')
version(2.0, "abcdef1234567890abcdef1234567890")
version(1.0, "1234567890abcdef1234567890abcdef")
variant('mpi', default=False, description='Enable MPI')
variant("mpi", default=False, description="Enable MPI")
depends_on('mpi', when='+mpi')
depends_on("mpi", when="+mpi")

View File

@@ -10,27 +10,22 @@
class FindExternals1(AutotoolsPackage):
executables = ['find-externals1-exe']
executables = ["find-externals1-exe"]
url = "http://www.example.com/find-externals-1.0.tar.gz"
version('1.0', 'abcdef1234567890abcdef1234567890')
version("1.0", "abcdef1234567890abcdef1234567890")
@classmethod
def determine_spec_details(cls, prefix, exes_in_prefix):
exe_to_path = dict(
(os.path.basename(p), p) for p in exes_in_prefix
)
exes = [x for x in exe_to_path.keys() if 'find-externals1-exe' in x]
exe_to_path = dict((os.path.basename(p), p) for p in exes_in_prefix)
exes = [x for x in exe_to_path.keys() if "find-externals1-exe" in x]
if not exes:
return
exe = spack.util.executable.Executable(
exe_to_path[exes[0]])
output = exe('--version', output=str)
exe = spack.util.executable.Executable(exe_to_path[exes[0]])
output = exe("--version", output=str)
if output:
match = re.search(r'find-externals1.*version\s+(\S+)', output)
match = re.search(r"find-externals1.*version\s+(\S+)", output)
if match:
version_str = match.group(1)
return Spec.from_detection(
'find-externals1@{0}'.format(version_str)
)
return Spec.from_detection("find-externals1@{0}".format(version_str))

View File

@@ -10,10 +10,10 @@ class FlattenDeps(Package):
"""Example install that flattens dependencies."""
homepage = "http://www.example.com"
url = "http://www.example.com/a-1.0.tar.gz"
url = "http://www.example.com/a-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version("1.0", "0123456789abcdef0123456789abcdef")
depends_on('dependency-install')
depends_on("dependency-install")
install = install_dependency_symlinks

View File

@@ -15,10 +15,10 @@ class Garply(Package):
homepage = "https://www.example.com"
has_code = False
version('3.0.0')
version("3.0.0")
def install(self, spec, prefix):
garply_h = '''#ifndef GARPLY_H_
garply_h = """#ifndef GARPLY_H_
class Garply
{
@@ -33,8 +33,8 @@ class Garply
};
#endif // GARPLY_H_
'''
garply_cc = '''#include "garply.h"
"""
garply_cc = """#include "garply.h"
#include "garply_version.h"
#include <iostream>
@@ -57,8 +57,8 @@ class Garply
std::cout << "Garply config dir = %s" << std::endl;
return get_version();
}
'''
garplinator_cc = '''#include "garply.h"
"""
garplinator_cc = """#include "garply.h"
#include <iostream>
int
@@ -69,64 +69,104 @@ class Garply
return 0;
}
'''
garply_version_h = '''const int garply_version_major = %s;
"""
garply_version_h = """const int garply_version_major = %s;
const int garply_version_minor = %s;
'''
mkdirp('%s/garply' % prefix.include)
mkdirp('%s/garply' % self.stage.source_path)
with open('%s/garply_version.h' % self.stage.source_path, 'w') as f:
"""
mkdirp("%s/garply" % prefix.include)
mkdirp("%s/garply" % self.stage.source_path)
with open("%s/garply_version.h" % self.stage.source_path, "w") as f:
f.write(garply_version_h % (self.version[0], self.version[1:]))
with open('%s/garply/garply.h' % self.stage.source_path, 'w') as f:
with open("%s/garply/garply.h" % self.stage.source_path, "w") as f:
f.write(garply_h)
with open('%s/garply/garply.cc' % self.stage.source_path, 'w') as f:
with open("%s/garply/garply.cc" % self.stage.source_path, "w") as f:
f.write(garply_cc % prefix.config)
with open('%s/garply/garplinator.cc' %
self.stage.source_path, 'w') as f:
with open("%s/garply/garplinator.cc" % self.stage.source_path, "w") as f:
f.write(garplinator_cc)
gpp = which('/usr/bin/g++')
if sys.platform == 'darwin':
gpp = which('/usr/bin/clang++')
gpp('-Dgarply_EXPORTS',
'-I%s' % self.stage.source_path,
'-O2', '-g', '-DNDEBUG', '-fPIC',
'-o', 'garply.cc.o',
'-c', '%s/garply/garply.cc' % self.stage.source_path)
gpp('-Dgarply_EXPORTS',
'-I%s' % self.stage.source_path,
'-O2', '-g', '-DNDEBUG', '-fPIC',
'-o', 'garplinator.cc.o',
'-c', '%s/garply/garplinator.cc' % self.stage.source_path)
if sys.platform == 'darwin':
gpp('-fPIC', '-O2', '-g', '-DNDEBUG', '-dynamiclib',
'-Wl,-headerpad_max_install_names', '-o', 'libgarply.dylib',
'-install_name', '@rpath/libgarply.dylib',
'garply.cc.o')
gpp('-O2', '-g', '-DNDEBUG', '-Wl,-search_paths_first',
'-Wl,-headerpad_max_install_names',
'garplinator.cc.o', '-o', 'garplinator',
'-Wl,-rpath,%s' % prefix.lib64,
'libgarply.dylib')
gpp = which("/usr/bin/g++")
if sys.platform == "darwin":
gpp = which("/usr/bin/clang++")
gpp(
"-Dgarply_EXPORTS",
"-I%s" % self.stage.source_path,
"-O2",
"-g",
"-DNDEBUG",
"-fPIC",
"-o",
"garply.cc.o",
"-c",
"%s/garply/garply.cc" % self.stage.source_path,
)
gpp(
"-Dgarply_EXPORTS",
"-I%s" % self.stage.source_path,
"-O2",
"-g",
"-DNDEBUG",
"-fPIC",
"-o",
"garplinator.cc.o",
"-c",
"%s/garply/garplinator.cc" % self.stage.source_path,
)
if sys.platform == "darwin":
gpp(
"-fPIC",
"-O2",
"-g",
"-DNDEBUG",
"-dynamiclib",
"-Wl,-headerpad_max_install_names",
"-o",
"libgarply.dylib",
"-install_name",
"@rpath/libgarply.dylib",
"garply.cc.o",
)
gpp(
"-O2",
"-g",
"-DNDEBUG",
"-Wl,-search_paths_first",
"-Wl,-headerpad_max_install_names",
"garplinator.cc.o",
"-o",
"garplinator",
"-Wl,-rpath,%s" % prefix.lib64,
"libgarply.dylib",
)
mkdirp(prefix.lib64)
copy('libgarply.dylib', '%s/libgarply.dylib' % prefix.lib64)
os.link('%s/libgarply.dylib' % prefix.lib64,
'%s/libgarply.dylib.3.0' % prefix.lib64)
copy("libgarply.dylib", "%s/libgarply.dylib" % prefix.lib64)
os.link("%s/libgarply.dylib" % prefix.lib64, "%s/libgarply.dylib.3.0" % prefix.lib64)
else:
gpp('-fPIC', '-O2', '-g', '-DNDEBUG', '-shared',
'-Wl,-soname,libgarply.so',
'-o', 'libgarply.so', 'garply.cc.o')
gpp('-O2', '-g', '-DNDEBUG', '-rdynamic',
'garplinator.cc.o', '-o', 'garplinator',
'-Wl,-rpath,%s' % prefix.lib64,
'libgarply.so')
gpp(
"-fPIC",
"-O2",
"-g",
"-DNDEBUG",
"-shared",
"-Wl,-soname,libgarply.so",
"-o",
"libgarply.so",
"garply.cc.o",
)
gpp(
"-O2",
"-g",
"-DNDEBUG",
"-rdynamic",
"garplinator.cc.o",
"-o",
"garplinator",
"-Wl,-rpath,%s" % prefix.lib64,
"libgarply.so",
)
mkdirp(prefix.lib64)
copy('libgarply.so', '%s/libgarply.so' % prefix.lib64)
os.link('%s/libgarply.so' % prefix.lib64,
'%s/libgarply.so.3.0' % prefix.lib64)
copy('garplinator', '%s/garplinator' % prefix.lib64)
copy('%s/garply/garply.h' % self.stage.source_path,
'%s/garply/garply.h' % prefix.include)
copy("libgarply.so", "%s/libgarply.so" % prefix.lib64)
os.link("%s/libgarply.so" % prefix.lib64, "%s/libgarply.so.3.0" % prefix.lib64)
copy("garplinator", "%s/garplinator" % prefix.lib64)
copy("%s/garply/garply.h" % self.stage.source_path, "%s/garply/garply.h" % prefix.include)
mkdirp(prefix.bin)
copy('garply_version.h', '%s/garply_version.h' % prefix.bin)
os.symlink('%s/garplinator' % prefix.lib64,
'%s/garplinator' % prefix.bin)
copy("garply_version.h", "%s/garply_version.h" % prefix.bin)
os.symlink("%s/garplinator" % prefix.lib64, "%s/garplinator" % prefix.bin)

View File

@@ -10,17 +10,17 @@ class Gcc(Package):
"""Simple compiler package."""
homepage = "http://www.example.com"
url = "http://www.example.com/gcc-1.0.tar.gz"
url = "http://www.example.com/gcc-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
version('2.0', 'abcdef0123456789abcdef0123456789')
version('3.0', 'def0123456789abcdef0123456789abc')
version("1.0", "0123456789abcdef0123456789abcdef")
version("2.0", "abcdef0123456789abcdef0123456789")
version("3.0", "def0123456789abcdef0123456789abc")
depends_on('conflict', when='@3.0')
depends_on("conflict", when="@3.0")
def install(self, spec, prefix):
# Create the minimal compiler that will fool `spack compiler find`
mkdirp(prefix.bin)
with open(prefix.bin.gcc, 'w') as f:
with open(prefix.bin.gcc, "w") as f:
f.write('#!/bin/bash\necho "%s"' % str(spec.version))
set_executable(prefix.bin.gcc)

View File

@@ -8,10 +8,11 @@
class GitSvnTopLevel(Package):
"""Mock package that uses git for fetching."""
homepage = "http://www.git-fetch-example.com"
# can't have two VCS fetchers.
git = 'https://example.com/some/git/repo'
svn = 'https://example.com/some/svn/repo'
git = "https://example.com/some/git/repo"
svn = "https://example.com/some/svn/repo"
version('2.0')
version("2.0")

Some files were not shown because too many files have changed in this diff Show More