Skip to content

Commit 1bec880

Browse files
authored
Build more sysroots. (#5)
1 parent 4255d7b commit 1bec880

File tree

4 files changed

+407
-1
lines changed

4 files changed

+407
-1
lines changed

.github/workflows/build.yml

Lines changed: 92 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
build:
10+
build-qemu:
1111
name: Build sysroot for ${{ matrix.arch }}
1212
runs-on: ubuntu-latest
1313

@@ -74,3 +74,94 @@ jobs:
7474
file: artifacts/sysroot-${{ matrix.arch }}.tar.gz
7575
tag: ${{ github.ref }}
7676
overwrite: true
77+
78+
build-raspbian:
79+
name: Build sysroot for Raspbian
80+
runs-on: ubuntu-latest
81+
82+
steps:
83+
- uses: actions/checkout@v3
84+
85+
- name: Build
86+
run: |
87+
# The sysroot script doesn't like symlinks in the path.
88+
# We shouldn't need it here, but doesn't hurt either.
89+
third_party/rpi/sysroot.py \
90+
--distro raspbian \
91+
--sysroot $(realpath .) \
92+
libc6-dev libstdc++-6-dev
93+
94+
- name: Compress
95+
run: |
96+
# shopt doesn't work for the bash script that is already running.
97+
# Run the command in a child bash instead.
98+
bash <<'EOF'
99+
shopt -s extglob
100+
tar c -zf sysroot-raspbian.tar.gz *(lib|include) usr/*(lib|include)
101+
EOF
102+
103+
- uses: actions/upload-artifact@v3
104+
with:
105+
name: sysroot
106+
path: sysroot-raspbian.tar.gz
107+
108+
- name: Upload release artifacts
109+
if: |
110+
github.event_name == 'release' &&
111+
github.repository_owner == 'toitlang'
112+
uses: svenstaro/upload-release-action@v2
113+
with:
114+
repo_token: ${{ secrets.GITHUB_TOKEN }}
115+
file: sysroot-raspbian.tar.gz
116+
tag: ${{ github.ref }}
117+
overwrite: true
118+
119+
build-linaro:
120+
name: Build sysroot for Linaro
121+
runs-on: ubuntu-latest
122+
123+
env:
124+
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
125+
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
126+
127+
steps:
128+
- name: Download
129+
run: |
130+
curl --location --output sysroot.tar.xz $ARM_LINUX_GNUEABI_SYSROOT_URL
131+
curl --location --output gcc.tar.xz $ARM_LINUX_GNUEABI_GCC_TOOLCHAIN_URL
132+
133+
- name: Extract
134+
run: |
135+
tar x --strip-components=1 -f sysroot.tar.xz
136+
tar x --strip-components=1 -f gcc.tar.xz
137+
138+
- name: Compress
139+
shell: bash
140+
run: |
141+
# shopt doesn't work for the bash script that is already running.
142+
# Run the command in a child bash instead.
143+
bash <<'EOF'
144+
shopt -s extglob
145+
tar c -zf sysroot-arm-linux-gnueabi.tar.gz \
146+
*(lib|include) \
147+
usr/*(lib|include) \
148+
arm-linux-gnueabi/*(lib|include) \
149+
arm-linux-gnueabi/libc/*(lib|include) \
150+
arm-linux-gnueabi/libc/usr/*(lib|include)
151+
EOF
152+
153+
- uses: actions/upload-artifact@v3
154+
with:
155+
name: sysroot
156+
path: sysroot-arm-linux-gnueabi.tar.gz
157+
158+
- name: Upload release artifacts
159+
if: |
160+
github.event_name == 'release' &&
161+
github.repository_owner == 'toitlang'
162+
uses: svenstaro/upload-release-action@v2
163+
with:
164+
repo_token: ${{ secrets.GITHUB_TOKEN }}
165+
file: sysroot-arm-linux-gnueabi.tar.gz
166+
tag: ${{ github.ref }}
167+
overwrite: true

third_party/rpi/LICENSE

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
This is free and unencumbered software released into the public domain.
2+
3+
Anyone is free to copy, modify, publish, use, compile, sell, or
4+
distribute this software, either in source code form or as a compiled
5+
binary, for any purpose, commercial or non-commercial, and by any
6+
means.
7+
8+
In jurisdictions that recognize copyright laws, the author or authors
9+
of this software dedicate any and all copyright interest in the
10+
software to the public domain. We make this dedication for the benefit
11+
of the public at large and to the detriment of our heirs and
12+
successors. We intend this dedication to be an overt act of
13+
relinquishment in perpetuity of all present and future rights to this
14+
software under copyright law.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.
23+
24+
For more information, please refer to <http://unlicense.org>

third_party/rpi/README.toitware

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Name: rpi
2+
Short Name: rpi
3+
URL: https://github.com/mmozeiko/rpi
4+
Version: -
5+
Revision: 4756900efa83f1cefd60e01a20b04f84b0626e0b
6+
Date: 2022-07-06
7+
License: Unlicense license
8+
9+
Description:
10+
Tools to create Raspberry pi toolchains.
11+
12+
We only use the sysroot.py file.

0 commit comments

Comments
 (0)