Skip to content

Commit

Permalink
Build more sysroots. (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
floitsch authored May 7, 2023
1 parent 4255d7b commit 1bec880
Show file tree
Hide file tree
Showing 4 changed files with 407 additions and 1 deletion.
93 changes: 92 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:

jobs:
build:
build-qemu:
name: Build sysroot for ${{ matrix.arch }}
runs-on: ubuntu-latest

Expand Down Expand Up @@ -74,3 +74,94 @@ jobs:
file: artifacts/sysroot-${{ matrix.arch }}.tar.gz
tag: ${{ github.ref }}
overwrite: true

build-raspbian:
name: Build sysroot for Raspbian
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Build
run: |
# The sysroot script doesn't like symlinks in the path.
# We shouldn't need it here, but doesn't hurt either.
third_party/rpi/sysroot.py \
--distro raspbian \
--sysroot $(realpath .) \
libc6-dev libstdc++-6-dev
- name: Compress
run: |
# shopt doesn't work for the bash script that is already running.
# Run the command in a child bash instead.
bash <<'EOF'
shopt -s extglob
tar c -zf sysroot-raspbian.tar.gz *(lib|include) usr/*(lib|include)
EOF
- uses: actions/upload-artifact@v3
with:
name: sysroot
path: sysroot-raspbian.tar.gz

- name: Upload release artifacts
if: |
github.event_name == 'release' &&
github.repository_owner == 'toitlang'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: sysroot-raspbian.tar.gz
tag: ${{ github.ref }}
overwrite: true

build-linaro:
name: Build sysroot for Linaro
runs-on: ubuntu-latest

env:
ARM_LINUX_GNUEABI_SYSROOT_URL: https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-linux-gnueabi/sysroot-glibc-linaro-2.25-2019.12-arm-linux-gnueabi.tar.xz
ARM_LINUX_GNUEABI_GCC_TOOLCHAIN_URL: https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-linux-gnueabi/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabi.tar.xz

steps:
- name: Download
run: |
curl --location --output sysroot.tar.xz $ARM_LINUX_GNUEABI_SYSROOT_URL
curl --location --output gcc.tar.xz $ARM_LINUX_GNUEABI_GCC_TOOLCHAIN_URL
- name: Extract
run: |
tar x --strip-components=1 -f sysroot.tar.xz
tar x --strip-components=1 -f gcc.tar.xz
- name: Compress
shell: bash
run: |
# shopt doesn't work for the bash script that is already running.
# Run the command in a child bash instead.
bash <<'EOF'
shopt -s extglob
tar c -zf sysroot-arm-linux-gnueabi.tar.gz \
*(lib|include) \
usr/*(lib|include) \
arm-linux-gnueabi/*(lib|include) \
arm-linux-gnueabi/libc/*(lib|include) \
arm-linux-gnueabi/libc/usr/*(lib|include)
EOF
- uses: actions/upload-artifact@v3
with:
name: sysroot
path: sysroot-arm-linux-gnueabi.tar.gz

- name: Upload release artifacts
if: |
github.event_name == 'release' &&
github.repository_owner == 'toitlang'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: sysroot-arm-linux-gnueabi.tar.gz
tag: ${{ github.ref }}
overwrite: true
24 changes: 24 additions & 0 deletions third_party/rpi/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org>
12 changes: 12 additions & 0 deletions third_party/rpi/README.toitware
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Name: rpi
Short Name: rpi
URL: https://github.com/mmozeiko/rpi
Version: -
Revision: 4756900efa83f1cefd60e01a20b04f84b0626e0b
Date: 2022-07-06
License: Unlicense license

Description:
Tools to create Raspberry pi toolchains.

We only use the sysroot.py file.
Loading

0 comments on commit 1bec880

Please sign in to comment.