1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

chore(CI): Use consistent passing of ARCH to scripts

It's passed to some scripts through the environment variable and to others on
as an argument. Make all calls rely on the argument for consistency.
This commit is contained in:
Anthony Bilinski 2022-03-07 01:35:20 -08:00
parent 4afaf78c65
commit 98bdf5f36f
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
4 changed files with 14 additions and 14 deletions

View File

@ -14,19 +14,19 @@ set -euo pipefail
while (( $# > 0 )); do while (( $# > 0 )); do
case $1 in case $1 in
--arch) SCRIPT_ARCH=$2; shift 2 ;; --arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;; -h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;; *) echo "Unexpected argument $1"; usage; exit 1;;
esac esac
done done
if [ "${SCRIPT_ARCH-x}" != "win32" ] && [ "${SCRIPT_ARCH-x}" != "win64" ]; then if [ "$ARCH" != "win32" ] && [ "$ARCH" != "win64" ]; then
echo "Unexpected arch $ARCH" echo "Unexpected arch $ARCH"
usage usage
exit 1 exit 1
fi fi
if [ "${SCRIPT_ARCH}" == "win64" ]; then if [ "${ARCH}" == "win64" ]; then
HOST="x86_64-w64-mingw32" HOST="x86_64-w64-mingw32"
else else
HOST="i686-w64-mingw32" HOST="i686-w64-mingw32"

View File

@ -14,19 +14,19 @@ set -euo pipefail
while (( $# > 0 )); do while (( $# > 0 )); do
case $1 in case $1 in
--arch) SCRIPT_ARCH=$2; shift 2 ;; --arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;; -h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;; *) echo "Unexpected argument $1"; usage; exit 1;;
esac esac
done done
if [ "${SCRIPT_ARCH-x}" != "win32" ] && [ "${SCRIPT_ARCH-x}" != "win64" ]; then if [ "$ARCH" != "win32" ] && [ "$ARCH" != "win64" ]; then
echo "Unexpected arch $SCRIPT_ARCH" echo "Unexpected arch $ARCH"
usage usage
exit 1 exit 1
fi fi
if [ "${SCRIPT_ARCH}" == "win64" ]; then if [ "${ARCH}" == "win64" ]; then
HOST="x86_64-w64-mingw32" HOST="x86_64-w64-mingw32"
else else
HOST="i686-w64-mingw32" HOST="i686-w64-mingw32"

View File

@ -14,21 +14,21 @@ set -euo pipefail
while (( $# > 0 )); do while (( $# > 0 )); do
case $1 in case $1 in
--arch) SCRIPT_ARCH=$2; shift 2 ;; --arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;; -h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;; *) echo "Unexpected argument $1"; usage; exit 1;;
esac esac
done done
if [ "${SCRIPT_ARCH-x}" != "win32" ] && [ "${SCRIPT_ARCH-x}" != "win64" ]; then if [ "$ARCH" != "win32" ] && [ "$ARCH" != "win64" ]; then
echo "Unexpected arch $SCRIPT_ARCH" echo "Unexpected arch $ARCH"
usage usage
exit 1 exit 1
fi fi
"$(dirname $0)"/download/download_libexpat.sh "$(dirname $0)"/download/download_libexpat.sh
if [ "${SCRIPT_ARCH}" == "win64" ]; then if [ "${ARCH}" == "win64" ]; then
HOST="x86_64-w64-mingw32" HOST="x86_64-w64-mingw32"
else else
HOST="i686-w64-mingw32" HOST="i686-w64-mingw32"

View File

@ -224,21 +224,21 @@ COPY download/download_gmp.sh /build/download/download_gmp.sh
COPY build_gmp_windows.sh /build/build_gmp_windows.sh COPY build_gmp_windows.sh /build/build_gmp_windows.sh
RUN mkdir -p /src/gmp && \ RUN mkdir -p /src/gmp && \
cd /src/gmp && \ cd /src/gmp && \
/build/build_gmp_windows.sh && \ /build/build_gmp_windows.sh --arch ${SCRIPT_ARCH} && \
rm -fr /src/gmp rm -fr /src/gmp
COPY download/download_libexpat.sh /build/download/download_libexpat.sh COPY download/download_libexpat.sh /build/download/download_libexpat.sh
COPY build_libexpat_windows.sh /build/build_libexpat_windows.sh COPY build_libexpat_windows.sh /build/build_libexpat_windows.sh
RUN mkdir -p /src/libexpat && \ RUN mkdir -p /src/libexpat && \
cd /src/libexpat && \ cd /src/libexpat && \
/build/build_libexpat_windows.sh && \ /build/build_libexpat_windows.sh --arch ${SCRIPT_ARCH} && \
rm -fr /src/libexpat rm -fr /src/libexpat
COPY download/download_gdb.sh /build/download/download_gdb.sh COPY download/download_gdb.sh /build/download/download_gdb.sh
COPY build_gdb_windows.sh /build/build_gdb_windows.sh COPY build_gdb_windows.sh /build/build_gdb_windows.sh
RUN mkdir -p /src/gdb && \ RUN mkdir -p /src/gdb && \
cd /src/gdb && \ cd /src/gdb && \
/build/build_gdb_windows.sh && \ /build/build_gdb_windows.sh --arch ${SCRIPT_ARCH} && \
rm -fr /src/gdb && \ rm -fr /src/gdb && \
cp /windows/bin/gdb.exe /debug_export/gdb.exe cp /windows/bin/gdb.exe /debug_export/gdb.exe