Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuclaw committed Mar 2, 2024
2 parents c0261b7 + 50f5825 commit 32faeef
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_release_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,12 @@ jobs:
#
- name: Run build_all.d for FreeBSD in a dedicated VM
if: matrix.target == 'freebsd'
uses: cross-platform-actions/action@v0.21.1
uses: cross-platform-actions/action@v0.22.0
with:
operating_system: freebsd
hypervisor: qemu
memory: 8G
version: '12.2'
version: '13.2'
shell: bash
run: |
set -eux
Expand Down
31 changes: 25 additions & 6 deletions script/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,22 @@ display_path() {
echo "$1"
fi
}
abspath() {
if [[ -d "$1" ]]
then
pushd "$1" >/dev/null
pwd
popd >/dev/null
elif [[ -e "$1" ]]
then
pushd "$(dirname "$1")" >/dev/null
echo "$(pwd)/$(basename "$1")"
popd >/dev/null
else
echo "$1" does not exist! >&2
return 127
fi
}

COMMAND=
COMPILER=dmd
Expand Down Expand Up @@ -1062,6 +1078,8 @@ binexec_for_dub_compiler() {
}

write_env_vars() {
ROOT_ABS="$(abspath "$ROOT")"

local -r binpath=$(binpath_for_compiler "$1")
case $1 in
dmd*)
Expand Down Expand Up @@ -1124,14 +1142,14 @@ write_env_vars() {
if [ -n "$libpath" ] ; then
echo "_OLD_D_LIBRARY_PATH=\"\${LIBRARY_PATH:-}\""
echo "_OLD_D_LD_LIBRARY_PATH=\"\${LD_LIBRARY_PATH:-}\""
echo "export LIBRARY_PATH=\"$ROOT/$1/$libpath\${LIBRARY_PATH:+:}\${LIBRARY_PATH:-}\""
echo "export LD_LIBRARY_PATH=\"$ROOT/$1/$libpath\${LD_LIBRARY_PATH:+:}\${LD_LIBRARY_PATH:-}\""
echo "export LIBRARY_PATH=\"$ROOT_ABS/$1/$libpath\${LIBRARY_PATH:+:}\${LIBRARY_PATH:-}\""
echo "export LD_LIBRARY_PATH=\"$ROOT_ABS/$1/$libpath\${LD_LIBRARY_PATH:+:}\${LD_LIBRARY_PATH:-}\""
fi

echo "_OLD_D_PATH=\"\${PATH:-}\""
echo "_OLD_D_PS1=\"\${PS1:-}\""
echo "export PS1=\"($1)\${PS1:-}\""
echo "export PATH=\"${DUB_BIN_PATH}${DUB_BIN_PATH:+:}$ROOT/$1/$binpath\${PATH:+:}\${PATH:-}\""
echo "export PATH=\"${DUB_BIN_PATH}${DUB_BIN_PATH:+:}$ROOT_ABS/$1/$binpath\${PATH:+:}\${PATH:-}\""

if [ -n "$dmd" ] ; then
echo "export DMD=$dmd"
Expand Down Expand Up @@ -1168,13 +1186,13 @@ write_env_vars() {
echo "set -g _OLD_D_PATH \$PATH"
echo "set -g _OLD_D_PS1 \$PS1"
echo
echo "set -gx PATH ${DUB_BIN_PATH:+\'}${DUB_BIN_PATH}${DUB_BIN_PATH:+\' }'$ROOT/$1/$binpath' \$PATH"
echo "set -gx PATH ${DUB_BIN_PATH:+\'}${DUB_BIN_PATH}${DUB_BIN_PATH:+\' }'$ROOT_ABS/$1/$binpath' \$PATH"

if [ -n "$libpath" ] ; then
echo "set -g _OLD_D_LIBRARY_PATH \$LIBRARY_PATH"
echo "set -g _OLD_D_LD_LIBRARY_PATH \$LD_LIBRARY_PATH"
echo "set -gx LIBRARY_PATH '$ROOT/$1/$libpath' \$LIBRARY_PATH"
echo "set -gx LD_LIBRARY_PATH '$ROOT/$1/$libpath' \$LD_LIBRARY_PATH"
echo "set -gx LIBRARY_PATH '$ROOT_ABS/$1/$libpath' \$LIBRARY_PATH"
echo "set -gx LD_LIBRARY_PATH '$ROOT_ABS/$1/$libpath' \$LD_LIBRARY_PATH"
fi

if [ -n "$dmd" ] ; then
Expand Down Expand Up @@ -1316,6 +1334,7 @@ Switching to x86_64 architecture (requires Rosetta).
LDC has builds for macOS on aarch64/arm64 architecture since ldc-1.25.0.
If you are installing an earlier version and get a download error,
try '--arch x86_64' to install the x86_64 version instead (requires Rosetta).
Use '--arch universal' to install the universal LDC package that can target arm64 (native) and x86_64 (Rosetta).
"
ARCH=arm64
fi
Expand Down

0 comments on commit 32faeef

Please sign in to comment.