diff --git a/container-conf/build.sh b/container-conf/build.sh index 03ba544..0667d9b 100644 --- a/container-conf/build.sh +++ b/container-conf/build.sh @@ -13,23 +13,13 @@ build_vars() { } build_as_root() { - # re2c is for synapps; rpcgen and libtirpc-devel is for asyn - install_yum_install \ - libXt-devel \ - libtirpc-devel \ - motif-devel \ - nodejs \ - perl-ExtUtils-Command \ - perl-FindBin \ - re2c \ - rpcgen + install_yum_install libatomic } build_as_run_user() { - set -x _slicops_bashrc - # sets epics_synapps_dir - source epics-install.sh + _slicops_nvm_install + install_repo_eval epics-area-detector _slicops_pkg_install _slicops_bin } @@ -41,20 +31,15 @@ export EPICS_BASE=$HOME/.local/epics # $EPICS_BASE/startup/EpicsHostArch outputs linux-x86_64; no need to be dynamic here export EPICS_HOST_ARCH=linux-x86_64 bivio_path_insert "$EPICS_BASE/bin/$EPICS_HOST_ARCH" - -# for newer nvm -export NVM_DIR="$HOME/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" -[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" EOF install_source_bashrc } _slicops_bin() { build_replace_vars "$build_guest_conf"/slicops-entry.sh "$_slicops_entry" - # POSIT: epics-install.sh sets sim_det_dir + sim_det_dir=$(find "$EPICS_BASE" -type d -path '*iocBoot/iocSimDetector') build_replace_vars "$build_guest_conf"/slicops-demo.sh "$_slicops_demo" - # Sanity check that the file contains somethng + # Sanity check that the file contains something if ! grep sim-detector "$_slicops_demo" &> /dev/null; then cat "$_slicops_demo" install_err "$_slicops_demo was not generated properly" @@ -62,6 +47,14 @@ _slicops_bin() { chmod a+rx "$_slicops_demo" "$_slicops_entry" } +_slicops_nvm_install() { + # POSIT: same as download/**/codes/common.sh + mkdir -p "$NVM_DIR" + PROFILE=/dev/null | curl -s -S -L https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash + install_source_bashrc + nvm install 25.6.1 +} + _slicops_pip_install() { declare org_and_repo=$1 declare branch=$2 @@ -78,11 +71,6 @@ _slicops_pkg_install() { _slicops_pip_install radiasoft/pykern "$PYKERN_BRANCH" _slicops_pip_install slaclab/slicops "$SLICOPS_BRANCH" cd slaclab/slicops/ui - rm ~/.npmrc - # upgrade nvm and node - curl -s -S -L https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash - source $HOME/.nvm/nvm.sh - nvm install node npm install npm run build mv dist ../slicops/package_data/vue diff --git a/container-conf/epics-install.sh b/container-conf/epics-install.sh deleted file mode 100644 index 8df3a05..0000000 --- a/container-conf/epics-install.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash -# -# This file is sourced from build.sh so setup is there. -# -# Install epics, asyn, and synaps -# -_asyn_version=R4-45 -_epics_version=7.0.8.1 -_synapps_version=R6-3 - -_epics_base() { - declare d=$(dirname "$EPICS_BASE") - mkdir -p "$d" - cd "$d" - b=base-"$_epics_version" - _epics_untar https://epics-controls.org/download/base/"$b".tar.gz "$b" "$EPICS_BASE" - cd "$EPICS_BASE" - make -j4 -} - -_epics_main() { - declare p=$PWD - install_source_bashrc - bivio_path_remove "$EPICS_BASE"/bin - _epics_base - cd "$EPICS_BASE" - mkdir -p extensions - cd extensions - _epics_synapps - # Need to return, because this file is sourced - cd "$p" -} - -_epics_synapps() { - declare d=synApps - # Must be absolute or fails silently - declare f=$PWD/$d.modules - cat <<'EOF' > "$f" -AREA_DETECTOR=R3-12-1 -ASYN=R4-44-2 -AUTOSAVE=R5-11 -BUSY=R1-7-4 -CALC=R3-7-5 -DEVIOCSTATS=3.1.16 -SNCSEQ=R2-2-9 -SSCAN=R2-11-6 -EOF - curl -s -S -L https://github.com/EPICS-synApps/assemble_synApps/releases/download/"$_synapps_version"/assemble_synApps \ - | perl - --base="$EPICS_BASE" --dir="$d" --config="$f" - rm "$f" - cd "$d"/support - make -j 4 - # POSIT used by slicops-demo.sh - export sim_det_dir=$(find "$PWD" -type d -path '*iocBoot/iocSimDetector') - cd - >& /dev/null -} - -_epics_untar() { - declare url=$1 - declare base=$2 - declare tgt=$3 - curl -L -s -S "$url" | tar xzf - - mv "$base" "$tgt" - cd "$tgt" -} - -# No "$@" since this file is sourced from build.sh (this would pass args from program) -_epics_main