# sassc 3.6.2 — CLI sobre libsass (compila SCSS→CSS); libadwaita lo usa en build para sus estilos.
# Linkea libsass (C++) ⇒ CC='zig c++' (trae libc++ al link). SASS_LIBSASS_PATH=/usr halla headers+lib.
name    = "sassc"
version = "3.6.2"
license = "MIT"

[source]
tarball = "https://github.com/sass/sassc/archive/refs/tags/3.6.2.tar.gz"
sha256  = "608dc9002b45a91d11ed59e352469ecc05e4f58fc1259fc9a9f5b8f0f8348a03"

[build]
compiler = "zig-cc"
target   = "x86_64-linux-musl"
link     = "static"

[build.phases]
# el Makefile de sassc intenta RECOMPILAR libsass (target libsass-static → make -C $SASS_LIBSASS_PATH);
# salteo eso y linkeo a mano contra el libsass.a ya instalado. Genero sassc_version.h como el Makefile.
configure = "true"
compile   = '''
make sassc_version.h 2>/dev/null || printf '#define SASSC_VERSION "3.6.2"\n' > sassc_version.h
zig c++ -O2 -I/usr/include -c sassc.c -o sassc.o
zig c++ -static sassc.o -o sassc -L/usr/lib -lsass
'''
install   = "mkdir -p /out/usr/bin && cp sassc /out/usr/bin/sassc"

[deps]
build = ["libsass", "make"]
