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

github.setup        libretro RetroArch 1.10.2 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            0

name                retroarch
license             GPL-3
maintainers         {gmail.com:audvare @Tatsh} openmaintainer
categories          emulators games
description         Frontend for the libretro API.
long_description    {*}${description}

checksums           rmd160  2640d4522c8492e333505c36dd2b8b7bfec57e3a \
                    sha256  03426b727b92bc3a2007c7c0c30c354f5f6c15cbbdef374e676c8e41878453a3 \
                    size    43330233

# See https://github.com/libretro/RetroArch/issues/8641
patchfiles          patch-${name}-library-dirs.diff

xcode.project       ${worksrcpath}/pkg/apple/RetroArch.xcodeproj
xcode.target        RetroArch
xcode.destroot.settings \
    CODE_SIGN_IDENTITY=- \
    CODE_SIGN_STYLE=Manual \
    ENABLE_HARDENED_RUNTIME=NO \
    GCC_TREAT_WARNINGS_AS_ERRORS=NO

# Compile and install in one step, for now. See https://trac.macports.org/ticket/57137
build {}

if {${os.platform} eq "darwin" && ${os.major} < 10} {
    known_fail yes
    pre-fetch {
        ui_error "${name} @${version} requires Mac OS X 10.6 or later."
        return -code error "incompatible Mac OS X version"
    }
}

notes {
    On first run, go to "Online Updater" and choose each item beginning with "Update" (e.g. "Update Core Info Files").
}