10 June 2013

444.Building Wine 1.6-rc1 on Debian Wheezy using a chroot

Here's a generic way of building wine which works for 1.6-rc1 (and 1.5.28 and everything in between except 1.5.30).

The build instructions are recycled from my 1.5-series instructions -- the 1.5 series is the development version and Wine 1.6 is the new stable release, and so Wine 1.5.31 and 1.6-rc1 should be pretty similar. As a release candidate (rc) 1.6-rc1 isn't meant for production work. For that, use Wine 1.4 which is the current stable series.

Here's a link to the release announcement: http://www.winehq.org/announce/1.6-rc1

See here for information about 3D acceleration using libGL/U with Wine: http://verahill.blogspot.com.au/2013/05/429-briefly-wine-libglliubglu-blender.html

Getting started:
If you set up a e.g. chroot to build 1.5.28 or  before or 1.5.31 (1.5.30 had a bug which needed patching), you don't need to set up a new chroot to build 1.6-rc1. In that case, skip the set-up step below and instead re-enter your existing chroot like this:
sudo mount -o bind /proc wine32/proc
sudo cp /etc/resolv.conf wine32/etc/resolv.conf
sudo chroot wine32
su sandbox
cd ~/tmp

And skip to 'Building wine'.

Otherwise do this:
Setting up the Chroot
sudo apt-get install debootstrap
mkdir $HOME/tmp/architectures/wine32 -p
cd $HOME/tmp/architectures
sudo debootstrap --arch i386 wheezy $HOME/tmp/architectures/wine32 http://ftp.au.debian.org/debian/
sudo mount -o bind /proc wine32/proc
sudo cp /etc/resolv.conf wine32/etc/resolv.conf
sudo chroot wine32

You're now in the chroot:
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 ' localhost beryllium' >> /etc/hosts
source /etc/bash.bashrc
adduser sandbox
usermod -g sudo sandbox
echo 'Defaults !tty_tickets' >> /etc/sudoers
su sandbox
cd ~/

Replace 'beryllium' with the name your host system (it's just to suppress error messages)

Building Wine
While still in the chroot, continue (the i386 is ok; don't worry about it -- you don't actually need it):

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 liblcms-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
mkdir ~/tmp
cd ~/tmp
wget http://prdownloads.sourceforge.net/wine/wine-1.6-rc1.tar.bz2

tar xvf wine-1.6-rc1.tar.bz2
cd wine-1.6-rc1/
time make -j3
sudo checkinstall --install=no
checkinstall 1.6.2, Copyright 2009 Felipe Eduardo Sanchez Diaz Duran This software is released under the GNU GPL. The package documentation directory ./doc-pak does not exist. Should I create a default set of package docs? [y]: Preparing package documentation...OK Please write a description for the package. End your description with an empty line or EOF. >> wine 1.6-rc1 >> ***************************************** **** Debian package creation selected *** ***************************************** This package will be built according to these values: 0 - Maintainer: [ root@beryllium ] 1 - Summary: [ wine 1.6-rc1] 2 - Name: [ wine-1.6 ] 3 - Version: [ 1.6-rc1] 4 - Release: [ 1 ] 5 - License: [ GPL ] 6 - Group: [ checkinstall ] 7 - Architecture: [ i386 ] 8 - Source location: [ wine-1.6-rc1 ] 9 - Alternate source location: [ ] 10 - Requires: [ ] 11 - Provides: [ wine-1.6 ] 12 - Conflicts: [ ] 13 - Replaces: [ ]
Checkinstall takes a little while (In particular this step: 'Copying files to the temporary directory...').

Installing Wine

Exit the chroot
sandbox@beryllium:~/tmp/wine-1.6-rc1$ exit
root@beryllium:/# exit

On your host system
 Enable multiarch* and install ia32-libs, since you've built a proper 32 bit binary:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install ia32-libs

*At some point I think ia32-libs may be replaced by proper multiarch packages, but maybe not. So we're kind of doing both here.

 Copy the .deb package and install it
sudo cp wine32/home/sandbox/tmp/wine-1.6-rc1/wine_1.6-rc1-1_i386.deb .
sudo chown $USER wine_1.6-rc1-1_i386.deb
sudo dpkg -i wine_1.6-rc1-1_i386.deb


  1. Excellent tutorial! I have now successfully installed wine 1.6-rc3 (yeah it works the same as rc1) on my Debian box, and have played some Steam games using it.

    One hint: you can set the requirements field in checkinstall to force ia32-libs as a requirement so that you don't have to manually add it (actually in my case I added the Open GL NVidia library as well, so my depends line is 'libgl1-nvidia-glx:i386,ia32-libs-i386:i386'). Note that depends are not space separated, only a comma, and I found that ia32-libs did not work, but ia32-libs-i386:i386 did; YMMV, as I don't know the reason for the difference. Perhaps it assumes arch=i386 and there is no package called ia32-libs in that arch?


    1. Thanks for the feedback. I'm not sure about the reason for ia32-libs not work vs ia32-libs-i386:i386, but your suggestion sounds reasonable.

  2. i got error:

    ======================== Installation successful ==========================
    Copying documentation directory...
    Copying files to the temporary directory...OK
    Stripping ELF binaries and libraries...OK
    Compressing man pages...OK
    Building file list...OK

    Building Debian package... FAILED!
    *** Failed to build the package

    Do you want to see the log file? [y]: n
    Erasing temporary files...OK
    Deleting temp dir...OK

    Now i am looking for solution

    1. You should hit 'y' when you're asked to see the log file since it will tell you what the problem is.

    2. I'll bet this was the error the individual above received, as did I.

      dpkg-deb: error: parsing file '/var/tmp/tmp.FGf9SgYpP7/package/DEBIAN/control' near line 7 package 'wine-1.6':
      error in Version string 'rc1-1': version number does not start with digit

    3. I presume that you've managed to sort it out, but for others it may be helpful with an explanation: make sure to edit field 3 (Version) in the checkinstall dialogue so that it reads e.g. 1.6-rc1 instead of rc1