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

github.setup            cdrdao cdrdao 1_2_6 rel_
github.tarball_from     archive
version                 [string map {_ .} ${github.version}]
description             Disk-At-Once Recording of Audio and Data CD-Rs/CD-RWs
long_description \
    Cdrdao records audio or data CD-Rs in disk-at-once (DAO) mode \
    based on a textual description of the CD contents (toc-file).

homepage                https://cdrdao.sourceforge.net/
categories              sysutils
license                 GPL-2+
maintainers             nomaintainer

checksums               rmd160  68357bf4f161d2772cc64b38faf7492977a54463 \
                        sha256  ba3eadcae7b62a709e9e23988d7fb41f822c408dcec9bd99ff1a343d1bcbc524 \
                        size    856060

distname                ${name}-${version}

depends_build-append    port:autoconf \
                        port:automake \
                        port:libtool \
                        path:bin/pkg-config:pkgconfig

depends_lib-append      port:libao \
                        port:libvorbis \
                        port:libmad \
                        port:libiconv

compiler.cxx_standard   2014

configure.cmd           ./autogen.sh && ./configure
configure.args-append   --without-lame \
                        --without-gcdmaster

patch.pre_args-replace  -p0 -p1
patchfiles              0001-scsilf-osx-fix-build-prior-to-macOS-12.patch

variant lame description {Use LAME encoder} {
    depends_lib-append      port:lame
    configure.args-delete   --without-lame
    configure.args-append   --with-lame-lib=${prefix}/lib \
                            --with-lame-include=${prefix}/include
}

post-destroot {
    xinstall -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 ${worksrcpath}/COPYING ${destroot}${prefix}/share/doc/${name}
}
