# Importada de Alpine aports por `hammer import-alpine` (Etapa G). PUNTO DE PARTIDA — pero
# YA trae los parches de musl de Alpine (lo que un import de nix pierde). Pendiente: el
# sha256 del tarball (el wrapper lo calcula), y adaptar build/install del shell de abuild.
name    = "usbutils"
version = "019"
license = "GPL-2.0-or-later"

[source]
tarball = "https://github.com/gregkh/usbutils/archive/refs/tags/v019.tar.gz"
# FIXME sha256: el wrapper lo calcula (Alpine publica sha512). sha512 de Alpine:
# sha512 = "30e9574d64733ab75c9a974141e52532a309fa785d9b1af03d5c00fc220c58530ebaec72e81109d420e27c1bdfbfaa99d4ed37133c826c5ad7448ba8525d5fd5"
sha256  = "f0df341a2125a4bdf2f88c77c3828af9f24c2d58e30928c45b23f41e1315df7a"

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

[build.phases]
# Proyecto meson (patrón iputils/pixman); v019 no expone meson_options.txt.
# lsusb depende de libusb-1.0 (>=1.0.22) y libudev (>=196) por pkg-config;
# libudev lo provee libudev-zero (stub daemonless, sin systemd). usb.ids viene en el
# tarball (no hace falta hwdata). LTO quitado.
configure = "meson setup output --prefix=/usr --buildtype=release -Dprefer_static=true"
compile   = "ninja -C output"
install   = "DESTDIR=/out ninja -C output install"

# depends de runtime de Alpine (NO build-deps): hwdata-usb

[deps]
build = ["libusb", "libudev-zero", "linux-headers", "pkgconf", "meson", "samurai", "python3"]
