Gentoo-Prefix 相当于是把 Gentoo 的 Portage 套件移植到别的平台上,比如 OSX,比如 Windows,比如 Ubuntu 等其他 Linux 平台.

官网上给出的介绍和步骤的十分的简单,下载脚本,加上执行权限,执行就行.

wget http://rsync.prefix.bitzolder.nl/scripts/bootstrap-prefix.sh
chmod +x bootstrap-prefix.sh
./bootstrap-prefix.sh

这样就可以了.但是实际上在 10.11 何止是有问题…简直爆炸.

第一个问题是没有 10.11 的 Profile,这个简单,找到emerge同步就行了

cd ~/Gentoo/tmp/usr/bin
./emerge --sync

接下来就是第二个麻烦,编译 llvm3.4.2 的时候出错.报错信息如下:

ld: library not found for -lc++
ld: warning: ignoring file /Users/feather/Gentoo/tmp/lib/dylib1.o, file was built for unsupported file format ( 0xCF 0xFA 0xED 0xFE 0x07 0x00 0x00 0x01 0x03 0x00 0x00 0x00 0x01 0x00 0x00 0x00 ) which is not the architecture being linked (i386): /Users/feather/Gentoo/tmp/lib/dylib1.o

嗯,ld报错,在 Gentoo 论坛上问了问似乎是ld的问题,找到Prefix里的ld,用/usr/bin/ld 替换掉就行.

接下来就是更恶心的了,编译完 Readline 之后编译Bash报错.我是直接注释掉了bash.

vim bootstrap-prefix.sh

找到如下的片段

pkgs=(
    $([[ ${CHOST} == *-aix* ]] && echo dev-libs/libiconv ) # bash dependency
    sys-libs/ncurses
    sys-libs/readline
    app-shells/bash
    sys-apps/sed
    app-arch/xz-utils
    sys-apps/gentoo-functions
    sys-apps/baselayout-prefix
    sys-devel/m4
    sys-devel/flex
    sys-devel/bison
    sys-devel/patch
    sys-devel/binutils-config

直接注释掉app-shells/bash就行.

接下来是emerge -u system的时候提示 python3 blocks eselect-python,这个解决办法是强制指定 python2.

PYTHON_TARGETS="python2.7"

希望可以早日完美bootstrap…


Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.