diff --git a/scripts/Bootstrap/Modules/build b/scripts/Bootstrap/Modules/build index be5e774..115b214 100755 --- a/scripts/Bootstrap/Modules/build +++ b/scripts/Bootstrap/Modules/build @@ -1,6 +1,6 @@ #!/bin/bash #set -o functrace -source "$(dirname $0)/../../lib/libem.bash" +source "$(dirname $0)/../../../lib/libem.bash" TCL_DIR="${PSI_PREFIX}/Tools/Pmodules/0.99.0" diff --git a/scripts/Bootstrap/Pmodules/modulecmd.bash b/scripts/Bootstrap/Pmodules/modulecmd.bash index 3fb4149..6b34ea3 100755 --- a/scripts/Bootstrap/Pmodules/modulecmd.bash +++ b/scripts/Bootstrap/Pmodules/modulecmd.bash @@ -569,10 +569,10 @@ subcommand_avail() { local dir='' # get number of columns of terminal - eval $(resize) + cols=$(tput cols) output_header() { - let i=($COLUMNS-${#dir})/2-2 + let i=($cols-${#dir})/2-2 printf -- "%0.s-" $(seq 1 $i) 1>&2 printf -- " %s " "${dir}" 1>&2 printf -- "%0.s-" $(seq 1 $i) 1>&2 @@ -618,7 +618,7 @@ subcommand_avail() { human_readable_output() { output_header - local -i column=$COLUMNS + local -i column=$cols local -i colsize=16 for ((i=0; i<${#mods[@]}; i+=2)); do if [[ ${userlvl} == 'novice' ]]; then @@ -637,11 +637,11 @@ subcommand_avail() { local -i len=${#mod} local -i span=$(( len / 16 + 1 )) local -i colsize=$(( span * 16 )) - if (( column+len >= COLUMNS )); then + if (( column+len >= cols )); then printf -- "\n" 1>&2 column=0 fi - if (( column+colsize < COLUMNS )); then + if (( column+colsize < cols )); then fmt="%-${colsize}s" else fmt="%-s" @@ -680,7 +680,7 @@ compute_family_depth () { { local -r family=$1 cd "${modulepath_root}" - local -r tmp=$(find "${family}" -d -type f -o -type l | head -1) + local -r tmp=$(find "${family}" -depth -type f -o -type l | head -1) local -ar tmp2=( ${tmp//\// } ) local depth=${#tmp2[@]} let depth-=3 diff --git a/scripts/Bootstrap/Tcl/build b/scripts/Bootstrap/Tcl/build deleted file mode 120000 index dfcb532..0000000 --- a/scripts/Bootstrap/Tcl/build +++ /dev/null @@ -1 +0,0 @@ -../Programming/Tcl.build \ No newline at end of file diff --git a/scripts/Bootstrap/Tcl/build b/scripts/Bootstrap/Tcl/build new file mode 100755 index 0000000..402004d --- /dev/null +++ b/scripts/Bootstrap/Tcl/build @@ -0,0 +1,27 @@ +#!/bin/bash + +source "$(dirname $0)/../../../lib/libem.bash" + +function em.configure() { + case ${OS} in + Linux ) + srcdir="${MODULE_SRCDIR}/unix" + ;; + Darwin ) + srcdir="${MODULE_SRCDIR}/macosx" + ;; + esac + "${srcdir}"/configure \ + --prefix="${PREFIX}" \ + --enable-shared=no \ + || exit 1 +} + +function em.post_install() { + { cd "${PREFIX}"/bin && rm -f tclsh && ln -fs tclsh${V%.*} tclsh; }; +} + +em.add_to_family 'Programming' +em.set_docfiles 'license.terms' 'README' +em.set_build_dependencies "${COMPILER}" +em.make_all diff --git a/scripts/Bootstrap/bash/build b/scripts/Bootstrap/bash/build index 122c5f9..19ef03f 100755 --- a/scripts/Bootstrap/bash/build +++ b/scripts/Bootstrap/bash/build @@ -1,6 +1,6 @@ #!/bin/bash -source "$(dirname $0)/../../lib/libem.bash" +source "$(dirname $0)/../../../lib/libem.bash" function em.configure() { "${MODULE_SRCDIR}"/configure \ diff --git a/scripts/Bootstrap/compile_pmodules.sh b/scripts/Bootstrap/compile_pmodules.sh index f36cbfc..2daebfa 100755 --- a/scripts/Bootstrap/compile_pmodules.sh +++ b/scripts/Bootstrap/compile_pmodules.sh @@ -8,13 +8,13 @@ source "${BASE_DIR}/config/pmodules_version.conf" unset PMODULES_HOME source "/opt/psi/config/environment.bash" -${BOOTSTRAP_DIR}/gettext.build --bootstrap -${BOOTSTRAP_DIR}/getopt.build --bootstrap -${BOOTSTRAP_DIR}/dialog.build --bootstrap -${BOOTSTRAP_DIR}/bash.build --bootstrap -${BOOTSTRAP_DIR}/Tcl.build --bootstrap +${BOOTSTRAP_DIR}/gettext/build --bootstrap +${BOOTSTRAP_DIR}/getopt/build --bootstrap +${BOOTSTRAP_DIR}/dialog/build --bootstrap +${BOOTSTRAP_DIR}/bash/build --bootstrap +${BOOTSTRAP_DIR}/Tcl/build --bootstrap # we have to remove the init directory - otherwise the next build will fail... rm -rf "${PMODULES_HOME}/init" -${BOOTSTRAP_DIR}/Modules.build --bootstrap +${BOOTSTRAP_DIR}/Modules/build --bootstrap mv -v "${PMODULES_HOME}/bin/modulecmd" "${PMODULES_HOME}/bin/modulecmd.tcl" diff --git a/scripts/Bootstrap/dialog/build b/scripts/Bootstrap/dialog/build index b5d7a1d..ae80ddd 100755 --- a/scripts/Bootstrap/dialog/build +++ b/scripts/Bootstrap/dialog/build @@ -1,6 +1,6 @@ #!/bin/bash -source "$(dirname $0)/../../lib/libem.bash" +source "$(dirname $0)/../../../lib/libem.bash" function em.configure() { "${MODULE_SRCDIR}"/configure \ diff --git a/scripts/Bootstrap/getopt/build b/scripts/Bootstrap/getopt/build index e502f0e..e910f51 100755 --- a/scripts/Bootstrap/getopt/build +++ b/scripts/Bootstrap/getopt/build @@ -1,6 +1,6 @@ #!/bin/bash -source "$(dirname $0)/../../lib/libem.bash" +source "$(dirname $0)/../../../lib/libem.bash" function em.configure() { : @@ -9,7 +9,7 @@ function em.configure() { function em.build() { case ${OS} in Linux ) - declare -x LDFLAGS="-lintl -liconv" + declare -x LDFLAGS="-lintl" ;; Darwin ) declare -x LDFLAGS="-lintl -liconv -framework CoreFoundation" diff --git a/scripts/Bootstrap/gettext/build b/scripts/Bootstrap/gettext/build index 56463f6..68d8744 100755 --- a/scripts/Bootstrap/gettext/build +++ b/scripts/Bootstrap/gettext/build @@ -1,6 +1,6 @@ #!/bin/bash -source "$(dirname $0)/../../lib/libem.bash" +source "$(dirname $0)/../../../lib/libem.bash" function em.configure() { "${MODULE_SRCDIR}"/configure \ diff --git a/scripts/Bootstrap/install_pmodules.sh b/scripts/Bootstrap/install_pmodules.sh index 7673c49..b540c0e 100755 --- a/scripts/Bootstrap/install_pmodules.sh +++ b/scripts/Bootstrap/install_pmodules.sh @@ -2,6 +2,7 @@ declare -r BASE_DIR=$(cd "$(dirname $0)/../.." && pwd) declare -r BOOTSTRAP_DIR="${BASE_DIR}/scripts/Bootstrap" +declare -r SRC_DIR="${BOOTSTRAP_DIR}/Pmodules" source "${BASE_DIR}/config/pmodules_version.conf" @@ -11,21 +12,19 @@ source "/opt/psi/config/environment.bash" sed_cmd="s:@PMODULES_HOME@:${PMODULES_HOME}:g;" sed_cmd+="s:@PMODULES_VERSION@:${PMODULES_VERSION}:g;" sed_cmd+="s:@MODULES_VERSION@:${MODULES_VERSION}:g" -sed "${sed_cmd}" "${BOOTSTRAP_DIR}/modulecmd.bash" > "${BOOTSTRAP_DIR}/modulecmd" +sed "${sed_cmd}" "${SRC_DIR}/modulecmd.bash" > "${SRC_DIR}/modulecmd" install -d -m 0755 "${PMODULES_HOME}/bin" install -d -m 0755 "${PMODULES_HOME}/config" install -d -m 0755 "${PMODULES_HOME}/init" install -d -m 0755 "${PMODULES_HOME}/lib" -install -m 0755 "${BOOTSTRAP_DIR}/modulecmd" "${PMODULES_HOME}/bin" -install -m 0755 "${BOOTSTRAP_DIR}/init_local_env.bash" "${PMODULES_HOME}/bin" -install -m 0755 "${BOOTSTRAP_DIR}/modsync.bash" "${PMODULES_HOME}/bin" -install -m 0755 "${BOOTSTRAP_DIR}/dialog.bash" "${PMODULES_HOME}/bin" +install -m 0755 "${SRC_DIR}/modulecmd" "${PMODULES_HOME}/bin" +install -m 0755 "${SRC_DIR}/init_local_env.bash" "${PMODULES_HOME}/bin" +install -m 0755 "${SRC_DIR}/modsync.bash" "${PMODULES_HOME}/bin" +install -m 0755 "${SRC_DIR}/dialog.bash" "${PMODULES_HOME}/bin" -#install -m 0644 "${BOOTSTRAP_DIR}/modulerc" "${PMODULES_HOME}/config" +install -m 0644 "${SRC_DIR}/bash" "${PMODULES_HOME}/init" +install -m 0644 "${SRC_DIR}/bash_completion" "${PMODULES_HOME}/init" -install -m 0644 "${BOOTSTRAP_DIR}/bash" "${PMODULES_HOME}/init" -install -m 0644 "${BOOTSTRAP_DIR}/bash_completion" "${PMODULES_HOME}/init" - -install -m 0644 "${BOOTSTRAP_DIR}/libmodules.tcl" "${PMODULES_HOME}/lib" +install -m 0644 "${SRC_DIR}/libmodules.tcl" "${PMODULES_HOME}/lib"