summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAxel Huebl <axel.huebl@plasma.ninja>2020-04-14 20:12:13 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2020-04-15 11:44:14 -0700
commit7e5257e44af139a9d9150496d81cc1c8aacb2769 (patch)
tree31a55c0d8829f97f4380b0e326350768cbe73391 /lib
parenta563884af387ec445b7c9eeb009972bf40d0d3af (diff)
downloadspack-7e5257e44af139a9d9150496d81cc1c8aacb2769.tar.gz
spack-7e5257e44af139a9d9150496d81cc1c8aacb2769.tar.bz2
spack-7e5257e44af139a9d9150496d81cc1c8aacb2769.tar.xz
spack-7e5257e44af139a9d9150496d81cc1c8aacb2769.zip
x.org: mirror mixin
According to my nightly CI/CD tests, x.org is another large provider of software in common build chains that is often down. Added a hand-selected amount of mirrors that is well up-to-sync. Tested with `util-macros` that has a quite "recent" patch release. Other packages to follow in an individual PR.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/build_systems/xorg.py37
-rw-r--r--lib/spack/spack/pkgkit.py1
2 files changed, 38 insertions, 0 deletions
diff --git a/lib/spack/spack/build_systems/xorg.py b/lib/spack/spack/build_systems/xorg.py
new file mode 100644
index 0000000000..815bb7c26b
--- /dev/null
+++ b/lib/spack/spack/build_systems/xorg.py
@@ -0,0 +1,37 @@
+# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+import spack.util.url
+import spack.package
+
+
+class XorgPackage(spack.package.PackageBase):
+ """Mixin that takes care of setting url and mirrors for x.org
+ packages."""
+ #: Path of the package in a x.org mirror
+ xorg_mirror_path = None
+
+ #: List of x.org mirrors used by Spack
+ base_mirrors = [
+ 'https://www.x.org/archive/individual/',
+ 'https://mirrors.ircam.fr/pub/x.org/individual/',
+ 'http://xorg.mirrors.pair.com/individual/'
+ ]
+
+ @property
+ def urls(self):
+ self._ensure_xorg_mirror_path_is_set_or_raise()
+ return [
+ spack.util.url.join(m, self.xorg_mirror_path,
+ resolve_href=True)
+ for m in self.base_mirrors
+ ]
+
+ def _ensure_xorg_mirror_path_is_set_or_raise(self):
+ if self.xorg_mirror_path is None:
+ cls_name = type(self).__name__
+ msg = ('{0} must define a `xorg_mirror_path` attribute'
+ ' [none defined]')
+ raise AttributeError(msg.format(cls_name))
diff --git a/lib/spack/spack/pkgkit.py b/lib/spack/spack/pkgkit.py
index e271f27f31..5c9c01ff9f 100644
--- a/lib/spack/spack/pkgkit.py
+++ b/lib/spack/spack/pkgkit.py
@@ -32,6 +32,7 @@ from spack.build_systems.meson import MesonPackage
from spack.build_systems.sip import SIPPackage
from spack.build_systems.gnu import GNUMirrorPackage
from spack.build_systems.sourceware import SourcewarePackage
+from spack.build_systems.xorg import XorgPackage
from spack.mixins import filter_compiler_wrappers