From bc7fcd1b36a697ab8ce5fd6ace425a9143330dce Mon Sep 17 00:00:00 2001
From: Zach van Rijn <me@zv.io>
Date: Sat, 7 Dec 2024 21:34:52 +0000
Subject: user/spack: bump { 0.21.0 --> 0.23.0 }.

NOTE: packages built during the 'clingo-bootstrap' process
      no longer apply patches of the form 'patch("foo.patch")'
      due to changes noted at spack#16. Upstream is aware.

v0.22.0 introduces libc awareness (currently glibc or musl).

    https://github.com/spack/spack/pull/43190

v0.23.0 removes the old concretizer, final 0.x release.

    https://github.com/spack/spack/pull/45215

v1.0.0  has high-impact changes. several compiler limitations.

    https://github.com/spack/spack/pull/45189

See also: https://github.com/spack/spack/discussions/30634
---
 user/spack/APKBUILD                                | 23 +++++++++++++++-------
 user/spack/archspec-fix-cpu-family-detection.patch | 16 ---------------
 user/spack/clingo-explicit-libatomic.patch         | 14 ++++++-------
 3 files changed, 23 insertions(+), 30 deletions(-)
 delete mode 100644 user/spack/archspec-fix-cpu-family-detection.patch

diff --git a/user/spack/APKBUILD b/user/spack/APKBUILD
index 5f696e7a1..247f545e4 100644
--- a/user/spack/APKBUILD
+++ b/user/spack/APKBUILD
@@ -1,8 +1,8 @@
 # Contributor: Zach van Rijn <me@zv.io>
 # Maintainer: Zach van Rijn <me@zv.io>
 pkgname=spack
-pkgver=0.21.0_p1
-pkgrel=5
+pkgver=0.23.0_p1
+pkgrel=0
 pkgdesc="A flexible package manager for supercomputers."
 url="https://spack.io/"
 arch="all"
@@ -17,7 +17,6 @@ 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
@@ -40,14 +39,25 @@ prepare()
 }
 
 check() {
+	##
+	# This is to prevent warnings about "Multiple definitions of compiler"
+	# in the event that 'ccache' is present and symlinked at /usr/local.
+	#
+	export PATH=/usr/sbin:/usr/bin:/sbin:/bin;
+
 	##
 	# On first run, Spack >=0.17.0 will bootstrap "clingo",
 	# Spack's new "concretizer". The output from this process
 	# is not kept, however it demonstrates Spack's functionality.
+	#
+	# The '--deprecated' flag is to prevent an interactive prompt
+	# warning about "deprecated" packages and/or versions. Order
+	# is important; it must come after the 'install' verb.
+	#
 	export SPACK_DISABLE_LOCAL_CONFIG=true
 	export SPACK_USER_CONFIG_PATH=${builddir}/tmp
 	export SPACK_USER_CACHE_PATH=${builddir}/tmp
-	bin/spack --debug install zlib
+	bin/spack --debug install --deprecated zlib
 
 	rm -fr var/spack/cache
 	rm -fr etc/spack/linux # caches compilers.yaml
@@ -67,9 +77,8 @@ package() {
 	install -D -m644 "${srcdir}"/config.yaml "$pkgdir"/etc/spack/config.yaml;
 }
 
-sha512sums="85ae21de1f6c3d6eb3d3f0edc878820f17bae27236ea89eae0f733fa178eff25da41264960a492a2f34e03bd4f668ba1a2cfc395a814693c23f83b4ac2a80985  spack-adelie-v0.21.0_p1.tar.bz2
-30f6d193971bc6f2941141d0da50d339c459f2b9c6157cc2659a589bd2b546fba35d580cad79dd1bc74bcd9de7db31bc937418598d73b68c69876fee6a1c5c73  clingo-explicit-libatomic.patch
-a6503238d116b74ff9c4ecd08a984df90ce02f95c3e10e907481d99917c73339db1cc49f2b473a37875b92a9a6607cac72057c0a7b3d9a57d44c89ebe0ad3915  archspec-fix-cpu-family-detection.patch
+sha512sums="c40eb2ce32a7a432474c76ec76cda3a2830b7e9668d1dd76bf491d09d4bea6902e24f1fbff3c39ac67d2c0dd1f89560662a2828f9516ed99df8dc8bbd01afe6d  spack-adelie-v0.23.0_p1.tar.bz2
+a84df22016109bb8d86b5215b698251a5b10873042361c8bab79e4235e00f381a2d66cbfd84ce6b7933125971f3248008124ef7f7ad85451bf72b815c5b56aa0  clingo-explicit-libatomic.patch
 8ded405082eec192187fb72896c68200985ee1226b2ef7da19ab43f31138972d5b4000cf997cb6e22664a7c100b52b842df07c44e188f87d4250f698d1885ea6  openssl-explicit-linux-headers.patch
 eec3e7dd818c39daea7b8d63b04a6c71d9eb3af32dd899cddc3642152252f4e2eebfd53c3c95365117f9a4826f6f29553f44373948e5c474388021302c8a5ce9  default-no-buildcache.patch
 eb09ce82d2c5c63c2cc63b2f82db2888f15ce82100311614f5a73773be2f605337811c4580e0d4eb2f87b730e7ce4afa6dcdc3f3f52321f63a29a2ad533ea5d4  default-adelie-upstream-git.patch
diff --git a/user/spack/archspec-fix-cpu-family-detection.patch b/user/spack/archspec-fix-cpu-family-detection.patch
deleted file mode 100644
index a3979ec95..000000000
--- a/user/spack/archspec-fix-cpu-family-detection.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-See also: https://github.com/archspec/archspec/issues/102
-
-diff --git a/lib/spack/external/archspec/cpu/detect.py b/lib/spack/external/archspec/cpu/detect.py
-index a7cc4481f6..cadd593ca2 100644
---- a/lib/spack/external/archspec/cpu/detect.py
-+++ b/lib/spack/external/archspec/cpu/detect.py
-@@ -92,7 +92,8 @@ def _machine():
- 
-     # If we are not on Darwin, trust what Python tells us
-     if operating_system != "Darwin":
--        return platform.machine()
-+        machine = platform.machine()
-+        return TARGETS[machine].family.name if machine in TARGETS else machine
- 
-     # On Darwin it might happen that we are on M1, but using an interpreter
-     # built for x86_64. In that case "platform.machine() == 'x86_64'", so we
diff --git a/user/spack/clingo-explicit-libatomic.patch b/user/spack/clingo-explicit-libatomic.patch
index 6a1d1a0aa..60bf83c5d 100644
--- a/user/spack/clingo-explicit-libatomic.patch
+++ b/user/spack/clingo-explicit-libatomic.patch
@@ -1,12 +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
+index 73ff2b1769..40c2c61dfc 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",
+@@ -118,6 +118,7 @@ def cmake_args(self):
+                 self.define("PYCLINGO_USE_INSTALL_PREFIX", True),
+                 self.define("PYCLINGO_INSTALL_DIR", python_platlib),
+                 self.define("PYCLINGO_SUFFIX", suffix),
++                self.define("CMAKE_CXX_STANDARD_LIBRARIES", "-latomic"),
                  self.cmake_py_shared,
              ]
-             if self.spec["cmake"].satisfies("@3.16.0:"):
+         else:
-- 
cgit v1.2.3-70-g09d2