From eaab4d4091e844aeb88f8366db9ca81b2b49dc66 Mon Sep 17 00:00:00 2001
From: Wouter Deconinck <wdconinc@gmail.com>
Date: Sat, 6 Aug 2022 02:34:00 +0000
Subject: [PATCH] fix: oneapi dev based on eic-spack

---
 containers/oneapi/onedev.Dockerfile | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/containers/oneapi/onedev.Dockerfile b/containers/oneapi/onedev.Dockerfile
index bdc29037e..e2eb45cbb 100644
--- a/containers/oneapi/onedev.Dockerfile
+++ b/containers/oneapi/onedev.Dockerfile
@@ -88,14 +88,20 @@ RUN --mount=type=cache,target=/var/cache/spack-mirror                   \
 ARG CACHE_BUST="hash"
 ARG CACHE_NUKE=""
 
-## Setup our custom environment and package overrides
-COPY spack $SPACK_ROOT/eic-spack
-RUN spack repo add --scope site "$SPACK_ROOT/eic-spack"                 \
- && mkdir /opt/spack-environment                                        \
- && cd /opt/spack-environment                                           \
- && mv $SPACK_ROOT/eic-spack/spack.yaml .                               \
- && rm -r /usr/local                                                    \
- && spack env activate .                                                \
+## Setup our custom package overrides
+ENV EICSPACK_ROOT=$SPACK_ROOT/var/spack/repos/eic-spack
+ARG EICSPACK_VERSION="$SPACK_VERSION"
+RUN git clone https://github.com/eic/eic-spack.git ${EICSPACK_ROOT}     \
+ && git -C ${EICSPACK_ROOT} checkout ${EICSPACK_VERSION}                \
+ && if [ -n "${EICSPACK_CHERRYPICKS}" ] ; then                          \
+      git -C ${EICSPACK_ROOT} cherry-pick -n ${EICSPACK_CHERRYPICKS} ;  \
+    fi                                                                  \
+ && spack repo add --scope site "${EICSPACK_ROOT}"
+
+## Setup our custom environment
+COPY spack.yaml /opt/spack-environment/
+RUN rm -r /usr/local                                                    \
+ && spack env activate /opt/spack-environment/                          \
  && spack concretize
 
 
-- 
GitLab