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

    distname        upx-${version}-src
    use_xz          yes
    checksums       rmd160  80ef8d27b1766870a93841f7ebf3c6371fdb46e0 \
                    sha256  9f7a810b8a810b1ca2c5cb01ffcf23066e3fb8a51ddc406ea05bdd5d37d0b8bd \
                    size    1406744

    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
