# intltool 0.51.0 — herramientas de i18n (intltool-merge/update/extract, perl). Build-tool: lo exige el
# configure de libqalculate (IT_PROG_INTLTOOL, incondicional pese a --disable-nls). Scripts perl ⇒ dep perl.
# Autotools. Parche conocido: intltool 0.51 usa `\${\` en regex Perl que perl 5.26+ rechaza ⇒ sed fix.
name    = "intltool"
version = "0.51.0"

[source]
tarball = "https://launchpad.net/intltool/trunk/0.51.0/+download/intltool-0.51.0.tar.gz"
sha256  = "67c74d94196b153b774ab9f89b2fa6c6ba79352407037c8c14d5aeb334e959cd"

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

[build.phases]
# Fix regex Perl 5.26+: intltool-update.in usa `${\` sin escapar ⇒ "Unescaped left brace". sed lo arregla.
configure = '''
sed -i 's/\\\${\\\\@\\\${/\\\\@{\\\\@/g;s/\\\${\\\\(/\\\\(/g' intltool-update.in 2>/dev/null || true
./configure --prefix=/usr
'''
compile   = 'make'
install   = 'make install DESTDIR=/out'

[deps]
build = ["pkgconf", "perl", "perl-xml-parser"]
