# -*- 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           qt5 1.0
PortGroup           java 1.0
PortGroup           cmake 1.1

github.setup        PrismLauncher PrismLauncher 8.0
revision            0
categories          games
platforms           darwin
license             GPL-3 Apache-2
maintainers         nomaintainer
description         A custom launcher for Minecraft
long_description    PrismLauncher is ${description} that allows you to easily manage \
                    multiple installations of Minecraft at once.
homepage            https://prismlauncher.org/

fetch.type          git

post-fetch {
    system -W ${worksrcpath} "git submodule update --init"
}

patchfiles          patch-CMakeLists.txt.diff

cmake.build_type    Release

# Use LTS Java as fallback
java.fallback       openjdk11
java.version        1.8+

compiler.cxx_standard 2017

qt5.depends_component \
                    qtsvg

depends_lib-append  port:zlib
depends_build-append \
                    path:share/ECM/cmake/ECMConfig.cmake:kde-extra-cmake-modules

cmake.install_prefix \
                    ${applications_dir}

configure.pre_args-replace \
                    -DCMAKE_INSTALL_NAME_DIR="${cmake.install_prefix}/lib" -DCMAKE_INSTALL_NAME_DIR="${cmake.install_prefix}/PrismLauncher.app/Contents/MacOS"
configure.args-append \
                    -DLauncher_QT_VERSION_MAJOR=5 \
                    -DLauncher_BUILD_PLATFORM=macports
