# Upstream ships a release as a directory to put on PATH: the compiler finds # its standard library (stdlib/) and TinyCC's runtime (tcclib/) beside its # own executable (src/main.cpp StdlibDirs, src/jit.h JitLibPath), resolving # /proc/self/exe first, so a symlink is followed. The whole release layout is # kept under %%{_libdir}/goose with /usr/bin/goose a symlink into it, as # gambit-c and Debian's nim do, and nothing in the lookup is patched. %global goosedir %{_libdir}/goose # TinyCC's support archive libtcc1.a is produced by TinyCC itself # (`tcc -ar`); strip must leave it alone. Debuginfo extraction only looks at # executables and shared objects, so tcclib/ is not its business. %global __brp_strip_static_archive %{nil} Name: goose-lang Version: 2026.3 Release: 3%{?dist} Summary: The Goose programming language compiler # Apache-2.0: the compiler, stdlib, docs and samples # LGPL-2.1-or-later: bundled TinyCC (third_party/tinycc/COPYING) # Zlib OR Unlicense: bundled cute_spirv.h; LicenseRef-Fedora-Public-Domain: ckit.h # Unlicense: bundled subprocess.h License: Apache-2.0 AND LGPL-2.1-or-later AND (Zlib OR Unlicense) AND LicenseRef-Fedora-Public-Domain AND Unlicense URL: https://github.com/aardappel/goose Source0: %{url}/archive/refs/tags/v%{version}.tar.gz#/goose-%{version}.tar.gz # TinyCC fakes GCC's __uint128_t as a 16-byte struct but not the kernel's # __u128/__s128, which linux/types.h only defines under __SIZEOF_INT128__; # kernel-headers 7.4 uses __u128 in arm64's asm/sigcontext.h, so on aarch64 # rawhide no program including (the Goose runtime does) parsed. Patch0: goose-tinycc-u128.patch # The in-process C backend only targets x86-64 and arm64 (cmake/libtcc.cmake) ExclusiveArch: x86_64 aarch64 BuildRequires: cmake >= 3.27 BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: help2man BuildRequires: python3 # the test runner compiles the generated C with the system compiler BuildRequires: glibc-devel # Running a program in-process (the default, through the bundled TinyCC) # needs the C library's headers; `goose build` additionally needs a C # compiler, and packages with C of their own need cmake, fetched with git. Requires: glibc-devel Recommends: gcc Recommends: cmake Recommends: git-core Provides: goose = %{version}-%{release} # third_party/tinycc: commit 0fb54300b56512754221d80adda85ddb9815bceb # (release_0_9_26-2610, VERSION 0.9.28rc) with one local patch (arm64-gen.c, # Apple's float argument ABI); Fedora has no tcc, and the backend is built # into every compiler. Provides: bundled(tinycc) = 0.9.28~rc # third_party/cute_spirv: cute_spirv.h v1.09 and ckit.h from cute_framework Provides: bundled(cute_spirv) = 1.09 Provides: bundled(ckit) # third_party/subprocess: sheredom/subprocess.h, one header Provides: bundled(subprocess.h) %description Goose is a memory-safe systems programming language with no heap allocator, garbage collector or lifetime annotations: every dynamic value lives inline on data stacks the compiler manages. The compiler emits C and calls C directly through `extern fn`; its bundled TinyCC backend compiles and runs a program in-process with no build step, and `goose build` produces a native executable with the system C compiler. The same binary is the formatter, the language server and the package fetcher. The graphics, audio, ui and physics packages are not compiled in: a program importing them fetches them with git into ~/.goose on first use. %package doc Summary: Documentation and samples for the Goose programming language BuildArch: noarch Requires: %{name} = %{version}-%{release} %description doc The Goose tutorial, language reference, specification, command line and package documentation, and the sample programs. %prep %autosetup -n goose-%{version} -p1 # a prebuilt editor extension; nothing here uses it rm -f vscode/goose-language.vsix %build # CONFIG_SELINUX: TinyCC's in-process backend otherwise makes heap memory # executable with mprotect, which SELinux denies (execheap) on every default # Fedora install, so no Goose program could run in-process ("tcc: error: # mprotect failed (did you mean to configure --with-selinux?)"). TinyCC's # configure --with-selinux sets this; Goose's cmake/libtcc.cmake replaces # configure and does not. With it, code lives in a file-backed double # mapping (one RW, one RX), as TinyCC does on SELinux systems. export CFLAGS="%{build_cflags} -DCONFIG_SELINUX=1" # GOOSE_TCC_LIB_PATH: the fallback the binary names when no tcclib/ is beside # it. GOOSE_BUILTIN_LIBS stays empty: `all` fetches goose_gfx and goose_physics # from GitHub at configure time. %cmake -DGOOSE_TCC_LIB_PATH=%{goosedir}/tcclib \ -DGOOSE_BUILTIN_LIBS= %cmake_build help2man --no-info --no-discard-stderr \ --name "the Goose programming language compiler" \ --version-option=version --help-option=help \ --output goose.1 %{_vpath_builddir}/goose %install install -d %{buildroot}%{goosedir} %{buildroot}%{_bindir} install -p -m 0755 %{_vpath_builddir}/goose %{buildroot}%{goosedir}/goose ln -s ../%{_lib}/goose/goose %{buildroot}%{_bindir}/goose cp -a stdlib %{buildroot}%{goosedir}/stdlib cp -a %{_vpath_builddir}/tcclib %{buildroot}%{goosedir}/tcclib install -D -p -m 0644 goose.1 %{buildroot}%{_mandir}/man1/goose.1 install -d %{buildroot}%{_docdir}/%{name} cp -a docs samples %{buildroot}%{_docdir}/%{name}/ %check %{buildroot}%{_bindir}/goose version %{buildroot}%{_bindir}/goose toolchain || : # the compiler suite: parse, typecheck, run in-process through TinyCC, and # compile and run the generated C with the system compiler. The gfx, audio, # ui and physics fixtures import packages the compiler would fetch with git # from GitHub (they are not compiled in), so those go; the shader probes in # test/gfx/ stay, the shader compiler is always built in. rm -f test/gfx/*.goose test/audio/*.goose test/ui/*.goose test/physics/*.goose # the shader error-line check `--check`s two of those gfx fixtures sed -i 's/for name in ("gfx_err_shader_syntax", "gfx_err_shader_part"):/for name in ():/' test/run_tests.py python3 test/run_tests.py --exe %{buildroot}%{_bindir}/goose --cc gcc %files %license LICENSE third_party/tinycc/COPYING third_party/tinycc/RELICENSING %doc README.md %{_bindir}/goose %dir %{goosedir} %{goosedir}/goose %{goosedir}/stdlib/ %{goosedir}/tcclib/ %{_mandir}/man1/goose.1* %files doc %license LICENSE %{_docdir}/%{name}/ %changelog * Tue Nov 03 2026 Morgan Hough - 2026.3-3 - Apply the patch at -p1 (-2 never left %%prep) * Tue Nov 03 2026 Morgan Hough - 2026.3-2 - Define __u128/__s128 in TinyCC's predefs: kernel-headers 7.4 uses __u128 in arm64's asm/sigcontext.h, which broke every in-process run on aarch64 rawhide * Mon Nov 02 2026 Morgan Hough - 2026.3-1 - Initial package: Goose v2026.3 with its bundled TinyCC backend; the blessed gfx/audio/ui/physics packages are fetched by the compiler, not compiled in