Ticket #53470: audacity.3.diff

File audacity.3.diff, 14.6 KB (added by RJVB (René Bertin), 8 years ago)
  • audio/audacity/Portfile

    old new  
    11# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
    2 # kate: backspace-indents true; indent-pasted-text true; indent-width 4; keep-extra-spaces true; remove-trailing-spaces modified; replace-tabs true; replace-tabs-save true; syntax Tcl/Tk; tab-indents true; tab-width 4;
    32
    43PortSystem          1.0
    54PortGroup           wxWidgets 1.0
     5PortGroup           compiler_blacklist_versions 1.0
    66
    7 # use the release tarball from github because it contains all required external libs
    8 # incl. those not in MacPorts.
    9 PortGroup           github 1.0
    10 github.setup        audacity audacity 2.1.2 Audacity-
    11 github.tarball_from releases
    12 revision            2
    13 master_sites        https://github.com/audacity/audacity/archive/
    14 distname            Audacity-${version}
    15 checksums           rmd160  4e0c508b8edd24935a235c0b1a636c4ef1ae59a9 \
    16                     sha256  90007b50cdc3885607b1afef2f158777a61c1658e869a88ec4d98c59c133f9bd
    17 
    18 post-extract {
    19     file rename ${workpath}/audacity-Audacity-${version} ${workpath}/${distname}
    20 }
    21 
    22 categories          audio
    23 
    24 description         A Free, Cross-Platform Digital Audio Editor
     7name                audacity
     8conflicts           audacity-gtk
    259
     10description         A Free, Cross-Platform Digital Audio Editor.
    2611long_description    Audacity is a free, easy-to-use, multi-track audio editor and recorder \
    2712                    for Windows, Mac OS X, GNU/Linux and other operating systems. The interface is translated \
    2813                    into many languages. You can use Audacity to: \n\
     
    3520                    Numerous effects including change the speed or pitch of a recording. \n\
    3621                    And more!
    3722
     23subport             audacity-devel {
     24    long_description A port of the Audacity audio editor aimed at development purposes.
     25}
     26
     27
     28# use the release tarball from github because it contains all required external libs
     29# incl. those not in MacPorts.
     30PortGroup           github 1.0
     31
     32if {${subport} eq "${name}"} {
     33    version         2.1.3
     34    github.setup    audacity audacity ${version} Audacity-
     35    distname        Audacity-${version}
     36    checksums       rmd160  d3f9252f55a13ee1a9f4fcf1f5ffdd72eafdde6d \
     37                    sha256  24469a0b8c822f4f93ce23add61cd6ffd1919fc8c1384015a05566764c870ef1
     38} else {
     39#     # git describe --tags : Audacity-2.1.2-1652-g0cb89a8
     40#     github.setup        audacity audacity 0cb89a895a25e4f1e7ca4045d0b95e786bce7ed2
     41    # git describe --tags : Audacity-2.1.3-190-g78149bc
     42    github.setup    audacity audacity 78149bc3da4a7d18c0487baf7002b23759a814c3
     43    version         2.1.3.190
     44    # this port is intended to facilitate development efforts shared with "upstreams"
     45    # so using git instead of a tarball fetch type is more appropriate.
     46    fetch.type      git
     47    distname        audacity-git
     48}
     49
     50categories          audio
     51
     52
    3853platforms           darwin
    3954license             GPL-2+
    4055# openssl is a dependency of curl in cmake
    4156license_noconflict  openssl
    4257maintainers         gmail.com:rjvbertin openmaintainer
    4358universal_variant   no
    44 use_parallel_build  no
     59use_parallel_build  yes
    4560
    4661homepage            http://www.audacityteam.org/
    4762
     63compiler.blacklist  {*gcc-[234].[0-8]}
     64
    4865wxWidgets.use       wxWidgets-3.0
     66depends_build-append \
     67                    port:${wxWidgets.port}
    4968
    5069depends_build-append \
    5170                    port:cmake \
    5271                    port:pkgconfig \
    5372                    port:python27
    54 depends_lib-append  port:expat \
    55                     path:lib/libavcodec.dylib:ffmpeg \
    56                     port:flac \
     73depends_build-append \
    5774                    port:freetype \
    5875                    port:harfbuzz \
    5976                    port:lame \
    6077                    port:libid3tag \
    6178                    port:libmad \
     79                    port:soundtouch \
     80                    port:soxr \
     81                    port:twolame
     82depends_lib-append  port:expat \
     83                    path:lib/libavcodec.dylib:ffmpeg \
     84                    port:flac \
    6285                    port:libogg \
    6386                    port:libsndfile \
    6487                    port:libvorbis \
    65                     port:portaudio \
    66                     port:soundtouch \
    67                     port:soxr \
    68                     port:twolame \
    69                     port:${wxWidgets.port}
     88                    port:portaudio
    7089# audacity could use port:lv2 and port:lilv but would also require a port:suil for that to be possible.
    7190
    7291patch.pre_args      -Np1
    7392
    74 patchfiles-append   debian/patches/fix-minsrc-autoreconf.patch              \
    75                     add_missing_newline.diff                                \
     93# address issues in the build system:
     94# - build and link VSTControlOSX.mm instead of the GTk interface
     95# - address a visibility issue with the slider_array variable in libnyquist
     96# - make the AudioUnits plugin support build; on 64bit and also include AUControl.mm
     97platform darwin {
     98    patchfiles-append \
     99                    fix-minsrc-autoreconf.patch                             \
    76100                    libvamp-Makefile-for-osx.diff                           \
    77101                    src-Makefile-for-osx.diff                               \
    78                     FFmpeg_build_against_ffmpeg.diff                       \
    79102                    portaudio-no-universal-build.diff                       \
    80103                    buildinfo-clarify-no-gstreamer.diff                     \
    81104                    add_enGB_translation.diff                               \
    82105                    patch-avoid-clang-choke-on-confbase.diff                \
    83                     patch-no-rtld_deepbind.diff                             \
    84106                    patch-more-decent-font-sizes.diff                       \
    85                     patch-python.diff
    86 
    87 # address issues in the build system:
    88 # - build and link VSTControlOSX.mm instead of the GTk interface
    89 # - address a visibility issue with the slider_array variable in libnyquist
    90 # - make the AudioUnits plugin support build; on 64bit and also include AUControl.mm
    91 patchfiles-append   patch-vstcontrolosx.diff \
     107                    patch-python.diff                                       \
     108                    patch-vstcontrolosx.diff \
    92109                    patch-libnyquist-symbol-visibility.diff \
     110                    patch-fix-casts.diff \
     111                    patch-add-MenusMac.diff \
     112                    patch-skip-gcc-version-test.diff
     113}
     114
     115if {${subport} eq "${name}"} {
     116    patchfiles-append \
    93117                    patch-fix-audiounits.diff
     118} else {
     119    patchfiles-append \
     120                    devel/patch-fix-audiounits.diff \
     121                    devel/patch-temp-fixes.h
     122}
    94123
    95124post-patch {
    96125    set python_bin ${prefix}/bin/python2.7
     
    109138    reinplace -W ${worksrcpath} "s| -Werror||g" \
    110139                                lib-src/portaudio-v19/configure.in \
    111140                                lib-src/portaudio-v19/configure
    112     # audacity 2.1.2 contains C++ files that include system SDK headers and ObjC code on OS X;
    113     # they must thus be built as ObjC++
    114     set make_objcpp { \
    115         {CommandManager src/commands    {src/Makefile.in src/Makefile.am}} \
    116         {Effect         src/effects     {src/Makefile.in src/Makefile.am}} \
    117         {LV2Effect      src/effects/lv2 {src/Makefile.in src/Makefile.am}} \
    118     }
    119     foreach mm ${make_objcpp} {
    120         set f  [lindex ${mm} 0]
    121         set d  [lindex ${mm} 1]
    122         set mk [lindex ${mm} 2]
    123         foreach m ${mk} {
    124             reinplace -W ${worksrcpath} "s|/${f}.cpp|/${f}.mm|g" ${m}
    125         }
    126         # it's easiest to symlink f.mm to f.cpp; clang++ will do the rest.
    127         if {![file exists ${worksrcpath}/${d}/${f}.mm]} {
    128             ln -s ${f}.cpp ${worksrcpath}/${d}/${f}.mm
     141    platform darwin {
     142        # audacity 2.1.2 contains C++ files that include system SDK headers and ObjC code on OS X;
     143        # they must thus be built as ObjC++
     144        set make_objcpp { \
     145            {CommandManager src/commands    {src/Makefile.in src/Makefile.am}} \
     146            {Effect         src/effects     {src/Makefile.in src/Makefile.am}} \
     147            {LV2Effect      src/effects/lv2 {src/Makefile.in src/Makefile.am}} \
     148        }
     149        foreach mm ${make_objcpp} {
     150            set f  [lindex ${mm} 0]
     151            set d  [lindex ${mm} 1]
     152            set mk [lindex ${mm} 2]
     153            foreach m ${mk} {
     154                reinplace -W ${worksrcpath} "s|/${f}.cpp|/${f}.mm|g" ${m}
     155            }
     156            # it's easiest to symlink f.mm to f.cpp; clang++ will do the rest.
     157            if {![file exists ${worksrcpath}/${d}/${f}.mm]} {
     158                ln -s ${f}.cpp ${worksrcpath}/${d}/${f}.mm
     159            }
    129160        }
    130161        reinplace -W ${worksrcpath} "s|/VSTControlGTK.cpp|/VSTControlOSX.mm|g" \
    131             src/Makefile.in src/Makefile.am
     162                src/Makefile.in src/Makefile.am
     163        if {[file exists ${worksrcpath}/src/MenusMac.cpp] && ![file exists ${worksrcpath}/src/MenusMac.mm]} {
     164            ln -s MenusMac.cpp ${worksrcpath}/src/MenusMac.mm
     165        }
    132166    }
    133167}
    134168
     
    141175                    --enable-shared \
    142176                    --enable-sse \
    143177                    --with-ffmpeg \
    144                     --with-lam \
     178                    --with-lame \
    145179                    --with-libflac \
    146180                    --with-libmad \
    147181                    --with-libsoxr \
     
    156190                    CPPFLAGS=-I${prefix}/include \
    157191                    WX_CONFIG=${wxWidgets.wxconfig}
    158192
    159 set aud_app_path    ${applications_dir}/Audacity.app
    160 # the following causes an empty directory to be created and preserved at installation
    161 # to allow the default en language localization to function properly (#50724)
    162 destroot.keepdirs   ${destroot}${aud_app_path}/Contents/Resources/en.lproj
    163 
    164 post-destroot {
    165     # create the app bundle infrastructure
    166     xinstall -m 755 -d ${destroot}${aud_app_path}/Contents/MacOS
    167     xinstall -m 755 -d ${destroot}${aud_app_path}/Contents/Resources
    168     # the BundleExec:
    169     file rename ${destroot}${prefix}/bin/audacity ${destroot}${aud_app_path}/Contents/MacOS/Audacity
    170     # install the Info.plist provided by Audacity
    171     xinstall -m 644 ${worksrcpath}/mac/Info.plist ${destroot}${aud_app_path}/Contents/
    172     # adapt the provided Info.plist
    173     reinplace "s|AUDACITY_EXECUTABLE|Audacity|g" ${destroot}${aud_app_path}/Contents/Info.plist
    174     reinplace "s|AUDACITY_INFO_VERSION|${version} (MacPorts)|g" ${destroot}${aud_app_path}/Contents/Info.plist
    175     # install the provided icons into the Resources directory
    176     foreach r [glob -nocomplain ${worksrcpath}/mac/Resources/*.icns] {
    177         xinstall -m 644 ${r} ${destroot}${aud_app_path}/Contents/Resources/
    178     }
    179     # allow the application to find certain things where it expects them on OS X (= inside the app bundle)
    180     foreach r [glob -nocomplain ${destroot}${prefix}/share/audacity/*] {
    181         ln -s ${prefix}/share/audacity/[file tail ${r}] ${destroot}${aud_app_path}/Contents/Resources
    182     }
    183     # install translation resources
    184     foreach l [glob -nocomplain ${destroot}${prefix}/share/locale/*] {
    185         set lang [file tail ${l}]
    186         xinstall -m 755 -d ${destroot}${aud_app_path}/Contents/Resources/${lang}.lproj
    187         ln -s ${prefix}/share/locale/${lang}/LC_MESSAGES/audacity.mo ${destroot}${aud_app_path}/Contents/Resources/${lang}.lproj/
    188     }
    189     foreach l [glob -nocomplain ${wxWidgets.prefix}/share/locale/*] {
    190         set lang [file tail ${l}]
    191         xinstall -m 755 -d ${destroot}${aud_app_path}/Contents/Resources/${lang}.lproj
    192         ln -s ${l}/LC_MESSAGES/wxstd.mo ${destroot}${aud_app_path}/Contents/Resources/${lang}.lproj/
     193build.args-append   V=1 VERBOSE=1
     194
     195platform darwin {
     196    set aud_app_path    ${applications_dir}/Audacity.app
     197    destroot.keepdirs   ${destroot}${aud_app_path}/Contents/Resources/en.lproj
     198
     199    post-destroot {
     200        # create the app bundle infrastructure
     201        xinstall -m 755 -d ${destroot}${aud_app_path}/Contents/MacOS
     202        xinstall -m 755 -d ${destroot}${aud_app_path}/Contents/Resources
     203        # the BundleExec:
     204        file rename ${destroot}${prefix}/bin/audacity ${destroot}${aud_app_path}/Contents/MacOS/Audacity
     205        # install the Info.plist provided by Audacity
     206        xinstall -m 644 ${worksrcpath}/mac/Info.plist ${destroot}${aud_app_path}/Contents/
     207        # adapt the provided Info.plist
     208        reinplace "s|AUDACITY_EXECUTABLE|Audacity|g" ${destroot}${aud_app_path}/Contents/Info.plist
     209        reinplace "s|AUDACITY_INFO_VERSION|${version} (MacPorts)|g" ${destroot}${aud_app_path}/Contents/Info.plist
     210        # install the provided icons into the Resources directory
     211        foreach r [glob -nocomplain ${worksrcpath}/mac/Resources/*.icns] {
     212            xinstall -m 644 ${r} ${destroot}${aud_app_path}/Contents/Resources/
     213        }
     214        # allow the application to find certain things where it expects them on OS X (= inside the app bundle)
     215        foreach r [glob -nocomplain ${destroot}${prefix}/share/audacity/*] {
     216            ln -s ${prefix}/share/audacity/[file tail ${r}] ${destroot}${aud_app_path}/Contents/Resources
     217        }
     218        # install translation resources
     219        foreach l [glob -nocomplain ${destroot}${prefix}/share/locale/*] {
     220            set lang [file tail ${l}]
     221            xinstall -m 755 -d ${destroot}${aud_app_path}/Contents/Resources/${lang}.lproj
     222            ln -s ${prefix}/share/locale/${lang}/LC_MESSAGES/audacity.mo ${destroot}${aud_app_path}/Contents/Resources/${lang}.lproj/
     223        }
     224        foreach l [glob -nocomplain ${wxWidgets.prefix}/share/locale/*] {
     225            set lang [file tail ${l}]
     226            xinstall -m 755 -d ${destroot}${aud_app_path}/Contents/Resources/${lang}.lproj
     227            ln -s ${l}/LC_MESSAGES/wxstd.mo ${destroot}${aud_app_path}/Contents/Resources/${lang}.lproj/
     228        }
     229        # install a wrapper script in ${prefix}/bin
     230        system "echo \"#!/bin/sh\nexec \\\"${aud_app_path}/Contents/MacOS/Audacity\\\" \\\"\\\$\@\\\"\" > ${destroot}${prefix}/bin/audacity"
     231        system "chmod 755 ${destroot}${prefix}/bin/audacity"
    193232    }
    194     # install a wrapper script in ${prefix}/bin
    195     system "echo \"#!/bin/sh\nexec \\\"${aud_app_path}/Contents/MacOS/Audacity\\\" \\\"\\\$\@\\\"\" > ${destroot}${prefix}/bin/audacity"
    196     system "chmod 755 ${destroot}${prefix}/bin/audacity"
    197233}
     234
     235# kate: backspace-indents true; indent-pasted-text true; indent-width 4; keep-extra-spaces true; remove-trailing-spaces modified; replace-tabs true; replace-tabs-save true; syntax Tcl/Tk; tab-indents true; tab-width 4;