# -*- 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
PortGroup           openssl 1.0

github.setup        nlitsme extfstools 3541ca0950e095b726eae3c43b12b4b95667c56d
set cpputils_commit ec9438080a2c9ee7b9595dd7acad02b25f1af79c
set itslib_commit   49f88ee0f292f24bbc7a32d2cbdeb8821d40ad3d
version             20230925-[string range ${git.branch} 0 7]
revision            0
checksums           rmd160  e9b2771fec2334d37e1f67509c5a40d9392670ed \
                    sha256  9ae4c256b002dd74288727c22d4d0591ce7112802f4274019f9cf9b4cde3ffe3 \
                    size    18180

categories          sysutils
maintainers         nomaintainer
license             MIT

description         tools for reading ext2/ext3/ext4 filesystem images

long_description    ${name} provides {*}${description}.

set main_distfile   [lindex ${distfiles} 0]
set cpputils_distname cpputils-${cpputils_commit}
set cpputils_distfile ${cpputils_distname}${extract.suffix}
set itslib_distname legacy-itslib-library-${itslib_commit}
set itslib_distfile ${itslib_distname}${extract.suffix}

checksums-prepend   ${main_distfile}
checksums-append    ${cpputils_distfile} \
                    rmd160  018e5b38c537d4140bd3e1f16ee8e582f3c0f797 \
                    sha256  622a7f92a0cb5171a716c8ec77c498cbb59aab921ce2320e6996069dbf91543a \
                    size    76540 \
                    ${itslib_distfile} \
                    rmd160  9048f5c0ed28208bbac9268feae2d4af24587325 \
                    sha256  6d925e74758e151a039bd073d534820cc58863f3b2170b16655da22b8a647282 \
                    size    73546

distfiles           ${main_distfile}:main \
                    ${cpputils_distfile}:cpputils \
                    ${itslib_distfile}:itslib

github.tarball_from archive
master_sites        ${github.master_sites}:main \
                    https://github.com/${github.author}/cpputils/archive/${cpputils_commit}:cpputils \
                    https://github.com/${github.author}/legacy-itslib-library/archive/${itslib_commit}:itslib

openssl.branch      3

post-extract {
    file mkdir ${worksrcpath}/symlinks
    ln -s ../../${cpputils_distname} ${worksrcpath}/symlinks/cpputils
    ln -s ../../${itslib_distname} ${worksrcpath}/symlinks/itslib
}

patchfiles          boilerplate.cmake.patch

compiler.cxx_standard 2017

# Use cpputils to avoid boost dependency.
configure.args-append \
                    -DCMAKE_DISABLE_FIND_PACKAGE_Boost=ON
