-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
129 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#!/bin/bash | ||
export KERNEL="$(uname -s)" | ||
export MATCHINE="$(uname -m)" | ||
|
||
export WORKSPACE="${GITHUB_WORKSPACE:-$(pwd)}" | ||
export CURL_VERSION="8.6.0_1" | ||
export WOA_TOOLCHAIN_VERSION="2024-02-08" | ||
export MINGW_CURL_WIN64_BLOB="https://curl.se/windows/dl-$CURL_VERSION/curl-$CURL_VERSION-win64-mingw.zip" | ||
export MINGW_CURL_WIN64A_BLOB="https://curl.se/windows/dl-$CURL_VERSION/curl-$CURL_VERSION-win64a-mingw.zip" | ||
export MINGW32_TOOLCHAIN_BLOB="https://github.com/Windows-on-ARM-Experiments/mingw-woarm64-build/releases/download/$WOA_TOOLCHAIN_VERSION/aarch64-w64-mingw32-msvcrt-toolchain.tar.gz" | ||
|
||
case "$KERNEL" in | ||
Linux) | ||
KERNEL="linux" | ||
;; | ||
Darwin) | ||
KERNEL="darwin" | ||
MATCHINE="universal" | ||
;; | ||
esac | ||
|
||
function download { | ||
local URL="$1" | ||
local SAVED_PATH="$(mktemp)" | ||
local SAVED_DIR="$(mktemp -d)" | ||
wget --no-verbose "$URL" -O "$SAVED_PATH" | ||
case "$URL" in | ||
*.zip) | ||
unzip -q -d "$SAVED_DIR" "$SAVED_PATH" | ||
rm "$SAVED_PATH" | ||
echo "$SAVED_DIR" | ||
;; | ||
*.tar.gz) | ||
tar -C "$SAVED_DIR" --gzip --extract --file="$SAVED_PATH" | ||
rm "$SAVED_PATH" | ||
echo "$SAVED_DIR" | ||
;; | ||
*) | ||
echo "$SAVED_PATH" | ||
;; | ||
esac | ||
} | ||
|
||
function copy-license { | ||
local OUTPUT="$1" | ||
|
||
cp "$WORKSPACE/src/LICENSE" "$OUTPUT/LICENSE-lpac" | ||
cp "$WORKSPACE/euicc/LICENSE" "$OUTPUT/LICENSE-libeuicc" | ||
cp "$WORKSPACE/cjson/LICENSE" "$OUTPUT/LICENSE-cjson" | ||
cp "$WORKSPACE/dlfcn-win32/LICENSE" "$OUTPUT/LICENSE-dlfcn-win32" | ||
} | ||
|
||
function copy-curl-woa { | ||
local OUTPUT="$1" | ||
|
||
CURL="$(download "$MINGW_CURL_WIN64A_BLOB")" | ||
cp "$CURL"/curl-*-mingw/bin/libcurl-arm64.dll "$OUTPUT/libcurl.dll" | ||
cp "$CURL"/curl-*-mingw/COPYING.txt "$OUTPUT/LICENSE-libcurl" | ||
rm -rf "$CURL" | ||
} | ||
|
||
function copy-curl-win { | ||
local OUTPUT="$1" | ||
|
||
CURL="$(download "$MINGW_CURL_WIN64_BLOB")" | ||
cp "$CURL"/curl-*-mingw/bin/libcurl-x64.dll "$OUTPUT/libcurl.dll" | ||
cp "$CURL"/curl-*-mingw/COPYING.txt "$OUTPUT/LICENSE-libcurl" | ||
rm -rf "$CURL" | ||
} | ||
|
||
function copy-usage { | ||
local OUTPUT="$1" | ||
|
||
cp "$WORKSPACE/docs/USAGE.md" "$OUTPUT/README.md" | ||
} | ||
|
||
function create-bundle { | ||
local BUNDLE_FILE="$1" | ||
local INPUT_DIR="$2" | ||
|
||
pushd "$INPUT_DIR" | ||
zip -r "$BUNDLE_FILE" * | ||
popd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
#!/bin/bash | ||
set -xeuo pipefail | ||
sudo apt-get update | ||
sudo apt-get install -y build-essential libpcsclite-dev libcurl4-openssl-dev gcc-mingw-w64 g++-mingw-w64 zip | ||
set -euo pipefail | ||
export DEBIAN_FRONTEND=noninteractive | ||
export DEBIAN_PRIORITY=critical | ||
|
||
apt-get -qq -o=Dpkg::Use-Pty=0 update | ||
apt-get -qq -o=Dpkg::Use-Pty=0 install -y build-essential libpcsclite-dev libcurl4-openssl-dev zip | ||
|
||
case "${1:-}" in | ||
mingw) | ||
apt-get -qq -o=Dpkg::Use-Pty=0 install gcc-mingw-w64 g++-mingw-w64 | ||
;; | ||
esac |