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

name                    qtplay
version                 1.3.1
revision                1
categories              audio
license                 BSD
platforms               {macosx < 19}
maintainers             nomaintainer

description \
    a command line utility to play Audio CDs and music files

long_description \
    ${name} is ${description}. \
    Plays any audio file supported by QuickTime \
    Special flag for simply playing CDs, for lazy people. \
    Playlist features such as loop, shuffle, and random. \
    Special flag for reading playlist via standard input. \
    Support for process signals: SIGINT, SIGTSTP, and SIGCONT. \
    This port does not work on macOS 10.15 Catalina or newer.

homepage                https://web.archive.org/web/20201204020810/https://sites.google.com/site/rainbowflight2/#qtplay
master_sites            https://web.archive.org/web/20201009113514/https://sites.google.com/site/rainbowflight2/
distname                ${name}${version}

checksums               md5     f6cb47521afbfc5b40efdd2d8433830d \
                        sha1    fd7394675c972377a48c2ff8e0a774853c0be6a3 \
                        rmd160  4c97ee8d38537f52547cb7a4d31eced0a93f2054 \
                        sha256  5d0d5bda455d77057a2372925a2c1da09ef82b5969ef0342e61d8b63876ed840 \
                        size  29339

use_parallel_build      no

extract.mkdir           yes
post-extract {
    file delete ${worksrcpath}/${name}
}

if {${os.platform} eq "darwin" && ${os.major} < 19 && [vercmp ${configure.sdk_version} > 10.11]} {
    configure.sdk_version   10.11
    configure.sdkroot       ${prefix}/Developer/SDKs/MacOSX${configure.sdk_version}.sdk
    depends_build-append    port:MacOSX${configure.sdk_version}.sdk
}

use_configure           no

configure.ldflags       -framework Carbon -framework QuickTime

# Force 32-bit (#21115)
supported_archs         ppc i386

installs_libs           no

build.cmd               ${configure.cc}
build.target
build.args              -o ${name} \
                        ${name}.c \
                        ${configure.cflags} \
                        ${configure.ldflags} \
                        [get_canonical_archflags]

destroot {
    xinstall -m 755 -W ${worksrcpath} ${name} \
        ${destroot}${prefix}/bin
    xinstall -m 644 -W ${worksrcpath} ${name}.1 \
        ${destroot}${prefix}/share/man/man1
}

livecheck.type          none
