summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessasaurus <814322+vsoch@users.noreply.github.com>2021-11-23 23:06:29 -0700
committerGitHub <noreply@github.com>2021-11-24 07:06:29 +0100
commita5bd6acd9061312aea58f180da59250d880b9a26 (patch)
tree072a503a35f001589646bd5f95c91d917371f78d
parentd6d78b84579d3da819e2e1c0abd06a90688ed871 (diff)
downloadspack-a5bd6acd9061312aea58f180da59250d880b9a26.tar.gz
spack-a5bd6acd9061312aea58f180da59250d880b9a26.tar.bz2
spack-a5bd6acd9061312aea58f180da59250d880b9a26.tar.xz
spack-a5bd6acd9061312aea58f180da59250d880b9a26.zip
Adding oras go package (#27605)
Signed-off-by: vsoch <vsoch@users.noreply.github.com> Co-authored-by: vsoch <vsoch@users.noreply.github.com>
-rw-r--r--var/spack/repos/builtin/packages/oras/package.py47
1 files changed, 47 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/oras/package.py b/var/spack/repos/builtin/packages/oras/package.py
new file mode 100644
index 0000000000..dea8a8693b
--- /dev/null
+++ b/var/spack/repos/builtin/packages/oras/package.py
@@ -0,0 +1,47 @@
+# Copyright 2013-2021 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 llnl.util.tty as tty
+from llnl.util.filesystem import find
+
+from spack import *
+
+
+class Oras(Package):
+ """ORAS means OCI Registry As Storage"""
+
+ homepage = "https://oras.land"
+ git = "https://github.com/oras-project/oras"
+ url = "https://github.com/oras-project/oras/archive/refs/tags/v0.12.0.tar.gz"
+
+ maintainers = ['vsoch']
+
+ version('main', branch="main")
+ version("0.12.0", sha256="5e19d61683a57b414efd75bd1b0290c941b8faace5fcc9d488f5e4aa674bf03e")
+
+ depends_on("go", type='build')
+
+ def setup_build_environment(self, env):
+ # Point GOPATH at the top of the staging dir for the build step.
+ env.prepend_path('GOPATH', self.stage.path)
+
+ def install(self, spec, prefix):
+ if self.spec.satisfies('platform=linux target=aarch64:'):
+ make("build-linux-arm64")
+ elif self.spec.satisfies('platform=linux'):
+ make("build-linux")
+ elif self.spec.satisfies('platform=darwin target=aarch64:'):
+ make("build-mac-arm64")
+ elif self.spec.satisfies('platform=darwin'):
+ make("build-mac")
+ elif self.spec.satisfies('platform=windows'):
+ make("build-windows")
+ mkdirp(prefix.bin)
+
+ oras = find("bin", "oras")
+ if not oras:
+ tty.die("Oras executable missing in bin.")
+ tty.debug("Found oras executable %s to move into install bin" % oras[0])
+ install(oras[0], prefix.bin)