mirror of https://github.com/janet-lang/janet
Compare commits
8 Commits
4ed7db4f91
...
d0d551d739
Author | SHA1 | Date |
---|---|---|
Gautham | d0d551d739 | |
Gautham | 71a123fef7 | |
Gautham | 3f40c8d7fb | |
Gautham | 983c2e5499 | |
Gautham | eebb4c3ade | |
Gautham | 50425eac72 | |
Gautham | 382ff77bbe | |
Gautham | bf680fb5d3 |
|
@ -0,0 +1,38 @@
|
||||||
|
#!/bin/sh
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
COSMO_DIR="/sc/cosmocc"
|
||||||
|
|
||||||
|
# build x86_64
|
||||||
|
X86_64_CC="/sc/cosmocc/bin/x86_64-unknown-cosmo-cc"
|
||||||
|
X86_64_AR="/sc/cosmocc/bin/x86_64-unknown-cosmo-ar"
|
||||||
|
mkdir -p /sc/cosmocc/x86_64
|
||||||
|
make -j CC="$X86_64_CC" AR="$X86_64_AR" HAS_SHARED=0 JANET_NO_AMALG=1
|
||||||
|
cp build/janet /sc/cosmocc/x86_64/janet
|
||||||
|
make clean
|
||||||
|
|
||||||
|
# build aarch64
|
||||||
|
AARCH64_CC="/sc/cosmocc/bin/aarch64-unknown-cosmo-cc"
|
||||||
|
AARCH64_AR="/sc/cosmocc/bin/aarch64-unknown-cosmo-ar"
|
||||||
|
mkdir -p /sc/cosmocc/aarch64
|
||||||
|
make -j CC="$AARCH64_CC" AR="$AARCH64_AR" HAS_SHARED=0 JANET_NO_AMALG=1
|
||||||
|
cp build/janet /sc/cosmocc/aarch64/janet
|
||||||
|
make clean
|
||||||
|
|
||||||
|
# fat binary
|
||||||
|
apefat () {
|
||||||
|
OUTPUT="$1"
|
||||||
|
OLDNAME_X86_64="$(basename -- "$2")"
|
||||||
|
OLDNAME_AARCH64="$(basename -- "$3")"
|
||||||
|
TARG_FOLD="$(dirname "$OUTPUT")"
|
||||||
|
"$COSMO_DIR/bin/apelink" -l "$COSMO_DIR/bin/ape-x86_64.elf" \
|
||||||
|
-l "$COSMO_DIR/bin/ape-aarch64.elf" \
|
||||||
|
-M "$COSMO_DIR/bin/ape-m1.c" \
|
||||||
|
-o "$OUTPUT" \
|
||||||
|
"$2" \
|
||||||
|
"$3"
|
||||||
|
cp "$2" "$TARG_FOLD/$OLDNAME_X86_64.x86_64"
|
||||||
|
cp "$3" "$TARG_FOLD/$OLDNAME_AARCH64.aarch64"
|
||||||
|
}
|
||||||
|
|
||||||
|
apefat /sc/cosmocc/janet.com /sc/cosmocc/x86_64/janet /sc/cosmocc/aarch64/janet
|
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
sudo apt update
|
||||||
|
sudo apt-get install -y ca-certificates libssl-dev\
|
||||||
|
qemu qemu-utils qemu-user-static\
|
||||||
|
texinfo groff\
|
||||||
|
cmake ninja-build bison zip\
|
||||||
|
pkg-config build-essential autoconf re2c
|
||||||
|
|
||||||
|
# download cosmocc
|
||||||
|
cd /sc
|
||||||
|
wget https://github.com/jart/cosmopolitan/releases/download/3.3.3/cosmocc-3.3.3.zip
|
||||||
|
mkdir -p cosmocc
|
||||||
|
cd cosmocc
|
||||||
|
unzip ../cosmocc-3.3.3.zip
|
||||||
|
|
||||||
|
# register
|
||||||
|
cd /sc/cosmocc
|
||||||
|
sudo cp ./bin/ape-x86_64.elf /usr/bin/ape
|
||||||
|
sudo sh -c "echo ':APE:M::MZqFpD::/usr/bin/ape:' >/proc/sys/fs/binfmt_misc/register"
|
|
@ -67,35 +67,23 @@ jobs:
|
||||||
name: Build release binaries for Cosmo
|
name: Build release binaries for Cosmo
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout the repository
|
||||||
|
uses: actions/checkout@master
|
||||||
- name: create build folder
|
- name: create build folder
|
||||||
run: |
|
run: |
|
||||||
sudo mkdir -p /sc
|
sudo mkdir -p /sc
|
||||||
sudo chmod -R 0777 /sc
|
sudo chmod -R 0777 /sc
|
||||||
- name: Checkout superconfigure repo
|
- name: setup Cosmopolitan Libc
|
||||||
working-directory: /sc
|
run: bash ./.github/cosmo/setup
|
||||||
run: git clone https://github.com/ahgamut/superconfigure
|
|
||||||
- name: support ape bins and SSL things
|
|
||||||
working-directory: /sc/superconfigure
|
|
||||||
run: bash ./.github/scripts/setup
|
|
||||||
- name: build Cosmo
|
|
||||||
working-directory: /sc/superconfigure
|
|
||||||
run: bash ./.github/scripts/cosmo
|
|
||||||
- name: clone Janet latest commit
|
|
||||||
working-directory: /sc/superconfigure
|
|
||||||
run: |
|
|
||||||
make o/lang/janet/downloaded
|
|
||||||
cd o/lang/janet/janet
|
|
||||||
git pull origin master
|
|
||||||
- name: Set the version
|
- name: Set the version
|
||||||
run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
|
run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
|
||||||
- name: Set the platform
|
- name: Set the platform
|
||||||
run: echo "platform=cosmo" >> $GITHUB_ENV
|
run: echo "platform=cosmo" >> $GITHUB_ENV
|
||||||
- name: build Janet APE binary
|
- name: build Janet APE binary
|
||||||
working-directory: /sc/superconfigure
|
run: bash ./.github/cosmo/build
|
||||||
run: make o/lang/janet/built.fat
|
|
||||||
- name: push binary to github
|
- name: push binary to github
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
draft: true
|
draft: true
|
||||||
files: |
|
files: |
|
||||||
/sc/superconfigure/results/bin/janet.com
|
/sc/cosmocc/janet.com
|
||||||
|
|
Loading…
Reference in New Issue