-
Notifications
You must be signed in to change notification settings - Fork 339
/
install-dependencies-macos.sh
executable file
·57 lines (47 loc) · 1.48 KB
/
install-dependencies-macos.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env bash
#
# Bash script to install GMT dependencies on macOS via Homebrew and conda
#
# Environmental variables that can control the installation:
#
# - BUILD_DOCS: Build GMT documentation [false]
# - RUN_TESTS: Run GMT tests [false]
# - PACKAGE: Create GMT packages [false]
#
set -x -e
# set defaults to false
BUILD_DOCS="${BUILD_DOCS:-false}"
RUN_TESTS="${RUN_TESTS:-false}"
PACKAGE="${PACKAGE:-false}"
# packages for compiling GMT
# cmake is pre-installed on GitHub Actions
packages="ninja curl pcre2 netcdf gdal geos fftw libomp"
conda_packages="ghostscript=10.03.0"
# packages for build documentation
if [ "$BUILD_DOCS" = "true" ]; then
packages+=" pngquant"
conda_packages+=" sphinx dvc"
fi
# packages for running GMT tests
if [ "$RUN_TESTS" = "true" ]; then
packages+=" graphicsmagick"
conda_packages+=" dvc"
fi
if [ "$PACKAGE" = "true" ]; then
# we need the GNU tar for packaging
packages+=" gnu-tar"
fi
# Install GMT dependencies
#brew update
brew install ${packages}
# Install packages via conda
conda update -n base -c conda-forge conda --solver libmamba
conda install ${conda_packages} -c conda-forge --solver libmamba
echo "${CONDA}/bin" >> $GITHUB_PATH
# Remove pcre-config from conda's path so cmake won't find the conda's one
rm -f ${CONDA}/bin/pcre-config ${CONDA}/bin/pcre2-config
# Install Sphinx extensions
if [ "$BUILD_DOCS" = "true" ]; then
${CONDA}/bin/python -m pip install --user -r doc/rst/requirements.txt
fi
set +x +e