#!/bin/sh # # Tweed --- Package management for engineering software # Copyright (C) 2016 Paul Garlick # # Tweed is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Tweed. If not, see . # create a .hashdist-profile directory if it does not already exist mkdir -p $HOME/.hashdist-profile # set configuration filename CONFIG_FILE=$HOME/.hashdist-profile/hashdist.sh # remove previous configuration file (if it exists) rm -f $CONFIG_FILE # read link to profile in HashStack directory PROFILE="$HASHSTACK_DIR/default" PROFILE=$(readlink $PROFILE) PROFILE=$(basename $PROFILE) # confirm HashDist store location HASHDIST_BUILD_STORE=$(grep build_stores: -A1 ~/.hashdist/config.yaml | tail -1 | cut -f2 -d: | tr -d ' ') if [ "x$HASHDIST_BUILD_STORE" = "x./bld" ]; then HASHDIST_BUILD_STORE="$HOME/.hashdist/bld" fi # write environment variables to configuration file cat << EOF > $CONFIG_FILE # HashDist configuration file # created by $0 on $(date) export PROFILE="$PROFILE" export PROFILE_INSTALL_DIR="$HASHDIST_BUILD_STORE/profile/$PROFILE" export PATH="$PROFILE_INSTALL_DIR/bin:$PATH" export MANPATH="$PROFILE_INSTALL_DIR/share/man:" export CMAKE_PREFIX_PATH="$PROFILE_INSTALL_DIR:$CMAKE_PREFIX_PATH" export PYTHONPATH="$PROFILE_INSTALL_DIR/lib/python2.7/site-packages:$PYTHONPATH" export PKG_CONFIG_PATH="$PROFILE_INSTALL_DIR/lib/pkgconfig:$PKG_CONFIG_PATH" export INSTANT_CACHE_DIR="$HOME/.cache/instant/$PROFILE" export DIJITSO_CACHE_DIR="$HOME/.cache/dijitso/$PROFILE" EOF