| 23 | subport 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. |
| 30 | PortGroup github 1.0 |
| 31 | |
| 32 | if {${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 | |
| 50 | categories audio |
| 51 | |
| 52 | |
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 | } |
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/ |
| 193 | build.args-append V=1 VERBOSE=1 |
| 194 | |
| 195 | platform 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" |