# -*- 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                xld
version             20240310
revision            0

categories          audio
supported_archs     x86_64 arm64 i386 ppc
license             GPL-2
maintainers         {judaew @judaew} openmaintainer

description         Lossless audio decoder for Mac OS X
long_description    \
    X Lossless Decoder(XLD) is a tool for Mac OS X that is able to \
    decode/convert/play various 'lossless' audio files. The supported audio \
    files can be split into some tracks with cue sheet when decoding. It works \
    on Mac OS X 10.4 and later.
homepage            https://tmkk.undo.jp/xld/index_e.html

master_sites        sourceforge:xld
distname            xld-${version}
use_dmg             yes

checksums           rmd160  6571cfa4a7054e996c84b0440b341d2423201be3 \
                    sha256  29939315c5c7983cad307aa1921b5191f72f90e5ea39d01576bb0b336b5d16db \
                    size    11349268

variant universal {}
default_variants +universal

use_configure       no
build {}

patchfiles          patch-use-macports-applications-dir.diff

post-patch {
    reinplace "s,@@APPLICATIONS_DIR@@,${applications_dir},g" \
        ${worksrcpath}/CLI/xld
}

destroot {
    move ${worksrcpath}/XLD.app ${destroot}${applications_dir}
    xinstall -m 0755 ${worksrcpath}/CLI/${name} ${destroot}${prefix}/bin
}
