#!/bin/bash -- # author: Jesse Gersenson # file: 64-bit-wine-ubuntu.sh # version: 1.3.13 # url: http://www.jesseo.com/chess/64-bit-wine-ubuntu-1.3.13.sh # status: working # # # what's it for? # ------------------ # for people who want to run 64-bit *.exe engines in Ubuntu, from 32-bit GUI's # such as Arena or Aquarium. # # the script automatically compiles a 32-bit/64-bit install of wine on Ubuntu 10.10 64-bit. # this is a temporary fix - eventually 64 bit wine will be installable from the Ubuntu # package manager - as is currently (written Dec 19, 2010) the case with Sabayon 5.4 and OpenSUSE 11.3. # # # how to use it? # ------------------ # 1. first, update your system. use these two lines at the command prompt: # sudo apt-get update # sudo apt-get upgrade # reboot your system. # # 2. save the script, http://www.jesseo.com/chess/64-bit-wine-ubuntu.sh, to your # user's home folder /home/USERNAME # # 3. open a terminal and change it's permissions by entering # sudo chmod +x 64-bit-wine-ubuntu.sh # # 4. run the script with the following command # ./64-bit-wine-ubuntu.sh # # let it run for about an hour. it will download about 1gb of data and will compile two version of # wine. depending on the speed of your machine # and internet connection, the script can take a few hours. on a 800KB connection, with an i3m # processor, it takes about 40 minuets. # note: don't interupt the script. it'll take a while. this message will be on the screen for a # long time, "Configure: Finished. Do 'make' to compile wine" # # i hope this doesn't break your computer - # but i guess it could. enjoy, Jesse. # echo -n "Enter the number of cpu threads to use when compiling: " read cores # # Jakub: note, that the negation (!) is before the '['. This is different # from [ ! "$cores" -gt 0 ], since it also catches situation # when user didn't enter a number at all (empty string, characters), in which # case the 'test' call fails. (-gt is numeric comparison) # if ! [ "$cores" -gt 0 ]; then echo "Number of threads must be > 0" exit 1 fi echo "$cores threads will be used." # make a directory in the user's root folder, in one we'll be compiling 32-bit wine, in the # other 64-bit wine if [ -d wine64 ] then echo "the folder wine64 already exists." echo "moving wine64 to wine64-old and creating directory wine64" [ -d wine64-old ] && { echo "Error: The backup directory wine64-old already exist"; exit 1; } sudo mv wine64 wine64-old || { echo "Cannot backup wine64 directory"; exit 1; } mkdir wine64 || { echo "Cannot create wine64 directory"; exit 1; } else echo "creating directory wine64" mkdir wine64 fi if [ -d wine32 ] then echo "the folder wine32 already exists" echo "moving it to wine32-old and creating a fresh /wine32" [ -d wine32-old ] && { echo "Error: The backup directory wine32-old already exist"; exit 1; } sudo mv wine32 wine32-old || { echo "Cannot backup wine32 directory"; exit 1; } mkdir "wine32" || { echo "Cannot create wine32 directory"; exit 1; } else echo "making directory wine32" mkdir wine32 fi if [ -d .wine ] then echo "the folder .wine already exists. renaming folder .wine2 and uninstalling wine" sudo mv .wine .wine-old || { echo "Cannot backup .wine directory"; exit 1; } sudo apt-get remove wine1.0 wine1.2 wine1.3 else echo "i couldn't find an installed version of wine." sudo apt-get remove wine1.0 wine1.2 wine1.3 fi # Jakub: Let the script fail if any following command fails. # Note, that the option doesn't apply to commands executed by 'if' construction (test) # # For purposes of this script it is probably good rule: If you will fail, you should # fail as early as possible. # We could use this setting already at the beginning, but for most common # errors it is maybe better to provide some user-friendly message, so we # checked the errors until now "by hand" set -e # add the wine repository and update all repositories. # update the repository. -y means don't prompt us with Y/N questions. sudo add-apt-repository ppa:ubuntu-wine/ppa sudo apt-get -y update # grab wine64 development packages if [ -e install-wine-deps.sh ] then echo "install-wine-deps.sh is already on your machine?! we won't download a second copy" else echo "running: wget http://winezeug.googlecode.com/svn/trunk/install-wine-deps.sh" wget http://winezeug.googlecode.com/svn/trunk/install-wine-deps.sh fi # change permissions of the script chmod 755 ./install-wine-deps.sh # # run the script with root privileges. you'll be prompted for your root password. sudo sh install-wine-deps.sh # # grab the 32-bit dependencies for wine1.3 # note: eventually this would need to be updated to wine1.4, wine 18.2, etc sudo apt-get -y build-dep wine1.3 sudo apt-get -y install cabextract # # grab wine version 1.3.13 from sourceforge and untar it if [ -e wine-1.3.13 ] then echo "the folder /wine-1.3.13 is already in your root directory." echo "i'm deleting it and will grab a fresh copy from" echo "http://switch.dl.sourceforge.net/project/wine/Source/wine-1.3.13.tar.bz2" sudo rm -r wine-1.3.13 else echo "getting a copy of wine-1.3.13 from" echo "http://switch.dl.sourceforge.net/project/wine/Source/wine-1.3.13.tar.bz2" echo "and extracting it to your user's root directory" fi wget http://switch.dl.sourceforge.net/project/wine/Source/wine-1.3.13.tar.bz2 tar -xjvf wine-1.3.13.tar.bz2 # # change into the wine64 directory in the user's home directory. # change into the wine64 directory in the user's home directory. cd wine64 # # configure 64-bit wine ../wine-1.3.13/configure --enable-win64 # # make the install using 5 threads. this is a good number if you have 4 processors. # note: change the number to -j2 if you have a dual core machine echo "Compiling 64-bit wine. This will take 5 min - 5 hours," echo "depending on the speed of your machine" make -j$cores > make.log 2>&1 echo "" echo "64-bit wine compiled. log file saved as ~/make.log" echo " " # change to the wine32 directory and build the 32 bit version of wine. tying it together # with the 64-bit version we just built cd ../wine32 ../wine-1.3.13/configure --with-wine64=../wine64 echo "Now compiling 32-bit wine. This will take 5 min - 5 hours," echo "depending on the speed of your machine" sudo make -j$cores > make.log 2>&1 echo "finished make of 32-bit wine. now we'll run sudo make install" #now install wine64 cd ../wine64 echo "" echo "32-bit make install complete. now we'll run sudo make install on the 64-bit build" sudo make install echo "" echo "done." # the script is done. # here are the steps one would use to use winetricks - hacked # to disable their disabling winetricks on 64-bit wine systems # install cabextract, riched30, and gdiplus #wget http://www.jesseo.com/chess/winetricks.sh #sudo apt-get -y install cabextract #cd #chmod +x winetricks.sh #./winetricks.sh riched30 #./winetricks.sh gdiplus