# -*- 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.2.0 v
    github.tarball_from releases
    revision        0

    distname        upx-${version}-src
    use_xz          yes
    checksums       rmd160  59729f0bb92826370e20827cbc32ff4caec52775 \
                    sha256  af99e526d5759de94412aea1104d5e4ca406cb725295f8633ecc9e843dc1ce1c \
                    size    1764768

    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
