{"id":339,"date":"2014-11-08T11:12:07","date_gmt":"2014-11-08T11:12:07","guid":{"rendered":"http:\/\/francisfisher.me.uk\/problem\/?p=339"},"modified":"2023-01-15T11:36:13","modified_gmt":"2023-01-15T11:36:13","slug":"building-wine-from-source-on-64-bit-debian","status":"publish","type":"post","link":"https:\/\/francisfisher.me.uk\/problem\/2014\/building-wine-from-source-on-64-bit-debian\/","title":{"rendered":"Building wine from source on 64-bit debian"},"content":{"rendered":"<p>If you need a&nbsp;particular version of wine to run a particular windows programme, you may well need to build wine from source. Most windows programmes need 32-bit wine so you can't simply&nbsp;build the package from source on your 64-bit installation of debian. The multi-arch feature of debian has matured a lot however there are still packages which can't have the 32-bit and 64-bit versions simultaneously installed. Because of this, you will need to build the 32-bit wine packages inside some kind of chroot environment. I am going to show you a fairly straightforward way of doing&nbsp;this&nbsp;with the help of&nbsp;lxc (Linux Containers).<\/p>\n<h2>Outline<\/h2>\n<p>Find and <a href=\"#download\">download source packages<\/a> for your version of wine at <a href=\"http:\/\/snapshot.debian.org\/package\/wine-unstable\/\">http:\/\/snapshot.debian.org\/package\/wine-unstable\/<\/a><\/p>\n<p>Install <a href=\"#builddep\">build dependencies,<\/a> possibly substituting package versions if you're not running debian unstable.<\/p>\n<p><a href=\"#build64\">Build 64-bit wine<\/a> as normal.<\/p>\n<p><a href=\"#build32\">Set up a 32-bit container<\/a>, install build dependencies&nbsp;and build wine in it.<\/p>\n<h2><a name=\"download\"><\/a>Download source packages<\/h2>\n<p>Find the version of wine you require at&nbsp;<a href=\"http:\/\/snapshot.debian.org\/package\/wine-unstable\/\">http:\/\/snapshot.debian.org\/package\/wine-unstable\/<\/a> and download the three files that make up the make up the source package. There should be an orig.tar.bz2, a .dsg and an .xz. For example,&nbsp;wine-unstable_1.7.17-1.debian.tar.xz,&nbsp;wine-unstable_1.7.17-1.dsc and&nbsp;wine-unstable_1.7.17.orig.tar.bz2. For the rest of this post I shall use 1.7.17 as an example, but feel free to substitute any particular version of wine that you might prefer.<\/p>\n<h2><a name=\"builddep\"><\/a>Build dependencies<\/h2>\n<p>The version of wine in debian stable at the time of writing is 1.4 and the build dependencies have changed somewhat between that package and recent versions of wine-unstable. If you do \"apt-get build-dep wine\" it will install a lot of the build dependencies of wine-unstable but it won't get all of them, so you will have to install some manually. (If you are running debian unstable&nbsp;then you can probably just do apt-get build-dep wine-unstable and get all of them directly, but if you're running debian unstable I would question why you need help from this article!)<\/p>\n<p>To find out the&nbsp;packages&nbsp;that&nbsp;are required to build wine-unstable, you can unpack the archive and look for the&nbsp;Build-Depends line in debian\/control, or you can just attempt to build&nbsp;the package and wait for any error message!<\/p>\n<pre>$ dpkg-source -x wine-unstable_1.7.17-1.dsc\n$ cd wine-unstable-1.7.17\n$ dpkg-buildpackage \ndpkg-buildpackage: source package wine-unstable\ndpkg-buildpackage: source version 1.7.17-1\ndpkg-buildpackage: source changed by Michael Gilbert &lt;mgilbert@debian.org&gt;\ndpkg-buildpackage: host architecture amd64\n dpkg-source --before-build wine-unstable-1.7.17\ndpkg-checkbuilddeps: Unmet build dependencies: libgphoto2-dev libfreetype6-dev (&gt;= 2.5.1) libgstreamer-plugins-base1.0-dev\ndpkg-buildpackage: warning: build dependencies\/conflicts unsatisfied; aborting\ndpkg-buildpackage: warning: (Use -d flag to override.)<\/pre>\n<p>The build dependencies may vary from version to version of wine so I can't give you exact instructions here. In this case, none of the three packages exist in the version of debian that I have installed. I substituted&nbsp;libgphoto2-2-dev, an earlier version (2.4.9) of libfreetype6-dev, and libgstreamer-plugins-base0.10-dev. Close enough. Remember the packages you install here as you will also be installing them to build the 32-bit version of wine.<\/p>\n<p><a name=\"build64\"><\/a><br \/>\nYou can now build the 64-bit version of the package with the -d option to ignore the build dependency problem:<\/p>\n<pre>dpkg-buildpackage -d<\/pre>\n<p>&nbsp;<\/p>\n<p><a name=\"build64\"><\/a><\/p>\n<h2><a name=\"build32\"><\/a>Building 32-bit&nbsp;wine<\/h2>\n<p>Unfortunately, having the 64-bit wine packages aren't enough as most windows programmes are compiled against 32-bit windows, so you will need to build the 32-bit packages. You can set up a chroot environment by hand with debootstrap and do this, or you can use lxc to set up a container for you. Containers are somewhere between a chroot and a virtual machine. The advantage of using lxc is that it takes exactly one command to set it up:<\/p>\n<pre>sudo lxc-create -n32bitwine -t debian -- --arch i386<\/pre>\n<p>This will set up a basic 32-bit debian environment in&nbsp;\/var\/lib\/lxc\/32bitwine\/rootfs. Copy the 3 wine source packages to the location within this environment that you will build them - for example the \/root folder. Then enter the container:<\/p>\n<pre>sudo lxc-start -n32bitwine<\/pre>\n<p>You will see a basic debian system booting, and you will be able to login as root with the password that was displayed at the end of the lxc-create command output. Set up your 32-bit build environment by addding a deb-src&nbsp;line to \/etc\/apt\/sources.list and running apt-get update.<\/p>\n<p>You may need to run \"dpkg-reconfigure locale\" if you see a lot of errors about LC_ALL like this:<\/p>\n<pre>perl: warning: Setting locale failed.\nperl: warning: Please check that your locale settings:\nLANGUAGE = \"en_GB:en\",\nLC_ALL = (unset),\nLC_TIME = \"en_GB.utf8\",\nLANG = \"en_GB.utf8\"\nare supported and installed on your system.\nperl: warning: Falling back to the standard locale (\"C\").<\/pre>\n<p>You will need to set up your 32-bit build dependencies as before. So I would recommend running \"apt-get build-dep wine\" to get most of the dependencies installed, then install 32-bit versions of the same packages that you had to install to get 64-bit wine built.<\/p>\n<p>Then extract the source archives (that you previously copied into the container) and build the package:<\/p>\n<pre>$ dpkg-source -x wine-unstable_1.7.17-1.dsc\n$ cd wine-unstable-1.7.17\n$ dpkg-buildpackage -n<\/pre>\n<p>If all has gone well, you can shut down the container with \"sudo lxc-stop -n32bitwine\" then copy the 32-bit packages out of your container filesystem. The 32-bit packages you need to install are wine32-unstable and libwine-unstable, while the 64-bit packages you need are wine-unstable, wine64-unstable and libwine-unstable.<\/p>\n<p>Install those packages along with the 64-bit wine packages manually and you are good to go!<\/p>\n<pre>sudo dpkg -i libwine-unstable_1.7.17-1_amd64.deb libwine-unstable_1.7.17-1_i386.deb wine32-unstable_1.7.17-1_i386.deb wine64-unstable_1.7.17-1_amd64.deb wine-unstable_1.7.17-1_amd64.deb<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>If you need a&nbsp;particular version of wine to run a particular windows programme, you may well need to build wine from source. Most windows programmes need 32-bit wine so you can't simply&nbsp;build the package from source on your 64-bit installation of debian. The multi-arch feature of debian has matured a lot however there are still [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[3],"tags":[15,16],"_links":{"self":[{"href":"https:\/\/francisfisher.me.uk\/problem\/wp-json\/wp\/v2\/posts\/339"}],"collection":[{"href":"https:\/\/francisfisher.me.uk\/problem\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/francisfisher.me.uk\/problem\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/francisfisher.me.uk\/problem\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/francisfisher.me.uk\/problem\/wp-json\/wp\/v2\/comments?post=339"}],"version-history":[{"count":10,"href":"https:\/\/francisfisher.me.uk\/problem\/wp-json\/wp\/v2\/posts\/339\/revisions"}],"predecessor-version":[{"id":425,"href":"https:\/\/francisfisher.me.uk\/problem\/wp-json\/wp\/v2\/posts\/339\/revisions\/425"}],"wp:attachment":[{"href":"https:\/\/francisfisher.me.uk\/problem\/wp-json\/wp\/v2\/media?parent=339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/francisfisher.me.uk\/problem\/wp-json\/wp\/v2\/categories?post=339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/francisfisher.me.uk\/problem\/wp-json\/wp\/v2\/tags?post=339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}