summaryrefslogtreecommitdiff
path: root/user/spack
diff options
context:
space:
mode:
Diffstat (limited to 'user/spack')
-rw-r--r--user/spack/APKBUILD68
-rw-r--r--user/spack/clingo-explicit-libatomic.patch12
-rw-r--r--user/spack/config.yaml22
-rw-r--r--user/spack/default-adelie-upstream-git.patch27
-rw-r--r--user/spack/default-no-buildcache.patch13
-rw-r--r--user/spack/openssl-explicit-linux-headers.patch12
-rw-r--r--user/spack/spack.post-install28
7 files changed, 158 insertions, 24 deletions
diff --git a/user/spack/APKBUILD b/user/spack/APKBUILD
index e8b1df9ee..5f696e7a1 100644
--- a/user/spack/APKBUILD
+++ b/user/spack/APKBUILD
@@ -1,29 +1,42 @@
# Contributor: Zach van Rijn <me@zv.io>
# Maintainer: Zach van Rijn <me@zv.io>
pkgname=spack
-pkgver=0.19.0_p1
-pkgrel=0
+pkgver=0.21.0_p1
+pkgrel=5
pkgdesc="A flexible package manager for supercomputers."
url="https://spack.io/"
-arch="all !ppc" # see #794
+arch="all"
license="Apache-2.0 OR MIT"
-options="!dbg !strip"
+options="!dbg !strip !fhs"
makedepends="python3-dev"
-depends="$makedepends" # due to bootstrap design
+depends="$makedepends
+ gcc g++ gfortran
+ bzip2 file git gnupg gzip libarchive-tools make patch unzip xz
+ "
subpackages=""
# https://git.adelielinux.org/adelie/docs/-/wikis/Developer-Resources/Maintaining-Spack
source="https://git.adelielinux.org/adelie/$pkgname/-/archive/adelie-v$pkgver/$pkgname-adelie-v$pkgver.tar.bz2
+ clingo-explicit-libatomic.patch
archspec-fix-cpu-family-detection.patch
+ openssl-explicit-linux-headers.patch
+
+ default-no-buildcache.patch
+ default-adelie-upstream-git.patch
+
+ config.yaml
"
-builddir="$srcdir/$pkgname-adelie-v$pkgver"
+install="$pkgname.post-install"
+builddir="${srcdir}/${pkgname}-adelie-v${pkgver}"
prepare()
{
default_prepare
- sed -i etc/spack/defaults/bootstrap.yaml \
- -e '/github-actions/d' \
- ;
+ # disable binary bootstrap
+ sed -i etc/spack/defaults/bootstrap.yaml -e '/github-actions/d';
+
+ # delete windows files
+ find bin \( -name '*.ps1' -o -name '*.py' -o -name '*.bat' \) -delete;
}
check() {
@@ -32,25 +45,32 @@ check() {
# Spack's new "concretizer". The output from this process
# is not kept, however it demonstrates Spack's functionality.
export SPACK_DISABLE_LOCAL_CONFIG=true
- export SPACK_USER_CONFIG_PATH=$builddir/tmp
- export SPACK_USER_CACHE_PATH=$builddir/tmp
- bin/spack install zlib
+ export SPACK_USER_CONFIG_PATH=${builddir}/tmp
+ export SPACK_USER_CACHE_PATH=${builddir}/tmp
+ bin/spack --debug install zlib
+
rm -fr var/spack/cache
+ rm -fr etc/spack/linux # caches compilers.yaml
}
package() {
- for k in etc lib share var; do
- mkdir -p "$pkgdir"/${k};
- cp -r ${k}/spack "$pkgdir"/${k};
+ install -m755 -d "${pkgdir}"/opt/spack;
+ for k in bin etc lib share var; do
+ mv "${k}" "${pkgdir}"/opt/spack;
+ done
+
+ for k in LICENSE-APACHE LICENSE-MIT NOTICE; do
+ install -Dm644 ${k} "${pkgdir}"/usr/share/licenses/${pkgname}/${k};
done
- mkdir -p "$pkgdir"/bin
- install \
- bin/sbang \
- bin/spack \
- bin/spack-python \
- "$pkgdir"/bin \
- ;
+
+ # lower precedence than /opt/spack/etc/spack/config.yaml
+ install -D -m644 "${srcdir}"/config.yaml "$pkgdir"/etc/spack/config.yaml;
}
-sha512sums="bc0dadee54fdbd15b374d6d768ed204ee66e776d9a86ba876b3023bca2875ce1f6ca4cc6fd15334ac0c0ceddab72910317833af277984d941d06d89dc145643d spack-adelie-v0.19.0_p1.tar.bz2
-a6503238d116b74ff9c4ecd08a984df90ce02f95c3e10e907481d99917c73339db1cc49f2b473a37875b92a9a6607cac72057c0a7b3d9a57d44c89ebe0ad3915 archspec-fix-cpu-family-detection.patch"
+sha512sums="85ae21de1f6c3d6eb3d3f0edc878820f17bae27236ea89eae0f733fa178eff25da41264960a492a2f34e03bd4f668ba1a2cfc395a814693c23f83b4ac2a80985 spack-adelie-v0.21.0_p1.tar.bz2
+30f6d193971bc6f2941141d0da50d339c459f2b9c6157cc2659a589bd2b546fba35d580cad79dd1bc74bcd9de7db31bc937418598d73b68c69876fee6a1c5c73 clingo-explicit-libatomic.patch
+a6503238d116b74ff9c4ecd08a984df90ce02f95c3e10e907481d99917c73339db1cc49f2b473a37875b92a9a6607cac72057c0a7b3d9a57d44c89ebe0ad3915 archspec-fix-cpu-family-detection.patch
+8ded405082eec192187fb72896c68200985ee1226b2ef7da19ab43f31138972d5b4000cf997cb6e22664a7c100b52b842df07c44e188f87d4250f698d1885ea6 openssl-explicit-linux-headers.patch
+eec3e7dd818c39daea7b8d63b04a6c71d9eb3af32dd899cddc3642152252f4e2eebfd53c3c95365117f9a4826f6f29553f44373948e5c474388021302c8a5ce9 default-no-buildcache.patch
+eb09ce82d2c5c63c2cc63b2f82db2888f15ce82100311614f5a73773be2f605337811c4580e0d4eb2f87b730e7ce4afa6dcdc3f3f52321f63a29a2ad533ea5d4 default-adelie-upstream-git.patch
+864ae8e73cd80560ed9c4ce03bc6ae8f58b928da348a261617e42b6a680f8cf18f48b120401fe7b4a3f3af260675922044dbd9abbc79b1d2e90f821c00569d5e config.yaml"
diff --git a/user/spack/clingo-explicit-libatomic.patch b/user/spack/clingo-explicit-libatomic.patch
new file mode 100644
index 000000000..6a1d1a0aa
--- /dev/null
+++ b/user/spack/clingo-explicit-libatomic.patch
@@ -0,0 +1,12 @@
+diff --git a/var/spack/repos/builtin/packages/clingo/package.py b/var/spack/repos/builtin/packages/clingo/package.py
+index ab5fe9a043..8a31208850 100644
+--- a/var/spack/repos/builtin/packages/clingo/package.py
++++ b/var/spack/repos/builtin/packages/clingo/package.py
+@@ -120,6 +120,7 @@ def cmake_args(self):
+ "-DCLINGO_BUILD_WITH_PYTHON=ON",
+ "-DPYCLINGO_USER_INSTALL=OFF",
+ "-DPYCLINGO_USE_INSTALL_PREFIX=ON",
++ "-DCMAKE_CXX_STANDARD_LIBRARIES=-latomic",
+ self.cmake_py_shared,
+ ]
+ if self.spec["cmake"].satisfies("@3.16.0:"):
diff --git a/user/spack/config.yaml b/user/spack/config.yaml
new file mode 100644
index 000000000..c7ffefb41
--- /dev/null
+++ b/user/spack/config.yaml
@@ -0,0 +1,22 @@
+# -------------------------------------------------------------------------
+# This is the Adélie spack configuration file.
+#
+# Settings here are versioned with Adélie and are intended to provide
+# sensible defaults out of the box. Adélie maintainers should edit this
+# file to keep it current.
+#
+# Users can override these settings by editing the following files.
+#
+# Per-spack-instance settings (overrides defaults):
+# /opt/spack/etc/spack/config.yaml
+#
+# Per-user settings (overrides default and site settings):
+# ~/.spack/config.yaml
+# -------------------------------------------------------------------------
+
+config:
+
+ install_tree:
+ root: $user_cache_path
+
+ source_cache: $user_cache_path/cache
diff --git a/user/spack/default-adelie-upstream-git.patch b/user/spack/default-adelie-upstream-git.patch
new file mode 100644
index 000000000..cf8e982dd
--- /dev/null
+++ b/user/spack/default-adelie-upstream-git.patch
@@ -0,0 +1,27 @@
+diff --git a/lib/spack/spack/cmd/clone.py b/lib/spack/spack/cmd/clone.py
+index ade3c2a739..610ef78ea1 100644
+--- a/lib/spack/spack/cmd/clone.py
++++ b/lib/spack/spack/cmd/clone.py
+@@ -12,7 +12,7 @@
+ import spack.util.git
+ from spack.util.executable import ProcessError
+
+-_SPACK_UPSTREAM = "https://github.com/spack/spack"
++_SPACK_UPSTREAM = "https://git.adelielinux.org/adelie/spack.git"
+
+ description = "create a new installation of spack in another prefix"
+ section = "admin"
+@@ -37,10 +37,10 @@ def get_origin_info(remote):
+ try:
+ branch = git("symbolic-ref", "--short", "HEAD", output=str)
+ except ProcessError:
+- branch = "develop"
++ branch = "adelie"
+ tty.warn("No branch found; using default branch: %s" % branch)
+- if remote == "origin" and branch not in ("master", "develop"):
+- branch = "develop"
++ if remote == "origin" and branch not in ("master", "develop", "adelie"):
++ branch = "adelie"
+ tty.warn("Unknown branch found; using default branch: %s" % branch)
+ try:
+ origin_url = git(
diff --git a/user/spack/default-no-buildcache.patch b/user/spack/default-no-buildcache.patch
new file mode 100644
index 000000000..f0cd1bb1f
--- /dev/null
+++ b/user/spack/default-no-buildcache.patch
@@ -0,0 +1,13 @@
+diff --git a/lib/spack/spack/cmd/install.py b/lib/spack/spack/cmd/install.py
+index 3f9a948a23..bc46e98395 100644
+--- a/lib/spack/spack/cmd/install.py
++++ b/lib/spack/spack/cmd/install.py
+@@ -120,7 +120,7 @@ def setup_parser(subparser):
+ "--use-cache",
+ action="store_true",
+ dest="use_cache",
+- default=True,
++ default=False,
+ help="check for pre-built Spack packages in mirrors (default)",
+ )
+ cache_group.add_argument(
diff --git a/user/spack/openssl-explicit-linux-headers.patch b/user/spack/openssl-explicit-linux-headers.patch
new file mode 100644
index 000000000..763be9df3
--- /dev/null
+++ b/user/spack/openssl-explicit-linux-headers.patch
@@ -0,0 +1,12 @@
+diff --git a/var/spack/repos/builtin/packages/openssl/package.py b/var/spack/repos/builtin/packages/openssl/package.py
+index 21b076856a..e73c60a7c1 100644
+--- a/var/spack/repos/builtin/packages/openssl/package.py
++++ b/var/spack/repos/builtin/packages/openssl/package.py
+@@ -380,6 +380,7 @@ class Openssl(Package): # Uses Fake Autotools, should subclass Package
+ depends_on("perl@5.14.0:", type=("build", "test"))
+ depends_on("ca-certificates-mozilla", type="build", when="certs=mozilla")
+ depends_on("nasm", when="platform=windows")
++ depends_on("linux-headers", when="platform=linux")
+
+ patch(
+ "https://github.com/openssl/openssl/commit/f9e578e720bb35228948564192adbe3bc503d5fb.patch?full_index=1",
diff --git a/user/spack/spack.post-install b/user/spack/spack.post-install
new file mode 100644
index 000000000..e627b96da
--- /dev/null
+++ b/user/spack/spack.post-install
@@ -0,0 +1,28 @@
+#!/bin/sh -e
+
+cat <<EOF
+*
+* Welcome to Spack on the Adélie Linux platform, the first
+* musl-based distribution for supercomputers.
+*
+* Please keep in mind that binary mirrors are not currently
+* available for this platform, so all packages will need to
+* be built from source, including the initial bootstrap.
+*
+*
+* The Spack environment is obtained by sourcing:
+*
+* $ . /opt/spack/share/spack/setup-env.sh
+*
+*
+* Documentation:
+*
+* https://spack.readthedocs.io/
+*
+*
+* Report Adélie-specific Spack issues:
+*
+* https://git.adelielinux.org/adelie/spack/-/issues
+* https://git.adelielinux.org/adelie/packages/-/issues
+*
+EOF