|
31 | 31 | # (4) Parse the command line using the usage information. |
32 | 32 |
|
33 | 33 | export OPENCOARRAYS_SRC_DIR="${OPENCOARRAYS_SRC_DIR:-${PWD}/..}" |
34 | | -export __usage="${OPENCOARRAYS_SRC_DIR}/prerequisites/install-ofp.sh-usage" |
35 | 34 | if [[ ! -f "${OPENCOARRAYS_SRC_DIR}/src/libcaf.h" ]]; then |
36 | 35 | echo "Please run this script inside the OpenCoarrays source \"prerequisites\" subdirectory" |
37 | 36 | echo "or set OPENCOARRAYS_SRC_DIR to the top-level OpenCoarrays source directory path." |
38 | 37 | exit 1 |
39 | 38 | fi |
| 39 | +export __usage="${OPENCOARRAYS_SRC_DIR}/prerequisites/install-ofp.sh-usage" |
40 | 40 | export B3B_USE_CASE="${B3B_USE_CASE:-${OPENCOARRAYS_SRC_DIR}/prerequisites/use-case}" |
41 | 41 | if [[ ! -f "${B3B_USE_CASE:-}/bootstrap.sh" ]]; then |
42 | 42 | echo "Please set B3B_USE_CASE to the bash3boilerplate use-case directory path." |
@@ -64,7 +64,14 @@ if [[ "${__os}" != "OSX" ]]; then |
64 | 64 | emergency "To request other platforms, please submit an issue at http://github.com/sourceryinstitute/opencoarrays/issues" |
65 | 65 | fi |
66 | 66 |
|
67 | | -default_ofp_downloader=wget |
| 67 | +if [[ $(uname) == "Darwin" ]]; then |
| 68 | + default_ofp_downloader=curl |
| 69 | + args="-LO" |
| 70 | +else |
| 71 | + default_ofp_downloader=wget |
| 72 | + args="--no-check-certificate" |
| 73 | +fi |
| 74 | + |
68 | 75 | # If -D is passed, print the download programs used for OFP and its prerequisites. |
69 | 76 | # Then exit with normal status. |
70 | 77 | # shellcheck disable=SC2154 |
|
76 | 83 |
|
77 | 84 | # If -P is passed, print the default installation paths for OFP and its prerequisites. |
78 | 85 | # Then exit with normal status. |
79 | | -default_ofp_install_path="${OPENCOARRAYS_SRC_DIR}/prerequisites/installations" |
80 | | -install_path="${arg_i:-"${default_ofp_install_path}"}" |
81 | | -strategoxt_superbundle_install_path="/opt" |
| 86 | +install_path="${arg_i}" |
| 87 | +strategoxt_superbundle_install_path=`${OPENCOARRAYS_SRC_DIR}/prerequisites/install-binary.sh -P strategoxt-superbundle` |
82 | 88 | # shellcheck disable=SC2154 |
83 | 89 | if [[ "${arg_P}" == "${__flag_present}" ]]; then |
84 | 90 | echo "strategoxt-superbundle default installation path: ${strategoxt_superbundle_install_path}" |
85 | | - echo "ofp default installation path: ${default_ofp_install_path}" |
| 91 | + echo "ofp default installation path: ${install_path}" |
86 | 92 | exit 0 |
87 | 93 | fi |
88 | 94 |
|
|
98 | 104 |
|
99 | 105 | # If -U is passed, print the URLs for OFP and its prerequisites. |
100 | 106 | # Then exit with normal status. |
101 | | -ofp_URL="https://github.com/sourceryinstitute/opencoarrays/files/213108/ofp-sdf.tar.gz" |
| 107 | +ofp_url_head="https://github.com/sourceryinstitute/opencoarrays/files/213108/" |
| 108 | +ofp_url_tail="ofp-sdf.tar.gz" |
102 | 109 | # shellcheck disable=SC2154 |
103 | 110 | if [[ "${arg_U}" == "${__flag_present}" ]]; then |
104 | 111 | echo "strategoxt-superbundle URL: $("${OPENCOARRAYS_SRC_DIR}/prerequisites/install-binary.sh" -U strategoxt-superbundle)" |
105 | | - echo "ofp URL: ${ofp_URL}" |
| 112 | + echo "ofp URL: ${ofp_url_head}${ofp_url_tail}" |
106 | 113 | exit 0 |
107 | 114 | fi |
108 | 115 |
|
@@ -147,11 +154,16 @@ if [[ ! -d "${install_path}" ]]; then |
147 | 154 | set_SUDO_if_needed_to_write_to_directory "${install_path}" |
148 | 155 | ${SUDO:-} mkdir -p "${install_path}" |
149 | 156 | fi |
| 157 | + |
150 | 158 | # Install OFP prerequisites to /opt (currently the only option) |
151 | 159 | "${opencoarrays_prerequisites_dir}"/install-binary.sh -p strategoxt-superbundle -i "${strategoxt_superbundle_install_path}" |
| 160 | + |
152 | 161 | # Downlaod OFP |
153 | 162 | pushd "${install_path}" |
154 | | -${default_ofp_downloader} "${ofp_URL}" |
| 163 | +info "OFP Download command: ${default_ofp_downloader} ${args:-} \"${ofp_url_head}${ofp_url_tail}\"" |
| 164 | +${default_ofp_downloader} ${args:-} "${ofp_url_head}${ofp_url_tail}" |
| 165 | + |
| 166 | + |
155 | 167 | # Uncompress OFP |
156 | 168 | tar xf ofp-sdf.tar.gz |
157 | 169 | # Return to the original working directory |
|
0 commit comments