# 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    = "irssi"
version = "1.4.5"

[source]
tarball = "https://github.com/irssi/irssi/releases/download/1.4.5/irssi-1.4.5.tar.xz"
# FIXME sha256: el wrapper lo calcula (Alpine publica sha512). sha512 de Alpine:
# sha512 = "5d80107ad625feb6d2b3ac807f517c5cfeae58986d3fbfe53ea82f2dee70396f5092abdc6ef137c5651e4515e081591079b37f0e428f69990db493cfe14e4f36"
sha256  = "72a951cb0ad622785a8962801f005a3a412736c7e7e3ce152f176287c52fe062"
patches = ["irssi-1.4.5-perl-again.patch"]

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

[build.phases]
# de build() de Alpine (traducido; el lab provee $CBUILD/$CHOST — Etapa G Fase 3; revisá --shared para estático):
compile = '''
_abuild_phase() {
abuild-muon \
		-Db_lto=true \
		-Dwith-perl=yes \
		-Dwith-perl-lib=vendor \
		-Dwith-proxy=yes \
		-Dwith-otr=yes \
		-Denable-true-color=yes \
		output .
	ninja -C output
}
_abuild_phase
'''
# de package() de Alpine (traducido $pkgdir→/out):
install = '''
_abuild_phase() {
DESTDIR="/out" muon -C output install
}
_abuild_phase
'''

[deps]
build = ["glib", "libotr", "muon", "ncurses", "openssl", "perl", "utf8proc"]
