mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-15 15:09:01 +08:00
973b0e5346
When behind a corporate proxy, one often needs to specify `HTTP_PROXY` and `HTTPS_PROXY` for some command line tools to work properly. However, `pacman` seems to rely on the lowercase equivalent environment variables. In a Windows command prompt environment, it is not possible to set both since Windows environment variables are not case-sensitive. As a workaround, this build script checks for the existence of HTTP_PROXY and HTTPS_PROXY. If they exist, they are exported as lowercase variables.
25 lines
618 B
Bash
25 lines
618 B
Bash
#!/usr/bin/bash
|
|
set -e
|
|
export PATH=/usr/bin:$PATH
|
|
# Export HTTP(S)_PROXY as http(s)_proxy:
|
|
if [ "$HTTP_PROXY" ]; then
|
|
export http_proxy=$HTTP_PROXY
|
|
fi
|
|
if [ "$HTTPS_PROXY" ]; then
|
|
export https_proxy=$HTTPS_PROXY
|
|
fi
|
|
pacman -Sy --noconfirm --needed diffutils make
|
|
|
|
PATH_TO_BUILD_DIR="`cygpath "$1"`"
|
|
PATH_TO_SRC_DIR="`cygpath "$2"`"
|
|
PATH_TO_PACKAGE_DIR="`cygpath "$3"`"
|
|
# Note: $4 is extra configure options
|
|
|
|
cd "$PATH_TO_BUILD_DIR"
|
|
echo "=== CONFIGURING ==="
|
|
"$PATH_TO_SRC_DIR/configure" --toolchain=msvc "--prefix=$PATH_TO_PACKAGE_DIR" $4
|
|
echo "=== BUILDING ==="
|
|
make -j6
|
|
echo "=== INSTALLING ==="
|
|
make install
|