# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
set 02_decompress_version 20180319
maintainers {ryandesign @ryandesign} openmaintainer
description utility to decode pbzx streams in xip files
long_description ${name} is a ${description}.
homepage http://newosxbook.com/articles/OTA5.html
master_sites http://newosxbook.com/code/listings/pbzx.c?dummy=:pbzx \
http://newosxbook.com/code/listings/02_decompress.c?dummy=:decompress
# Upstream has updated 02_decompress.c in a way that is not compatible with pbzx.c.
# Upstream appears to have deprecated pbzx in favor of ota, yet ota does not have
# the capability to simply extract a pbxz file as pbxz does.
master_sites macports_distfiles
set pbzx.c pbzx-${version}.c
set 02_decompress.c 02_decompress-${02_decompress_version}.c
distfiles ${pbzx.c}:pbzx \
${02_decompress.c}:decompress
rmd160 19731be9fc5e99257a3ebdddc7e0999543f48442 \
sha256 44a780291ec8565123c1a5b064c3e01e9a18f8882e18d2278f995d2479759f9f \
rmd160 e698abf6f3054b198d1f1c6acd1126bdaec8b943 \
sha256 244f2503675e1c14e35df5851d04db0cf067e9f8cd4c9b423ce917445740ae8e \
copy ${distpath}/${pbzx.c} ${worksrcpath}/pbzx.c
copy ${distpath}/${02_decompress.c} ${worksrcpath}/02_decompress.c
system -W ${worksrcpath} "${configure.cc} ${configure.cflags} ${configure.cppflags} ${configure.ldflags} [get_canonical_archflags] pbzx.c 02_decompress.c -llzma -o pbzx"
xinstall ${worksrcpath}/pbzx ${destroot}${prefix}/bin
livecheck.url [lindex [split ${master_sites} ?] 0]