2011-11-12 7 views
3

MacPortsは私のシステムへの依存として "libiconv @ 1.14_0 + universal"をインストールしました。これは32ビットの味であり、Simon Listensと呼ばれる音声認識ソフトウェアをコンパイルしようとすると問題が発生し始めました。 私は64-bit flavor of libiconv by defaultとそのMacが実際に船ということが分かったと、私は私のシステムにしたファイルを検索することができたグーグル中:MacPortのlibiconvをMacのデフォルトの64ビットバージョンに置き換えるにはどうすればいいですか?

$ find /usr/lib -name libiconv* 
/usr/lib/libiconv.2.4.0.dylib 
/usr/lib/libiconv.2.dylib 
/usr/lib/libiconv.dylib 

システムライブラリを使用するために、私は考えることができ最も簡単な方法でしたMacPortのバージョンのlibiconvをアンインストールして、システムのライブラリがPATHの下のどこかに既に存在する(私の推測)ようにフォールバックとして選択されるようにします。原因の依存性へ

しかし、それは失敗しました:

$ sudo port uninstall libiconv @1.14_0+universal 
Unable to uninstall libiconv @1.14_0+universal, the following ports depend on it: 
... 

だから今、私はMacPortが指すと私のシステムで、すでにライブラリを使用するために、その依存関係グラフを交換する方法を伝えることができている私の質問?

答えて

1

libiconv問題は、カスタムの場所で新鮮なMacPortsのシステムに加えて、このようなcyrus-sasl2zlibportaudiokdesdk4、必要に応じてパッケージに対して電子をsimonを構築することですMacPortsのを回避するための別のアプローチ。 g。 /opt/macports-simon

# compile simon on Mac OS X 10.6.8 using MacPorts for the installation of zlib, portaudio and kdesdk4 
# http://www.simon-listens.org 
# http://sourceforge.net/projects/speech2text/ 

# get a root shell 
sudo -H -i 

# prevent idle sleep 
pmset -a force sleep 0 displaysleep 0 disksleep 0 

mv -i /opt/local /opt/local-off 
mv -i /usr/local /usr/local-off 

cd /tmp 
mkdir buildsimon || exit 1 
cd buildsimon || exit 1 

# create custom /opt/macports-simon to install zlib, portaudio and kdesdk4 
# cf. http://guide.macports.org/#installing.macports.source.multiple 
MP_PREFIX='/opt/macports-simon' 
unset PATH 
export PATH='/bin:/sbin:/usr/bin:/usr/sbin' 
curl -L -O https://distfiles.macports.org/MacPorts/MacPorts-2.0.4.tar.bz2 
tar -xjf MacPorts-2.0.4.tar.bz2 
cd MacPorts-2.0.4 || exit 1 
./configure --prefix="${MP_PREFIX}" --with-applications-dir="${MP_PREFIX}/Applications" 
make 
make install 

cd /tmp/buildsimon 

unset PATH 
export PATH="${MP_PREFIX}/bin:/bin:/sbin:/usr/bin:/usr/sbin" 

# get the Portfiles and update the system 
port -v selfupdate 

# install cyrus-sasl2 
port -f uninstall cyrus-sasl2 
port clean --all cyrus-sasl2 
port extract cyrus-sasl2 
cd "$(port dir cyrus-sasl2)"/work/cyrus-sasl-2.1.23 
printf '%s\n' H '/\(darwin\[15\]\)/s//\1./g' wq | sudo ed -s config/ltconfig 
printf '%s\n' H '/\(darwin\[15\]\)/s//\1./g' wq | sudo ed -s saslauthd/config/ltconfig 
cd /tmp/buildsimon 
port -f -s install cyrus-sasl2 
otool -L /opt/macports-simon/lib/libsasl2.dylib 

port -f install zlib 
port -f install portaudio 
port -f install kdesdk4 

port installed zlib portaudio kdesdk4 cyrus-sasl2 

# enable dbus with launchd 
# http://www.freedesktop.org/wiki/Software/dbus 
# open -e dbus-1.5.8/README.launchd 
launchctl load -w /Library/LaunchDaemons/org.freedesktop.dbus-system.plist 
launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist 
sudo -u _mysql mysql_install_db5 
sudo port load mysql5-server 

# todo: how to configure simon to use /opt/macports-simon directly? 
ln -isv "${MP_PREFIX}" /usr/local 

cd /tmp/buildsimon 

# http://sourceforge.net/projects/speech2text/ 
curl -L -O http://netcologne.dl.sourceforge.net/project/speech2text/simon/0.3.0/simon-0.3.0.tar.bz2 
tar -xjf simon-0.3.0.tar.bz2 
cd simon-0.3.0 || exit 1 

# Note that /usr/local got symlinked to "${MP_PREFIX}" above! 
unset PATH 
export PATH='/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin' 


# the following commands are taken from simon-0.3.0/build.sh 

mkdir build 2> /dev/null 
cd build || exit 1 
cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` .. 

# append ${MP_PREFIX}/lib/libiconv.dylib to gcc command in link.txt file 
printf '%s\n' H '/\/usr\/bin\/gcc/s|\(.*\)|\1 '"${MP_PREFIX}"'/lib/libiconv.dylib|' wq | 
    ed -s julius/julius/CMakeFiles/juliusexe.dir/link.txt 

# replace gcc option ' -bundle ' with ' -dynamiclib ' 
egrep -Ilsr -Z -e ' -bundle ' . | 
    xargs -0 -n 1 /bin/sh -c 'printf "%s\n" H "g/ -bundle /s// -dynamiclib /g" wq | /bin/ed -s "${1}"' argv0 

make 

touch ./julius/gramtools/mkdfa/mkfa-1.44-flex/* 
make 
make install 
# ldconfig # not needed on Mac OS X 
kbuildsycoca4 
echo -e "**** Build completed ****\n\nThe executable file \"simon\" is now ready and has been installed.\n\nIssue \"simon\" to start it." 

unset PATH 
export PATH="${MP_PREFIX}/bin:/bin:/sbin:/usr/bin:/usr/sbin" 

otool -L "${MP_PREFIX}/bin/simon" 

simon 

mv -i /opt/local-off /opt/local 
mv -i /usr/local-off /usr/local 

次のコードは、Mac OS X 10.6.8を実行している私のマシン上で私のために働きました

関連する問題