Files
kappa-packages/stable/tcc.kap
T
2026-08-18 01:51:35 -04:00

47 lines
1.5 KiB
Plaintext

/*
* tcc — Tiny C Compiler. The fast, tiny, self-hosting C compiler.
*
* Built with the stable 0.9.27 release plus the glibc-2.34 patch
* (bcheck.c's __malloc_hook was removed from glibc; the bounds checker
* is disabled on glibc >= 2.34, where the API no longer exists).
* The patch lives in the repo: patches/tcc-0.9.27-glibc-2.34.patch.
*
* The check phase verifies self-hosting: tcc compiles its own compiler
* and the result runs.
*/
package "tcc" {
const version = "0.9.27"
const source = "https://download.savannah.nongnu.org/releases/tinycc/tcc-${version}.tar.bz2"
sha256 = "de23af78fca90ce32dff2dd45b3432b2334740bb9bb7b05bf60fdbfc396ceb9c"
license = "LGPL-2.1-or-later"
provides = ["tcc", "cc"]
depends = [
{ name = "make" },
]
prepare {
curl -L -O ${source}
echo "de23af78fca90ce32dff2dd45b3432b2334740bb9bb7b05bf60fdbfc396ceb9c tcc-${version}.tar.bz2" | sha256sum -c -
tar xf tcc-${version}.tar.bz2 --strip-components=1
curl -L -O https://files.spectoria.dev/kappa-packages/patches/tcc-0.9.27-glibc-2.34.patch
echo "d5c2b6865cd4f80c646ffc85a0fe53e15e3a1877e0a8d29556d01742e5094d6e tcc-0.9.27-glibc-2.34.patch" | sha256sum -c -
patch -p1 < tcc-0.9.27-glibc-2.34.patch
}
build {
./configure --prefix=${prefix}
make -j${jobs}
}
check {
./tcc -o tcc-selfhost tcc.c -I. -DONE_SOURCE -lm -ldl
./tcc-selfhost -v
}
install {
make DESTDIR=${destdir} install
}
}