# -*- 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           github 1.0

github.setup        libimobiledevice libimobiledevice-glue 1.3.2
revision            0

categories          devel

license             LGPL-2.1
maintainers         {i0ntempest @i0ntempest} openmaintainer

description         Library with common code used by the libraries and tools around \
                    the libimobiledevice project

long_description    The main functionality provided by this library are socket helper \
                    functions and a platform independent thread/mutex implementation. \
                    Besides that it comes with a number of string, file, and plist helper \
                    functions, as well as some other commonly used code that was \
                    originally duplicated in the dedicated projects.

homepage            https://www.libimobiledevice.org/

checksums           rmd160  20747d1a724e33234307a17ae17d560d4efa9b6a \
                    sha256  6489a3411b874ecd81c87815d863603f518b264a976319725e0ed59935546774 \
                    size    338101

depends_build-append \
                    path:bin/pkg-config:pkgconfig

depends_lib-append  port:libplist

configure.args      --disable-silent-rules

subport libimobiledevice-glue-devel {
    github.setup    libimobiledevice libimobiledevice-glue 077963174182b6f71f8d8d4e373482addcf4ff3d
    version         20250907
    revision        0

    checksums       rmd160  68b48a4b60c419227365d141b55f2f6f684152d9 \
                    sha256  5234051a946418c8f3453c70ebc0f7a05b5cf857320081e29aeda821f68d0142 \
                    size    60622

    conflicts       libimobiledevice-glue

    depends_build-append \
                    port:autoconf \
                    port:automake \
                    port:libtool

    depends_lib-replace port:libplist port:libplist-devel

    configure.cmd   ./autogen.sh

    pre-configure {
        system -W ${worksrcpath} "echo ${version} > .tarball-version"
    }

    livecheck.url   ${github.homepage}/commits/${github.livecheck.branch}.atom
}

if {${subport} eq ${name}} {
    github.tarball_from     releases
    use_bzip2               yes
} else {
    github.tarball_from     archive
}
