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

    distname        upx-${version}-src
    use_xz          yes
    checksums       rmd160  da4177fdb1c59a4826fba1d6c9940d8a12b489bd \
                    sha256  6229b5564dd91dd423a5280a7c15b70fc05449d2605bb853ce076743057fcf55 \
                    size    1856512

    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
