|
1 | 1 | #!/usr/bin/env -S bash ../.port_include.sh
|
2 | 2 |
|
3 | 3 | port='zig'
|
4 |
| -version='0.12.0-dev.141+ddf5859c2' |
| 4 | +version='0.15.0-dev.208+8acedfd5b' |
5 | 5 | files=(
|
6 |
| - 'https://github.com/ziglang/zig-bootstrap/archive/34644ad5032c58e39327d33d7f96d63d7c330003.tar.gz#e502ae17b01f03c627927d60b2e26b5f7f83b0e8be27b6ef55511d52e5892ccf' |
7 |
| - 'https://github.com/ziglang/zig/archive/ddf5859c22527c6bf5d8bb13310db996fcc58874.tar.gz#9adaf787b6233cfbe784d2d8a72398784f3742e2f5ac700cbd59ba952f9491ad' |
| 6 | + 'https://github.com/ziglang/zig-bootstrap/archive/03a95efaf981b9cee59af8027304c37a59d36fc0.tar.gz#6541363baacc64ede96bcfb81b562a8a825d65fb4a05ab4e321be74c656a61d1' |
| 7 | + 'https://github.com/ziglang/zig/archive/8acedfd5baabab705946ad097746f9183ef62420.tar.gz#062ad37a4b501340e10b121ef4f825c411ec51385d34666e5f11f18ef9d6d6d9' |
8 | 8 | )
|
9 | 9 |
|
10 | 10 | # The actual directory to build in.
|
11 |
| -workdir='zig-bootstrap-34644ad5032c58e39327d33d7f96d63d7c330003' |
| 11 | +workdir='zig-bootstrap-03a95efaf981b9cee59af8027304c37a59d36fc0' |
12 | 12 | # The newer Zig directory we move into the workdir.
|
13 |
| -zigdir='zig-ddf5859c22527c6bf5d8bb13310db996fcc58874' |
| 13 | +zigdir='zig-8acedfd5baabab705946ad097746f9183ef62420' |
| 14 | + |
| 15 | +# This is read in the build script to set gcc_dir in the custom libc definition file |
| 16 | +# TODO: Maybe we can just symlink the crt files to /usr/local/lib or otherwise remove the need for a hardcoded version |
| 17 | +export SERENITY_GCC_VERSION='13.2.0' |
14 | 18 |
|
15 | 19 | post_fetch() {
|
| 20 | + # NOTE: Running this multiple times is a massive footgun as patches only get applied once, the |
| 21 | + # next time we'd end up with a clean copy of the original Zig sources. |
| 22 | + if [ -f .post-fetch-executed ]; then |
| 23 | + return |
| 24 | + fi |
| 25 | + run touch .post-fetch-executed |
| 26 | + |
16 | 27 | # Move the newer version of Zig into the bootstrap
|
17 | 28 | run rm -rf zig
|
18 |
| - run mv "../${zigdir}" zig |
| 29 | + run cp -r "../${zigdir}" zig |
19 | 30 |
|
20 |
| - # Copy the scripts that the build process will use |
21 |
| - run mkdir -p out |
22 |
| - run cp -r "${PORT_META_DIR}/scripts" out/ |
| 31 | + # Copy libSystem definitions which are required on macOS, once we set $ZIG_LIBC it will no |
| 32 | + # longer be found in its original place |
| 33 | + run cp zig/lib/libc/darwin/libSystem.tbd "${DESTDIR}/usr/lib/" |
23 | 34 | }
|
24 | 35 |
|
25 | 36 | build() {
|
| 37 | + if [ ! -f "${DESTDIR}/usr/local/lib/gcc/${SERENITY_ARCH}-pc-serenity/${SERENITY_GCC_VERSION}/crtbeginS.o" ] || |
| 38 | + [ ! -f "${DESTDIR}/usr/local/lib/gcc/${SERENITY_ARCH}-pc-serenity/${SERENITY_GCC_VERSION}/crtendS.o" ]; then |
| 39 | + echo "crtbeginS.o or crtendS.o could not be found, ensure the GCC port is installed." |
| 40 | + exit 1 |
| 41 | + fi |
| 42 | + |
26 | 43 | host_env
|
27 | 44 | cd "${workdir}"
|
28 | 45 | ./build "${SERENITY_ARCH}-serenity-none" "native"
|
|
0 commit comments