mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
Use patched libao in order to support OSX without copying plugins (#295)
This commit is contained in:
parent
66c309557d
commit
520759dab0
|
@ -1,9 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Run this script for properly play of the sounds under Mac OS X
|
||||
#
|
||||
if test -f "/usr/local/lib/ao/plugins-4/libmacosx.so"; then :
|
||||
else
|
||||
mkdir -p /usr/local/lib/ao/plugins-4
|
||||
cp lib/libmacosx.so /usr/local/lib/ao/plugins-4/
|
||||
fi
|
BIN
maclibs/lib/ao/libmacosx.so
Normal file
BIN
maclibs/lib/ao/libmacosx.so
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
42
maclibs/scripts/libao-build.sh
Normal file
42
maclibs/scripts/libao-build.sh
Normal file
|
@ -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
maclibs/scripts/libao.txt
Normal file
9
maclibs/scripts/libao.txt
Normal file
|
@ -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]
|
Loading…
Reference in a new issue