aboutsummaryrefslogtreecommitdiff
path: root/nix/tcc.nix
diff options
context:
space:
mode:
authorArslaan Pathan <[email protected]>2026-06-10 19:28:49 +1200
committerArslaan Pathan <[email protected]>2026-06-10 19:28:49 +1200
commit068e16881ac47040e31b65d1ba5d4ed64067166d (patch)
treed9adbcd85b12fd3d358d54bf5d7f503ea21ac94f /nix/tcc.nix
parente0cfbaa7e901b4ef91b75bee0046a1999436c39d (diff)
downloadyerbalinux-068e16881ac47040e31b65d1ba5d4ed64067166d.tar.xz
yerbalinux-068e16881ac47040e31b65d1ba5d4ed64067166d.zip
tcc
Diffstat (limited to 'nix/tcc.nix')
-rw-r--r--nix/tcc.nix29
1 files changed, 29 insertions, 0 deletions
diff --git a/nix/tcc.nix b/nix/tcc.nix
new file mode 100644
index 0000000..cd4cf27
--- /dev/null
+++ b/nix/tcc.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchgit, musl, linuxHeaders }:
+
+stdenv.mkDerivation {
+ name = "tcc-yerba";
+ src = fetchgit {
+ url = "https://repo.or.cz/tinycc.git";
+ rev = "34eed88a";
+ hash = "nix will yell at me but then i fix it";
+ };
+
+ configureFlags = [
+ "--cc=gcc"
+ "--ar=ar"
+ "--config-musl"
+ "--crtprefix=${musl}/lib"
+ "--sysincludepaths=${linuxHeaders}/include:{B}/include"
+ "--libpaths=${musl}/lib"
+ ];
+
+ buildPhase = ''
+ make -j$NIX_BUILD_CORES
+ '';
+
+ installPhase = ''
+ mkdir -p $out/bin $out/lib
+ cp tcc $out/bin/
+ cp libtcc.a $out/lib/ 2>/dev/null || true
+ '';
+}