Commit 34b944fa authored by Ben Couturier's avatar Ben Couturier
Browse files

Merge branch 'conda-based-kits' into 'master'

Use conda based environment for unstable

See merge request !20
parents 87d382f6 d740871b
Pipeline #1716596 passed with stages
in 1 minute and 17 seconds
......@@ -41,6 +41,13 @@ for flavour in stable testing unstable ; do
tgt=${RPM_BUILD_ROOT}/%{prefix}/LbEnv-${flavour}${suff}
install -m 0644 "data/LbEnv-flavour${suff}" "${tgt}"
sed -i "s/%flavour%/${flavour}/g" "${tgt}"
# TODO: These should all be moved over to host_os_conda eventually
if [ "${flavour}" = "unstable" ]; then
host_os_script_fn=host_os_conda
else
host_os_script_fn=host_os
fi
sed -i "s/%host_os_script_fn%/${host_os_script_fn}/g" "${tgt}"
done
done
for suff in '' .sh .csh ; do
......@@ -73,6 +80,7 @@ done
%{prefix}/etc/cern_profile.d/lbenv_aliases.sh
%{prefix}/etc/cern_profile.d/lbenv_aliases.csh
%{prefix}/bin/host_os
%{prefix}/bin/host_os_conda
%{prefix}/bin/LbLogin.sh
%{prefix}/LbEnv
%{prefix}/LbEnv.sh
......@@ -89,5 +97,7 @@ done
%changelog
* Mon May 18 2020 Chris Burr <christopher.burr@cern.ch>
- Use conda based environment for unstable flavour
* Mon Feb 25 2015 Marco Clemencic <marco.clemencic@cern.ch>
- first version
......@@ -12,7 +12,7 @@
if ( ! $?LBENV_SOURCED ) then
setenv LBENV_ENTRYPOINT %target_dir%/LbEnv-%flavour%.csh
setenv LBENV_FLAVOUR %flavour%
set _host_os=`%target_dir%/bin/host_os`
set _host_os=`%target_dir%/bin/%host_os_script_fn%`
if ( -e %lbenv_root%/$_host_os/bin/activate.csh ) then
if ( $?PYTHONPATH ) then
......
......@@ -12,7 +12,7 @@
if [ -z "$LBENV_SOURCED" ] ; then
export LBENV_ENTRYPOINT=%target_dir%/LbEnv-%flavour%.sh
export LBENV_FLAVOUR=%flavour%
_host_os=$(%target_dir%/bin/host_os)
_host_os=$(%target_dir%/bin/%host_os_script_fn%)
if [ -e ${OVERRIDE_LBENVROOT:-%lbenv_root%/$_host_os}/bin/activate ] ; then
if [ -n "$PYTHONPATH" ] ; then
......
#!/bin/bash
###############################################################################
# (c) Copyright 2018-2019 CERN #
# #
# This software is distributed under the terms of the GNU General Public #
# Licence version 3 (GPL Version 3), copied verbatim in the file "LICENSE". #
# #
# In applying this licence, CERN does not waive the privileges and immunities #
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
set -euo pipefail
IFS=$'\n\t'
# Known platforms from: https://conda-static.anaconda.org/conda-forge/index.html
# linux-32
# linux-64
# linux-aarch64
# linux-ppc64le
# osx-64
if [ -z "${force_host_os:-}" ] ; then
_os=$(uname -s)
case $_os in
'Linux')
_os='linux'
;;
'Darwin')
_os='osx'
;;
*) ;;
esac
_arch=$(uname -m)
case $_arch in
'x86_64')
_arch='64'
;;
'ppc64')
_arch='ppc64le'
;;
'aarch64')
_arch='aarch64'
;;
'i686')
_arch='32'
;;
*) ;;
esac
host_os="${_os}-${_arch}"
# Fix up for systems with really old glibc versions
if [[ "${host_os}" == "linux-64" ]]; then
_libc_type=$(getconf GNU_LIBC_VERSION | cut -d " " -f 1)
_libc_major=$(getconf GNU_LIBC_VERSION | cut -d " " -f 2 | cut -d '.' -f 1)
_libc_minor=$(getconf GNU_LIBC_VERSION | cut -d " " -f 2 | cut -d '.' -f 2)
if [ "${_libc_type}" == "glibc" ] && [ "${_libc_major}" -eq "2" ]; then
if [ "${_libc_minor}" -lt "12" ]; then
# CentOS 5
host_os="linux-64@glibc-2.5"
fi
fi
fi
else
(>&2 echo "warning: overriding host os detection (using ${force_host_os})")
_os=${force_host_os}
fi
echo "${host_os}"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment