# -*- 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

PortSystem          1.0
PortGroup           cmake   1.1
PortGroup           github  1.0

name                upx
categories          archivers
license             GPL-2+
maintainers         {l2dy @l2dy} \
                    {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer

description         compress or expand executable files
long_description    UPX is a free, portable, extendable, high-performance \
                    executable packer for several executable formats.
homepage            https://upx.github.io/

if {${name} eq ${subport}} {
    github.setup    upx upx 5.0.2 v
    github.tarball_from releases
    revision        0

    distname        upx-${version}-src
    use_xz          yes
    checksums       rmd160  b9afd6dfc7596870ad2ea098ce03e1a102b8cc47 \
                    sha256  209b219bbcfa58c249ffe6eba3c244e0910fa8be792b5521e4daf938167f05cc \
                    size    1351136

    conflicts       upx-devel
}

subport upx-devel {
    github.setup    upx upx bbb886ae4d6f3d3e35c7e0475a0506d9e93aeb41
    github.livecheck.branch devel
    version         20250726
    revision        0

    fetch.type      git

    post-fetch {
        system -W ${worksrcpath} "git submodule update --init"
    }

    conflicts       upx
}

depends_lib-append  port:zlib \
                    port:ucl

compiler.cxx_standard \
                    2017

configure.args      -DUPX_CONFIG_DISABLE_WERROR=ON
