實驗環境

Software Enviroment Version
Linux mint Debian Edition 64 bit
Wine 1.6.2 (32 bit)

準備編譯環境

由於系統是64bit,但是我們要編譯與安裝 32bit 的 Wine,為了避免系統的 library 混亂,使用 deboostrap 建立一個獨立的環境進行編譯的工作。

mkdir /opt/build/chroot32/ -p
sudo apt-get install debootstrap
cd /opt/build
sudo debootstrap --arch i386 sid chroot32 http://free.nchc.org.tw/debian/
sudo mount -o bind /proc /opt/build/chroot32/proc
sudo mount -o bind /sys /opt/build/chroot32/sys
sudo mount -o bind /dev /opt/build/chroot32/dev  
sudo mount -o bind /dev/pts /opt/build/chroot32/dev/pts
sudo mount -o bind /tmp /opt/build/tmp
sudo cp /etc/resolv.conf /home/build/chroot32/etc/resolv.conf
sudo chroot /opt/chroot32

接下來初始化這個子系統:

apt-get update   
apt-get install locales sudo vim  
echo 'export LC_ALL="C"' >> /etc/bash.bashrc
echo 'export LANG="C"' >> /etc/bash.bashrc  
echo "127.0.0.1 localhost $HOSTNAME"  >> /etc/hosts  
source /etc/bash.bashrc  
useradd -m -s /bin/bash -G sudo sandbox  
passwd sandbox
echo 'Defaults !tty_tickets' >> /etc/sudoers
su sandbox

安裝編譯所需的函式庫:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install ia32-libs-i386 libgstreamer-plugins-base0.10-0
sudo apt-get install libx11-dev:i386 libfreetype6-dev:i386 libxcursor-dev:i386 libxi-dev:i386 libxxf86vm-dev:i386 libxrandr-dev:i386 libxinerama-dev:i386 libxcomposite-dev:i386 libglu-dev:i386 libosmesa-dev:i386 libglu-dev:i386 libosmesa-dev:i386 libdbus-1-dev:i386 libgnutls-dev:i386 libncurses-dev:i386 libsane-dev:i386 libv4l-dev:i386 libgphoto2-2-dev:i386 liblcms2-dev:i386 libgstreamer-plugins-base0.10-dev:i386 libcapi20-dev:i386 libcups2-dev:i386 libfontconfig-dev:i386 libgsm1-dev:i386 libtiff-dev:i386 libpng-dev:i386 libjpeg-dev:i386 libmpg123-dev:i386 libopenal-dev:i386 libldap-dev:i386 libxrender-dev:i386 libxml2-dev:i386 libxslt-dev:i386 libhal-dev:i386 gettext:i386 prelink:i386 bzip2:i386 bison:i386 flex:i386 oss4-dev:i386 checkinstall:i386 ocl-icd-libopencl1:i386 opencl-headers:i386 libasound2-dev:i386 build-essential binutils-multiarch

編譯 Wine

下載 Wine 的原始碼:

wget http://sourceforge.net/projects/wine/files/Source/wine-1.6.2.tar.bz2
tar xvf wine-1.6.2.tar.bz2
cd wine-1.6.2/

編譯 Wine:

./configure
time make
sudo checkinstall --install=no

執行兩次 exit 離開 deboostrap 系統

安裝 package

安裝 Wine package:

sudo dpkg -i /opt/build/chroot32/home/sandbox/wine-/wine_-1_i386.deb .

參考資料

Comments

comments powered by Disqus