Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use patched libao in order to support OSX without copying plugins (#295) #377

Merged
merged 1 commit into from
Aug 10, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 0 additions & 9 deletions maclibs/install_aoplugin.sh

This file was deleted.

Binary file added maclibs/lib/ao/libmacosx.so
Binary file not shown.
Binary file modified maclibs/lib/libao.dylib
Binary file not shown.
Binary file removed maclibs/lib/libmacosx.so
Binary file not shown.
42 changes: 42 additions & 0 deletions maclibs/scripts/libao-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash
# $1 - GoldenDict source directory

if [ ${OSTYPE:0:6} != "darwin" ]; then
echo "OSX Only"
exit 1
fi


if [[ -n "$1" && ! -d "$1" ]]; then
echo "Invalid GoldenDict source directory"
exit 1
fi

./configure \
CFLAGS="-arch i386 -arch x86_64 -DCUSTOM_AO_PLUGIN_PATH=\\\"@executable_path/../Frameworks/ao\\\"" \
LDFLAGS="-arch i386 -arch x86_64" \
--disable-dependency-tracking

make clean && make


install_name_tool \
-id @executable_path/../Frameworks/libao.dylib \
src/.libs/libao.dylib

for PLUGIN_DIR in `find src/plugins -type d -maxdepth 1`; do
PLUGIN_NAME=$(basename "$PLUGIN_DIR")
PLUGIN_PATH=$PLUGIN_DIR/.libs/lib$PLUGIN_NAME.so
if [ -f "$PLUGIN_PATH" ]; then
install_name_tool \
-id @executable_path/../Frameworks/ao/$PLUGIN_NAME.so \
$PLUGIN_PATH
fi
done

if [ -n "$1" ]; then
cp src/.libs/libao.dylib $1/maclibs/lib
# Copy plugins
mkdir -p $1/maclibs/lib/ao
find src/plugins -type f -maxdepth 3 -name "*.so" -exec cp {} $1/maclibs/lib/ao \;
fi
9 changes: 9 additions & 0 deletions maclibs/scripts/libao.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Patched libao source for OSX can be found here:
https://github.com/timonwong/libao/tree/goldendict

You can checkout the source directly using git:
git clone -b goldendict https://github.com/timonwong/libao.git

Then, copy libao-build.sh (along with this file) to libao source directory, and build using following commands:
chmod +x libao-build.sh
./libao-build.sh [goldendict source directory]