Ticket #47189: Portfile

File Portfile, 8.4 KB (added by RJVB (René Bertin), 8 years ago)

fixes regression

Line 
1# -*- 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;
3
4PortSystem          1.0
5PortGroup           wxWidgets 1.0
6
7name                audacity
8conflicts           audacity-gtk
9version             2.1.2
10
11# use the release tarball from github because it contains all required external libs
12# incl. those not in MacPorts.
13PortGroup           github 1.0
14github.setup        audacity audacity ${version} Audacity-
15github.tarball_from releases
16master_sites        https://github.com/audacity/audacity/archive/
17distname            Audacity-${version}
18checksums           rmd160  4e0c508b8edd24935a235c0b1a636c4ef1ae59a9 \
19                    sha256  90007b50cdc3885607b1afef2f158777a61c1658e869a88ec4d98c59c133f9bd
20
21post-extract {
22    file rename ${workpath}/audacity-Audacity-${version} ${workpath}/${distname}
23}
24
25categories          audio
26
27description         A Free, Cross-Platform Digital Audio Editor
28
29long_description    Audacity is a free, easy-to-use, multi-track audio editor and recorder \
30    for Windows, Mac OS X, GNU/Linux and other operating systems. The interface is translated \
31        into many languages. You can use Audacity to: \n\
32        Record live audio. \n\
33        Record computer playback on any Windows Vista or later machine. \n\
34        Convert tapes and records into digital recordings or CDs. \n\
35        Edit WAV, AIFF, FLAC, MP2, MP3 or Ogg Vorbis sound files. \n\
36        AC3, M4A/M4R (AAC), WMA and other formats supported using optional libraries. \n\
37        Cut, copy, splice or mix sounds together. \n\
38        Numerous effects including change the speed or pitch of a recording. \n\
39        And more!
40
41platforms           darwin
42license             GPL-2
43maintainers         gmail.com:rjvbertin openmaintainer
44universal_variant   no
45use_parallel_build  no
46
47homepage            http://www.audacityteam.org/
48
49wxWidgets.use       wxWidgets-3.0
50
51depends_build-append \
52                    port:pkgconfig port:cmake port:python27
53depends_lib-append  port:wxWidgets-3.0 port:harfbuzz port:freetype port:ffmpeg port:expat \
54                    port:flac port:libid3tag port:libmad port:lame port:twolame port:libogg \
55                    port:portaudio port:libsndfile port:soundtouch port:libvorbis port:soxr
56# audacity could use port:lv2 and port:lilv but would also require a port:suil for that to be possible.
57
58patch.pre_args      -Np1
59
60patchfiles-append   debian/patches/fix-minsrc-autoreconf.patch              \
61                    debian/patches/workaround-wxwidgets-fit-recovery.patch  \
62                    add_missing_newline.diff                                \
63                    libvamp-Makefile-for-osx.diff                           \
64                    src-Makefile-for-osx.diff                               \
65                    FFMpegh_build_against_ffmpeg.diff                       \
66                    portaudio-no-universal-build.diff                       \
67                    buildinfo-clarify-no-gstreamer.diff                     \
68                    add_enGB_translation.diff                               \
69                    patch-avoid-clang-choke-on-confbase.diff                \
70                    patch-waf-use-python27.diff                             \
71                    patch-no-rtld_deepbind.diff                             \
72                    patch-more-decent-font-sizes.diff
73
74# address issues in the build system:
75# - build and link VSTControlOSX.mm instead of the GTk interface
76# - address a visibility issue with the slider_array variable in libnyquist
77# - make the AudioUnits plugin support build; on 64bit and also include AUControl.mm
78patchfiles-append   patch-vstcontrolosx.diff \
79                    patch-libnyquist-symbol-visibility.diff \
80                    patch-fix-audiounits.diff
81
82post-patch {
83    reinplace -W ${worksrcpath} "s|/opt/local|${prefix}|g" lib-src/lv2/lv2/waf lib-src/lv2/lv2/wscript
84    reinplace -W ${worksrcpath} "s|/usr/local|${prefix}|g" src/effects/ladspa/LadspaEffect.cpp \
85                                src/export/ExportMP3.cpp \
86                                lib-src/lv2/lilv/wscript lib-src/lv2/lilv/test/lilv_test.c
87    reinplace -W ${worksrcpath} "s|/Library/Audio/Plug-Ins/Vamp|/Library/Audio/Plug-Ins/Vamp:${prefix}/lib/vamp|g" \
88                                lib-src/libvamp/src/vamp-hostsdk/PluginHostAdapter.cpp
89    reinplace -W ${worksrcpath} "s|/Library/Application Support/audacity/libs|${prefix}/lib|g" src/FFmpeg.h
90    reinplace -W ${worksrcpath} "s| -Werror||g" lib-src/portaudio-v19/configure.in \
91                                lib-src/portaudio-v19/configure
92    # audacity 2.1.2 contains C++ files that include system SDK headers and ObjC code on OS X;
93    # they must thus be built as ObjC++
94    set make_objcpp { \
95        {CommandManager src/commands {src/Makefile.in src/Makefile.am}} \
96        {Effect src/effects {src/Makefile.in src/Makefile.am}} \
97        {LV2Effect src/effects/lv2 {src/Makefile.in src/Makefile.am}} \
98    }
99    foreach mm ${make_objcpp} {
100        set f [lindex ${mm} 0]
101        set d [lindex ${mm} 1]
102        set mk [lindex ${mm} 2]
103        foreach m ${mk} {
104            reinplace -W ${worksrcpath} "s|/${f}.cpp|/${f}.mm|g" ${m}
105        }
106        # it's easiest to symlink f.mm to f.cpp; clang++ will do the rest.
107        if {![file exists ${worksrcpath}/${d}/${f}.mm]} {
108            ln -s ${f}.cpp ${worksrcpath}/${d}/${f}.mm
109        }
110        reinplace -W ${worksrcpath} "s|/VSTControlGTK.cpp|/VSTControlOSX.mm|g" \
111            src/Makefile.in src/Makefile.am
112    }
113}
114
115configure.args-append   --disable-dependency-tracking --enable-shared --disable-static --enable-sse --with-ffmpeg \
116                        --with-lam --with-libflac --with-libmad --with-soundtouch --with-twolame --with-libvorbis \
117                        --with-lv2=local --disable-quicktime --disable-universal_binary CPPFLAGS=-I${prefix}/include \
118                        --with-sbsms=local --with-libsoxr --with-libvamp=local --with-widgetextra=local --with-portmixer \
119                        --enable-audiounits \
120                        WX_CONFIG=${wxWidgets.wxconfig}
121
122post-destroot {
123    # create the app bundle infrastructure
124    set aud_app_path ${applications_dir}/Audacity.app
125    xinstall -m 755 -d ${destroot}${aud_app_path}/Contents/MacOS
126    xinstall -m 755 -d ${destroot}${aud_app_path}/Contents/Resources
127    # the BundleExec:
128    file rename ${destroot}${prefix}/bin/audacity ${destroot}${aud_app_path}/Contents/MacOS/Audacity
129    # install the Info.plist provided by Audacity
130    xinstall -m 644 ${worksrcpath}/mac/Info.plist ${destroot}${aud_app_path}/Contents/
131    # adapt the provided Info.plist
132    reinplace "s|AUDACITY_EXECUTABLE|Audacity|g" ${destroot}${aud_app_path}/Contents/Info.plist
133    reinplace "s|AUDACITY_INFO_VERSION|${version} (MacPorts)|g" ${destroot}${aud_app_path}/Contents/Info.plist
134    # install the provided icons into the Resources directory
135    foreach r [glob -nocomplain ${worksrcpath}/mac/Resources/*.icns] {
136        xinstall -m 644 ${r} ${destroot}${aud_app_path}/Contents/Resources/
137    }
138    # allow the application to find certain things where it expects them on OS X (= inside the app bundle)
139    foreach r [glob -nocomplain ${destroot}${prefix}/share/audacity/*] {
140        ln -s ${prefix}/share/audacity/[file tail ${r}] ${destroot}${aud_app_path}/Contents/Resources
141    }
142    # install translation resources
143    foreach l [glob -nocomplain ${destroot}${prefix}/share/locale/*] {
144        set lang [file tail ${l}]
145        xinstall -m 755 -d ${destroot}${aud_app_path}/Contents/Resources/${lang}.lproj
146        ln -s ${prefix}/share/locale/${lang}/LC_MESSAGES/audacity.mo ${destroot}${aud_app_path}/Contents/Resources/${lang}.lproj/
147    }
148    foreach l [glob -nocomplain ${wxWidgets.prefix}/share/locale/*] {
149        set lang [file tail ${l}]
150        xinstall -m 755 -d ${destroot}${aud_app_path}/Contents/Resources/${lang}.lproj
151        ln -s ${l}/LC_MESSAGES/wxstd.mo ${destroot}${aud_app_path}/Contents/Resources/${lang}.lproj/
152    }
153    # install a wrapper script in ${prefix}/bin
154    xinstall -m 755 ${filespath}/audacity.sh ${destroot}${prefix}/bin/audacity
155    reinplace "s|@AUD_APP_PATH@|${aud_app_path}|g" ${destroot}${prefix}/bin/audacity
156}