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

github.setup            buchen portfolio 0.82.1
github.tarball_from     archive
name                    portfolio-performance
categories              finance
license                 EPL-1
maintainers             nomaintainer
description             A simple tool to calculate the overall performance \
                        of an investment portfolio.
long_description        An open source tool to calculate the overall performance \
                        of an investment portfolio - across all accounts - using \
                        True-Time Weighted Return or Internal Rate of Return.
homepage                https://www.portfolio-performance.info/en/

checksums               rmd160  0f301a0d654821db0ab3675992cb3e2d48845b0e \
                        sha256  9d719065b4e2cfc34b1fea71d5d7989040af641f1e4d6c3806913b2aad0c00cc \
                        size    6977783

java.version            21
java.fallback           openjdk21
depends_build-append    port:maven3
use_configure           no

set maven_local_repository ${worksrcpath}/.m2/repository
pre-build {
    file mkdir ${maven_local_repository}
}

build.cmd               mvn3
build.pre_args          clean verify -f portfolio-app -Ppackage-distro \
                        -Dmaven.repo.local=${maven_local_repository} \
                        -DskipTests

destroot {
    if {${build_arch} eq "arm64"} {
        copy -- ${worksrcpath}/portfolio-product/target/products/name.abuchen.portfolio.product/macosx/cocoa/aarch64/PortfolioPerformance.app \
            ${destroot}${applications_dir}
    } else {
        copy -- ${worksrcpath}/portfolio-product/target/products/name.abuchen.portfolio.product/macosx/cocoa/x86_64/PortfolioPerformance.app \
            ${destroot}${applications_dir}
    }
}
