Skip to content

Commit

Permalink
Support prebuilt binary on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
shirok committed Jun 28, 2024
1 parent 5c3bf34 commit e4e74c2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/self-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
test-setup-latest:
strategy:
matrix:
platform: [ubuntu-latest, macos-12]
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: shirok/setup-gauche@main
Expand All @@ -21,7 +21,7 @@ jobs:
test-setup-snapshot:
strategy:
matrix:
platform: [ubuntu-latest, macos-12]
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: shirok/setup-gauche@main
Expand All @@ -33,7 +33,10 @@ jobs:
run: gosh -V

test-setup-binary:
runs-on: ubuntu-latest
strategy:
matrix:
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: shirok/setup-gauche@main
with:
Expand Down
7 changes: 7 additions & 0 deletions doc/Hacking.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Note for devleopers

- Main processing is done by the shell script `download-and-install-gauche.sh`.

- Pre-build binary tarball is fetched from the repo
`https://github.com/practical-scheme/setup-gauche-binary`. To rebuild
the tarball, you have to do it in that repo.
16 changes: 13 additions & 3 deletions download-and-install-gauche.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# Constants
get_gauche_url="https://raw.githubusercontent.com/practical-scheme/get-gauche/master/get-gauche.sh"
binary_url="https://github.com/practical-scheme/setup-gauche-binary/releases/download/v1/gauche-binary-ubuntu-latest.tar.gz"
binary_url="https://github.com/practical-scheme/setup-gauche-binary/releases/download/v1"

# Arguments
version=$1
Expand Down Expand Up @@ -39,8 +39,18 @@ if [ ! -z "$configure_opts" ]; then
fi

if [ "$binary" = 'true' ]; then
curl -L -f -o /tmp/gauche-binary-ubuntu-latest.tar.gz $binary_url
sudo tar x -C / -z -v -f /tmp/gauche-binary-ubuntu-latest.tar.gz
platform=`uname -s`
case "$platform" in
Linux)
binary_tarball=gauche-binary-ubuntu-latest.tar.gz ;;
Darwin)
binary_tarball=gauche-binary-macos-latest.tar.gz ;;
*)
echo "Prebuilt binary is not available on this platform: $platform"
exit 1 ;;
esac
curl -L -f -o /tmp/$binary_tarball $binary_url/$binary_tarball
sudo tar x -C / -z -v -f /tmp/$binary_tarball
else
curl -f -o get-gauche.sh $get_gauche_url
chmod +x get-gauche.sh
Expand Down

0 comments on commit e4e74c2

Please sign in to comment.