# XML::Parser 2.47 — módulo Perl (wrapper de expat). Build-tool: intltool lo exige (XML::Parser required).
# Se instala en el árbol de perl (site_perl). perl grabó en Config.pm un cc temporal (del build de perl,
# ya inexistente) ⇒ override CC/LD con un wrapper zig en el make. Necesita expat (sellado) + perl.
name    = "perl-xml-parser"
version = "2.47"

[source]
tarball = "https://cpan.metacpan.org/authors/id/T/TO/TODDR/XML-Parser-2.47.tar.gz"
sha256  = "ad4aae643ec784f489b956abe952432871a622d4e2b5c619e8855accbfc4d1d8"

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

[build.phases]
configure = '''
ZW="$PWD/.zwrap"; mkdir -p "$ZW"
printf '#!/bin/sh\nexec /opt/zig/zig cc -mcpu=baseline "$@"\n' > "$ZW/cc"; chmod +x "$ZW/cc"
perl Makefile.PL EXPATLIBPATH=/usr/lib EXPATINCPATH=/usr/include
'''
compile   = 'make CC="$PWD/.zwrap/cc" LD="$PWD/.zwrap/cc"'
install   = 'make install DESTDIR=/out'

[deps]
build = ["pkgconf", "perl", "expat"]
