# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           github 1.0
PortGroup           cmake 1.1
PortGroup           qt6 1.0

github.setup        LongSoft UEFITool 72 A
github.tarball_from archive
name                [string tolower ${github.project}]
revision            0
categories          sysutils
maintainers         {i0ntempest @i0ntempest} openmaintainer
license             BSD-2

description         UEFI firmware image viewer and editor
long_description    ${github.project} is a cross-platform open source application written in C++/Qt, that parses\
                    UEFI-compatible firmware image into a tree structure, verifies image's integrity and\
                    provides a GUI to manipulate image's elements.

checksums           rmd160  45260b924f98c0e6f61d44c4590c11cc2a3735d1 \
                    sha256  3cace3f617c0023ffed4b95009752a50c55fe22cbba62d760b85f800ce74697f \
                    size    1890688

qt6.depends_build   qttools

post-patch {
    reinplace "s|/Applications|${applications_dir}|g" ${worksrcpath}/${github.project}/CMakeLists.txt
    set plistfile   ${worksrcpath}/${github.project}/Info.plist
    system "/usr/libexec/PlistBuddy -c \"Add :CFBundleShortVersionString string ${github.tag_prefix}${version}\" ${plistfile}"
    system "/usr/libexec/PlistBuddy -c \"Add :CFBundleVersion string ${version}\" ${plistfile}"
}

configure.args-append \
                    -DQHEXVIEW_USE_QT5=OFF
