在Mac OS X 10.6上使用MacPorts 1.8安装py25-gtk时构建失败
当我执行这个命令时:
sudo port clean py25-gtk
sudo port install py25-gtk
我遇到了这个错误:
---> Computing dependencies for py25-gtk
---> Building getopt
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_sysutils_getopt/work/getopt-1.1.4" && /usr/bin/make -j2 all LIBCGETOPT=0 prefix=/opt/local mandir=/opt/local/share/man CC=/usr/bin/gcc-4.2 " returned error 2
Command output: _print_help in getopt.o
_print_help in getopt.o
_print_help in getopt.o
_print_help in getopt.o
_print_help in getopt.o
_print_help in getopt.o
_print_help in getopt.o
_print_help in getopt.o
_print_help in getopt.o
_print_help in getopt.o
_print_help in getopt.o
_print_help in getopt.o
_print_help in getopt.o
_parse_error in getopt.o
_our_realloc in getopt.o
_our_malloc in getopt.o
_set_shell in getopt.o
_set_shell in getopt.o
_add_longopt in getopt.o
_add_long_options in getopt.o
_add_long_options in getopt.o
_normalize in getopt.o
_main in getopt.o
_main in getopt.o
_main in getopt.o
_main in getopt.o
_main in getopt.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [getopt] Error 1
Error: The following dependencies failed to build: atk gtk-doc gnome-doc-utils rarian getopt intltool gnome-common p5-pathtools p5-scalar-list-utils gtk2 cairo libpixman pango shared-mime-info xorg-libXcursor xorg-libXrandr libglade2 py25-cairo py25-numpy fftw-3 py25-nose py25-gobject
Error: Status 1 encountered during processing.
顺便说一下,getopt并不是通过macports安装的,它在/usr/bin/getopt这个路径下。
1 个回答
1
解决办法是重新安装所有的端口,因为我升级到了一个新的操作系统版本(从10.5升级到10.6)。
要重新安装你的端口,首先要保存你已经安装的端口列表:
port installed > myports.txt
清理任何未完成的构建,然后卸载所有已安装的端口:
sudo port clean installed
sudo port -f uninstall installed
查看myports.txt文件,逐个安装你真正想用的端口(而不是那些仅仅作为依赖需要的端口),记得指定合适的变体:
sudo port install portname +variant1 +variant2 ...
为了解决我的问题,我可以这样做:
sudo port install py25-gtk
现在可以正常工作了!
要了解如何重新安装端口的完整文档,请访问 http://trac.macports.org/wiki/Migration