# -*- 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 73 A
github.tarball_from archive
name                [string tolower ${github.project}]
revision            0
categories          sysutils devel
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  1e96e3edcea74a642a8978a6a2cb440ab1e50b5d \
                    sha256  81d9944d75e27d4afbc8559d9ba913552006fd21ce9cadf357a4a0f58e59507e \
                    size    2400878

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
