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

github.setup        libimobiledevice ideviceinstaller 1.2.0
github.tarball_from archive
revision            0

categories          devel

license             GPL-2+
maintainers         {ijackson @JacksonIsaac} {i0ntempest @i0ntempest} openmaintainer

description         Manage apps of iOS devices.

long_description    ideviceinstaller is a tool to interact with the installation_proxy \
    of an iOS device allowing to install, upgrade, uninstall, archive, restore \
    and enumerate installed or archived apps. \
    It makes use of the libimobiledevice library that allows communication \
    with iOS devices.

homepage            https://www.libimobiledevice.org/

checksums           rmd160  d04da5fbb7878373d8cfbe012f6a89e1ab3ba354 \
                    sha256  95d83ec07addd4e2f5a020c8cdbeb3a48eda20abcab9c6820216d07ab55b3b59 \
                    size    26038

patchfiles          patch-no-Werror.diff

depends_build-append \
                    port:autoconf \
                    port:automake \
                    port:libtool \
                    path:bin/pkg-config:pkgconfig

depends_lib-append  port:libimobiledevice \
                    port:libplist \
                    port:libzip

configure.cmd       ./autogen.sh

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

post-destroot {
    xinstall -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 ${worksrcpath}/COPYING ${destroot}${prefix}/share/doc/${name}/
}

subport ideviceinstaller-devel {
    github.setup    libimobiledevice ideviceinstaller 1762d5f12fc590b48877aac644ba3bccb72f33f9
    github.tarball_from archive
    version         20251030

    checksums       rmd160  77a0db55a6ebf797f7aab7f41f0619c813a5855a \
                    sha256  50f4ee9c4214d863f112b031d5cfc824471c764e2abe04136c5f94f2ad2bfa16 \
                    size    26038

    depends_lib-replace port:libimobiledevice \
                        port:libimobiledevice-devel
    depends_lib-replace port:libplist port:libplist-devel

    conflicts       ideviceinstaller

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

if {${subport} eq ${name}} {
    conflicts       ideviceinstaller-devel
}
