[macports-ports] branch master updated: fluid-soundfont, generaluser-soundfont: new ports

Ryan Schmidt ryandesign at macports.org
Fri Dec 23 11:06:14 CET 2016


> On Dec 22, 2016, at 06:38, Mojca Miklavec <mojca at macports.org> wrote:
> 
> Mojca Miklavec (mojca) pushed a commit to branch master
> in repository macports-ports.
> 
> 
> https://github.com/macports/macports-ports/commit/576258835b3977f7573c20a84b2a746e63354b06
> 
> The following commit(s) were added to refs/heads/master by this push:
> 
>      new 57625883 fluid-soundfont, generaluser-soundfont: new ports
> 
> 57625883 is described below
> 
> 
> commit 576258835b3977f7573c20a84b2a746e63354b06
> 
> Author: Mojca Miklavec <mojca at macports.org>
> AuthorDate: Thu Dec 22 13:38:30 2016 +0100
> 
> 
>     fluid-soundfont, generaluser-soundfont: new ports
> 
>     
> 
>     Closes: https://trac.macports.org/ticket/52992


> diff --git a/audio/fluid-soundfont/Portfile b/audio/fluid-soundfont/Portfile

> +depends_build       port:dos2unix
> +
> +post-patch {
> +    foreach f {fluidr3_gm.cfg fluidr3_gs.cfg} {
> +        reinplace "s|/usr/share/sounds/sf2|${prefix}/share/sounds/sf2|g" ${worksrcpath}/debian/${f}
> +        system "dos2unix \"${worksrcpath}/debian/${f}\""
> +    }
> +}

You can use reinplace to convert dos to unix line endings without needing a dependency on another port:

        reinplace "s|/usr/share/sounds/sf2|${prefix}/share/sounds/sf2|g" ${worksrcpath}/debian/${f}
        reinplace "s|\r||g" ${worksrcpath}/debian/${f}


> +destroot {
> +    set dir ${destroot}${prefix}/share/sounds/sf2
> +    xinstall -m 755 -d ${dir}
> +    foreach f {FluidR3_GM.sf2 FluidR3_GS.sf2} {
> +        xinstall -m 644 ${worksrcpath}/${f} ${dir}
> +    }
> +
> +    set dir ${destroot}${prefix}/share/doc/${name}
> +    xinstall -m 755 -d ${dir}
> +    foreach f {README COPYING debian/README.Debian debian/changelog debian/copyright} {
> +        xinstall -m 644 ${worksrcpath}/${f} ${dir}
> +    }
> +
> +    set dir ${destroot}${prefix}/share/timidity
> +    xinstall -m 755 -d ${dir}
> +    foreach f {fluidr3_gm.cfg fluidr3_gs.cfg} {
> +        xinstall -m 644 ${worksrcpath}/debian/${f} ${dir}
> +    }
> +}

You don't need foreach loops to install multiple files; you can replace each foreach loop with a single xinstall:

xinstall -m 644 -W ${worksrcpath} FluidR3_GM.sf2 FluidR3_GS.sf2 ${dir}

xinstall -m 644 -W ${worksrcpath} README COPYING debian/README.Debian debian/changelog debian/copyright ${dir}

xinstall -m 644 -W ${worksrcpath}/debian fluidr3_gm.cfg fluidr3_gs.cfg ${dir}


> diff --git a/audio/generaluser-soundfont/Portfile b/audio/generaluser-soundfont/Portfile

> +destroot {
> +    set dir ${destroot}${prefix}/share/sounds/sf2
> +    xinstall -m 755 -d ${dir}
> +    xinstall -m 644 "${worksrcpath}/GeneralUser GS v${version}.sf2" ${dir}/GeneralUser_GS_v${version}.sf2
> +
> +    set dir ${destroot}${prefix}/share/doc/${name}
> +    xinstall -m 755 -d ${dir}
> +    foreach f {CHANGELOG.txt LICENSE.txt README.txt "instrument lists/GU1.43 Percussion Map.pdf"} {
> +        xinstall -m 644 "${worksrcpath}/${f}" ${dir}
> +    }
> +
> +    set dir ${destroot}${prefix}/share/examples/${name}
> +    xinstall -m 755 -d ${dir}
> +    xinstall -m 644 "${worksrcpath}/GUTest.mid" ${dir}
> +    foreach f [glob -nocomplain "${worksrcpath}/demo MIDIs/*"] {
> +        xinstall -m 644 "${f}" ${dir}
> +    }
> +}

These loops can be replaced with single xinstalls too:

xinstall -m 644 -W ${worksrcpath} CHANGELOG.txt LICENSE.txt README.txt "instrument lists/GU1.43 Percussion Map.pdf" ${dir}

xinstall -m 644 {*}[glob -nocomplain "${worksrcpath}/demo MIDIs/*"] ${dir}


> +# The following doesn't work because the site is blocking
> +# any clients presenting themselves as 'libcurl'.

Make sure you report that to the server administrator so they can fix it.



More information about the macports-dev mailing list