Bart Louwers 2025-12-18 02:01:23 +01:00 committed by GitHub
commit 9f05897aea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 43 additions and 60 deletions

37
.cirrus.yml Normal file
View File

@ -0,0 +1,37 @@
freebsd_tests_task:
name: FreeBSD Tests
freebsd_instance:
image_family: freebsd-15-0-amd64-zfs
only_if: $CIRRUS_PR != "" || $CIRRUS_BRANCH == "main"
timeout_in: 30m
env:
ZIG_LOCAL_CACHE_DIR: /tmp/zig-cache/local
ZIG_GLOBAL_CACHE_DIR: /tmp/zig-cache/global
CIRRUS_CLONE_DEPTH: 1
install_script:
- pkg update -f
- |
pkg install -y \
ca_root_nss \
curl \
devel/blueprint-compiler \
devel/gettext \
devel/git \
devel/pkgconf \
graphics/wayland \
textproc/hs-pandoc \
x11-fonts/jetbrains-mono \
x11-toolkits/gtk40 \
x11-toolkits/gtk4-layer-shell \
x11-toolkits/libadwaita
zig_install_script:
- ZIG_VERSION=$(sed -n -E 's/^[[:space:]]*\.?minimum_zig_version[[:space:]]*=[[:space:]]*"([^"]+)".*/\1/p' build.zig.zon)
- fetch -o /tmp/zig.tar.xz "https://ziglang.org/download/${ZIG_VERSION}/zig-x86_64-freebsd-${ZIG_VERSION}.tar.xz"
- install -d /opt/zig
- tar -xf /tmp/zig.tar.xz -C /opt/zig --strip-components 1
- ln -sf /opt/zig/zig /usr/local/bin/zig
- zig version
test_script:
- zig build test
- zig build
- ./zig-out/bin/ghostty +version

View File

@ -1138,63 +1138,3 @@ jobs:
- name: valgrind
run: |
nix develop -c zig build test-valgrind
# build-freebsd:
# name: Build on FreeBSD
# needs: test
# runs-on: namespace-profile-mitchellh-sm-systemd
# strategy:
# matrix:
# release:
# - "14.3"
# - "15.0"
# timeout-minutes: 10
# steps:
# - name: Checkout Ghostty
# uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
#
# - name: Start SSH
# run: |
# sudo systemctl start ssh
#
# - name: Set up FreeBSD VM
# uses: vmactions/freebsd-vm@487ce35b96fae3e60d45b521735f5aa436ecfade # v1.2.4
# with:
# release: ${{ matrix.release }}
# copyback: false
# usesh: true
# prepare: |
# pkg install -y \
# devel/blueprint-compiler \
# devel/gettext \
# devel/git \
# devel/pkgconf \
# ftp/curl \
# graphics/wayland \
# security/ca_root_nss \
# textproc/hs-pandoc \
# x11-fonts/jetbrains-mono \
# x11-toolkits/libadwaita \
# x11-toolkits/gtk40 \
# x11-toolkits/gtk4-layer-shell
# curl -L -o /tmp/zig.tar.xz "https://ziglang.org/download/${{ needs.test.outputs.zig_version }}/zig-x86_64-freebsd-${{ needs.test.outputs.zig_version }}.tar.xz" && \
# mkdir /opt && \
# tar -xf /tmp/zig.tar.xz -C /opt && \
# rm /tmp/zig.tar.xz && \
# ln -s "/opt/zig-x86_64-freebsd-${{ needs.test.outputs.zig_version }}/zig" /usr/local/bin/zig
#
# run: |
# zig env
#
# - name: Run tests
# shell: freebsd {0}
# run: |
# cd $GITHUB_WORKSPACE
# zig build test
#
# - name: Build GTK app runtime
# shell: freebsd {0}
# run: |
# cd $GITHUB_WORKSPACE
# zig build
# ./zig-out/bin/ghostty +version

View File

@ -76,6 +76,7 @@ pub fn build(b: *std.Build) !void {
try flags.appendSlice(b.allocator, &.{
"-fmath-errno",
"-fno-exceptions",
"-fPIC",
});
}

View File

@ -31,6 +31,11 @@ pub fn build(b: *std.Build) !void {
"-fno-sanitize=undefined",
"-fno-sanitize-trap=undefined",
});
if (target.result.os.tag != .windows) {
try flags.appendSlice(b.allocator, &.{
"-fPIC",
});
}
lib.addCSourceFiles(.{
.flags = flags.items,