From f9645bb9661e73f2168a68b2b75569bc46f4087c Mon Sep 17 00:00:00 2001
From: Wouter Deconinck <wdconinc@gmail.com>
Date: Mon, 13 Jun 2022 22:20:22 +0000
Subject: [PATCH] DETECTOR_PREFIX="${LOCAL_PREFIX}/share"

---
 bin/build_detector.sh | 9 ++++-----
 bin/env.sh            | 2 +-
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/bin/build_detector.sh b/bin/build_detector.sh
index 8d1fb44..4f2c45b 100755
--- a/bin/build_detector.sh
+++ b/bin/build_detector.sh
@@ -24,7 +24,7 @@ fi
 
 ## =============================================================================
 ## Step 1: download/update the detector definitions (if needed)
-pushd ${DETECTOR_PREFIX}
+pushd ${LOCAL_PREFIX}/src
 
 ## We need an up-to-date copy of the detector
 ## start clean to avoid issues...
@@ -74,14 +74,15 @@ git clone --depth 1 https://eicweb.phy.anl.gov/EIC/detectors/accelerator.git
 [[ "$?" == "0" ]]  ||  exit 1
 rm -rf "accelerator/.git"
 
-## Now symlink the accelerator definition into the detector definition
-echo "Linking accelerator definition into detector definition"
+## Now symlink the accelerator and beamline definitions into the detector definition
+echo "Linking accelerator and beamline definition into detector definition"
 ln -s -f ${DETECTOR_PREFIX}/accelerator/eic ${DETECTOR_PATH}/eic
 [[ "$?" == "0" ]]  ||  exit 1
 ln -s -f ${DETECTOR_PREFIX}/${BEAMLINE_CONFIG}/${BEAMLINE_CONFIG} ${DETECTOR_PATH}/${BEAMLINE_CONFIG}
 [[ "$?" == "0" ]]  ||  exit 1
 
 popd
+
 ## =============================================================================
 ## Step 2: Compile and install the detector definition
 echo "Building and installing the ${JUGGLER_DETECTOR} package"
@@ -98,8 +99,6 @@ cmake ${DETECTOR_PREFIX}/${BEAMLINE_CONFIG} -DCMAKE_INSTALL_PREFIX=${LOCAL_PREFI
 popd
 rm -rf ${DETECTOR_PREFIX}/${BEAMLINE_CONFIG}_build
 
-
-
 ## =============================================================================
 ## Step 3: That's all!
 echo "Detector build/install complete!"
diff --git a/bin/env.sh b/bin/env.sh
index 4c5ae97..72105e7 100755
--- a/bin/env.sh
+++ b/bin/env.sh
@@ -106,7 +106,7 @@ mkdir -p "${LOCAL_PREFIX}"
 export LOCAL_PREFIX=`realpath ${LOCAL_PREFIX}`
 
 ## detector prefix: prefix for the detector definitions
-export DETECTOR_PREFIX="${LOCAL_PREFIX}/detector"
+export DETECTOR_PREFIX="${LOCAL_PREFIX}/share"
 mkdir -p ${DETECTOR_PREFIX}
 
 ## detector path: actual detector definition path
-- 
GitLab