spek

Acoustic spectrum analyser
git clone http://git.hanabi.in/repos/spek.git
Log | Files | Refs | README

commit 099da06738c381e850183dda77086e164eaa7d61
parent 5b24d780ba4e9638f29f22ee5a62c0a2749a8c77
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date:   Tue, 27 Dec 2016 12:18:40 -0800

osx: Use Homebrew for dependencies

Diffstat:
Mdist/osx/README.md | 37++++---------------------------------
Mdist/osx/bundle.sh | 32+++++++++++++++++++++++++-------
2 files changed, 29 insertions(+), 40 deletions(-)

diff --git a/dist/osx/README.md b/dist/osx/README.md @@ -1,39 +1,10 @@ # Building the OS X bundle -Using [MacPorts](https://www.macports.org/) install build dependencies: +Using [Homebrew](http://brew.sh) install build dependencies: - port install autoconf automake gcc48 git-core intltool upx yasm - -Download and build wxWidgets 2.9+, example configure flags: - - ./configure --prefix=$HOME/usr --disable-shared \ - --enable-intl --with-osx_cocoa \ - --with-jpeg=builtin --with-png=builtin --with-regex=builtin \ - --with-tiff=builtin --with-zlib=builtin --with-expat=builtin - cd locale; make allmo; cd .. - make && make install - -Copy the wxWidgets m4 macro to the MacPorts tree: - - sudo cp $HOME/usr/share/aclocal/wxwin.m4 /opt/local/share/aclocal/ - -Download and build libopus, example configure flags: - - ./configure --prefix=$HOME/usr --disable-shared - make && make install - -Download and build FFmpeg, example configure flags: - - PKG_CONFIG_PATH=$HOME/usr/lib/pkgconfig ./configure \ - --prefix=$HOME/usr --enable-gpl --enable-version3 \ - --enable-runtime-cpudetect --enable-pthreads \ - --disable-shared --disable-debug --disable-doc \ - --disable-nonfree --disable-programs --disable-avdevice \ - --disable-swresample --disable-swscale --disable-postproc \ - --disable-avfilter --disable-encoders --disable-muxers \ - --disable-devices --disable-filters \ - --enable-libopus - make && make install + brew install autoconf automake coreutils git intltool libtool pkg-config + brew install ffmpeg gettext wxmac + brew link --force gettext Bundle Spek: diff --git a/dist/osx/bundle.sh b/dist/osx/bundle.sh @@ -1,21 +1,17 @@ #!/bin/sh -INSTALL_PATH=$HOME/usr LANGUAGES="ca cs da de el eo es fi fr gl it ja lv nb nl pl pt_BR ru sk sr@latin sv tr uk vi zh_CN zh_TW" cd $(dirname $0)/../.. rm -f src/spek -PKG_CONFIG_PATH=$INSTALL_PATH/lib/pkgconfig CXX=/opt/local/bin/g++-mp-4.8 \ - ./autogen.sh --with-wx-config=$INSTALL_PATH/bin/wx-config \ - && make && make check || exit 1 -strip src/spek -upx src/spek +./autogen.sh && make -j8 || exit 1 cd dist/osx rm -fr Spek.app mkdir -p Spek.app/Contents/MacOS +mkdir -p Spek.app/Contents/Frameworks mkdir -p Spek.app/Contents/Resources mv ../../src/spek Spek.app/Contents/MacOS/Spek cp Info.plist Spek.app/Contents/ @@ -29,10 +25,32 @@ cp ../../lic/* Spek.app/Contents/Resources/lic/ for lang in $LANGUAGES; do mkdir -p Spek.app/Contents/Resources/"$lang".lproj cp -v ../../po/"$lang".gmo Spek.app/Contents/Resources/"$lang".lproj/spek.mo - cp -v "$INSTALL_PATH"/share/locale/"$lang"/LC_MESSAGES/wxstd.mo Spek.app/Contents/Resources/"$lang".lproj/ + cp -v /usr/local/share/locale/"$lang"/LC_MESSAGES/wxstd.mo Spek.app/Contents/Resources/"$lang".lproj/ done mkdir -p Spek.app/Contents/Resources/en.lproj +BINS="Spek.app/Contents/MacOS/Spek" +while [ ! -z "$BINS" ]; do + NEWBINS="" + for bin in $BINS; do + echo "Updating dependendies for $bin." + LIBS=$(otool -L $bin | grep /usr/local | tr -d '\t' | awk '{print $1}') + for lib in $LIBS; do + reallib=$(realpath $lib) + libname=$(basename $reallib) + install_name_tool -change $lib @executable_path/../Frameworks/$libname $bin + if [ ! -f Spek.app/Contents/Frameworks/$libname ]; then + echo "\tBundling $reallib." + cp $reallib Spek.app/Contents/Frameworks/ + chmod +w Spek.app/Contents/Frameworks/$libname + install_name_tool -id @executable_path/../Frameworks/$libname Spek.app/Contents/Frameworks/$libname + NEWBINS="$NEWBINS Spek.app/Contents/Frameworks/$libname" + fi + done + done + BINS="$NEWBINS" +done + # Make DMG image VOLUME_NAME=Spek DMG_APP=Spek.app