# -*- 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        jitsi jitsi-meet-electron 2024.6.0 v
github.tarball_from archive
revision            0

categories          net
installs_libs       no
license             Apache-2
maintainers         {@takikawa simplyrobot.org:agile.ice1123} openmaintainer
description         Jitsi Meet Electron
long_description    Jistsi Meet Electron is a client for the open-source Jitsi Meet teleconferencing system

checksums           rmd160  86a95c4ee05049932a9f2f1fb06df81b6d4dc3d5 \
                    sha256  10cce8a14c8cf8df220b339ee30131e0a90565c6eeea108e909e7e9b7ddb711c \
                    size    794929

depends_build       port:yarn

build.env-append    CSC_IDENTITY_AUTO_DISCOVERY=false

use_configure       no

build {
    # Fetch and build JS dependencies
    # First line needed to work around https://github.com/jitsi/jitsi-meet-electron/issues/812
    system -W ${worksrcpath} "${build.env} yarn add jsonfile"
    system -W ${worksrcpath} "${build.env} yarn --frozen-lockfile"

    # Build electron app
    system -W ${worksrcpath} "${build.env} yarn run build"
    system -W ${worksrcpath} "${build.env} yarn run electron-builder --mac --dir"
}

destroot {
    copy {*}[glob ${worksrcpath}/dist/mac*/Jitsi\ Meet.app] ${destroot}${applications_dir}
}