# musl-fts 1.2.7 — implementación de fts(3) (fts_open/fts_read…) para musl, que NO la trae (es glibc/BSD).
# Apps como dolphin (kdirectorycontentscounterworker) incluyen <fts.h> y linkean fts. Compilación manual
# (sin autotools): fts.c → libfts.so + libfts.a + fts.h en /usr.
name    = "musl-fts"
version = "1.2.7"
license = "BSD-3-Clause"

[source]
tarball = "https://github.com/void-linux/musl-fts/archive/refs/tags/v1.2.7.tar.gz"
sha256  = "49ae567a96dbab22823d045ffebe0d6b14b9b799925e9ca9274d47d26ff482a6"

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

[build.phases]
configure = "printf '#define HAVE_STDINT_H 1\\n#define HAVE_STDLIB_H 1\\n#define HAVE_STRING_H 1\\n' > config.h"
compile   = "${CC:-zig cc} -fPIC -O2 -DHAVE_CONFIG_H -I. -c fts.c -o fts.o && ${CC:-zig cc} -shared -Wl,-soname,libfts.so.0 -o libfts.so.0 fts.o && ${AR:-zig ar} rcs libfts.a fts.o"
install   = "mkdir -p /out/usr/include /out/usr/lib/pkgconfig && cp fts.h /out/usr/include/ && install -m755 libfts.so.0 /out/usr/lib/ && ln -sf libfts.so.0 /out/usr/lib/libfts.so && install -m644 libfts.a /out/usr/lib/ && printf 'prefix=/usr\\nlibdir=/usr/lib\\nincludedir=/usr/include\\n\\nName: fts\\nDescription: musl fts\\nVersion: 1.2.7\\nLibs: -L${libdir} -lfts\\nCflags: -I${includedir}\\n' > /out/usr/lib/pkgconfig/fts.pc"

[deps]
build = []
