Skip to content

Commit d2af288

Browse files
author
Damian Rouson
committed
Fix #424 add -u/--from-url option for install.sh
The following appear to work and a build is progressing on macOS now: ./install.sh \ --from-url https://github.com/sourceryinstitute/gcc/archive/teams.tar.gz \ --package gcc \ --install-version teams \ --install-prefix=/opt/gnu/teams where the "version" above assumes that the expanded tar ball has the format <package-name>-<version-string>. For example, with above, the package tar ball should expand to a directory named gcc-teams.
1 parent 3282568 commit d2af288

File tree

5 files changed

+13
-1
lines changed

5 files changed

+13
-1
lines changed

install.sh

+1
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ info "-n (--no-color): ${arg_n}"
164164
info "-o (--only-download): ${arg_o}"
165165
info "-p (--package): ${arg_p}"
166166
info "-P (--print-path): ${arg_P}"
167+
info "-u (--from-url): ${arg_u}"
167168
info "-U (--print-url): ${arg_U}"
168169
info "-v (--version): ${arg_v}"
169170
info "-V (--print-version): ${arg_V}"

install.sh-usage

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
-o --only-download Download (without building) the source for the package specified by -p or --package.
1818
-p --package [arg] Install specified package. Default="opencoarrays"
1919
-P --print-path [arg] Print installation directory for specified package.
20+
-u --from-url [arg] Specify a URL to use for downloading a package.
2021
-U --print-url [arg] Print download location for specified package.
2122
-v --version Print OpenCoarrays version number.
2223
-V --print-version [arg] Print version number for specified package.

prerequisites/build-functions/set_or_print_url.sh

+9-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ set_or_print_url()
1010
# Get package name from argument passed with -p, -D, -P, -V, or -U
1111
package_to_build="${arg_p:-${arg_D:-${arg_P:-${arg_U:-${arg_V:-${arg_B}}}}}}"
1212

13+
if [[ ! -z ${arg_u:-} ]]; then
14+
# User specified a URL from which to download the package
15+
url_tail=${arg_u##*/} # set url_tail to text_after_final_slash
16+
url_head=${arg_u%%${url_tail}} # set url_head text before url_tail
17+
else
18+
1319
if [[ "${package_to_build}" == 'cmake' ]]; then
1420
major_minor="${version_to_build%.*}"
1521
elif [[ "${package_to_build}" == "gcc" ]]; then
@@ -35,7 +41,7 @@ set_or_print_url()
3541
KEY="${package%%;*}"
3642
VALUE="${package##*;}"
3743
info "KEY=${KEY} VALUE=${VALUE}"
38-
44+
3945
if [[ "${package_to_build}" == "${KEY}" ]]; then
4046
# We recognize the package name so we set the URL head:
4147
url_head="${VALUE}"
@@ -81,6 +87,8 @@ set_or_print_url()
8187
emergency "Package ${package_name:-} not recognized. Use --l or --list-packages to list the allowable names."
8288
fi
8389

90+
fi # end if [[ ! -z $arg_u ]]; then
91+
8492
package_url="${url_head}""${url_tail}"
8593

8694
# If a printout of the package URL was requested, then print it and exit with normal status

prerequisites/build.sh

+1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ info "-n (--no-color): ${arg_n} "
107107
info "-p (--package): ${arg_p}"
108108
info "-P (--print-path): ${arg_P} "
109109
info "-t (--with-tau): ${arg_t} "
110+
info "-u (--from-url): ${arg_u} "
110111
info "-U (--print-url): ${arg_U} "
111112
info "-v (--version): ${arg_v} "
112113
info "-V (--print-version): ${arg_V} "

prerequisites/build.sh-usage

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
-P --print-path [arg] Print installation path for package specified in argument.
2020
-t --with-tau [arg] Use the specified TAU parallel performance utilities installation. Default="tauf90"
2121
-T --install-tau [arg] Install TAU in specified path. Default="${OPENCOARRAYS_SRC_DIR}/prerequisites/installations/${package_name:-}/${version_to_build:-}/"
22+
-u --from-url [arg] Specify a URL from which to download a package.
2223
-U --print-url [arg] Print URL for package specified in argument.
2324
-v --version Print OpenCoarrays version number.
2425
-V --print-version [arg] Print installation version for package specified in argument.

0 commit comments

Comments
 (0)