Just wrote this entire howto, and the forums sent me a 502 error and all sort of stuff and long story short, I am rewriting it now...
Important note!
If you dont need a patched wine, I strongly reccomend you to use the package manager to installed compiled sources. To obtain the latest wine in this way, you first need to add the gpg key of winehq's repository:
Then add the repository:Code:wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | sudo apt-key add -
And then wine can be installed with:Code:sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/$(lsb_release -sc).list \ -O /etc/apt/sources.list.d/winehq.list
IntroductionCode:sudo apt-get update sudo apt-get install wine
Well, although there are repositories with the latest development verison of wine 1.1.12 at the date of writing, many of the latest games require some patches to the source. So, this is what this tutorial is about!
Unlike other howtos ive seen elsewhere, I download and keep the sources up to date using git, and install wine with checkinstall. Almost all this with some slight modifications was written by the user Massimo from appDB
1. Installing Wine
So lets begin by removing wine (only if you have installed it already through the package manager):
If you had previously added the winehq repository, delete it:Code:sudo apt-get remove wine
Then, we install git:Code:sudo rm /etc/apt/sources.list.d/winehq.list
And download wine sources from the git repository (this should take a while):Code:sudo apt-get install git-core
This will download the sources at a folder called wine-git inside your home folder. You should keep this folder after the installation so it is easier (and less time consuming) to update and apply your patches later.Code:git clone git://source.winehq.org/git/wine.git ~/wine-git
Next, we install the necessary packages to build wine:
You will also need checkinstall to install it later:Code:sudo apt-get build-dep wine sudo apt-get install fakeroot
Build wine. This will quite some time (over 40 minutes to me with an AthlonX2 with 2gb ram):Code:sudo apt-get install checkinstall
Then, install wine (DONT CLOSE YOUR TERMINAL! or if you did, open it again and run cd ~/wine-git). I use checkinstall because it creates a deb package and installs it, and this makes it easier at the end to manage all of your compiled programs (NOTE, if you have installed the latest wine with the package manager, then you should delete the entry of the wine repository from /etc/apt/sources.list and then run sudo apt-get update before continuing). To install wine, I need to specify the version on checkinstall so it works. For example, with the 1.1.12 version, I did this:Code:cd ~/wine-git ./configure --prefix=/usr make
Answer yes to everything, add a minor comment to the package if you like, and you'll have wine installed.Code:sudo checkinstall --fstrans=no --pkgversion=1.1.12
2. Patching Wine
This instructions can be followed any number of times you want, for all the patches you want, after going through the installation as explained above. Take care though, that it might be possible that patching one application will affect another one.
Almost all patches can be downloaded from internet. So, Ill suppose you have the URL of the patch (referred as <URL>). First, we will create a folder to store your patches on your home folder:
Then we download the patch:Code:mkdir ~/wine-patches
Where <PATCH> is the name you want for the patch. If you have more than one patch, you need to download each one separetaly. Then, patch and compile wine (Compilation will take MUCH less time than before):Code:wget <URL> -O ~/wine-patches/<PATCH>
If you have more than one patch, run the patch command for each patch before compiling. Finally, you must install it againg with checkinstall:Code:cd ~/wine-git patch -p1 < ~/wine-patches/<PATCH> make
and TADA! you have a patched wine installed.Code:sudo checkinstall --fstrans=no --pkgversion=1.1.12
3. Updating Wine
To update wine, first you need to update your sources:
Then you should apply your patches as explained in the previous section, compile, and install (I suppose here the version changed form 1.1.12 to 1.1.13 so I change that on checkinstall):Code:cd ~/wine-git git reset --hard origin git fetch git rebase origin
(REMEMBER TO RUN THE PATCH COMMAND FOR EACH OF YOUR PATCHES)Code:cd ~/wine-git patch -p1 < ~/wine-patches/<PATCH> make sudo checkinstall --fstrans=no --pkgversion=1.1.13
4. Undoing patches
To undo patches, you can try two different methods, number 1 is a sure way to go, but is time consuming cause you need to recompile everything, and number 2 should compile swiftly, but I havent personally tried it. I recommend trying number 2 first, and if it fails, trying number 1.
Method 1: Slow but sure...
If a particular patch ruined your installation, then you have to recover the original sources, apply the patches you want to use (obviously, omitting the one that left a mess), recompile and install:
Remember to run the patch command for all your patches but the one that caused conflicts!Code:cd ~/wine-git git reset --hard origin patch -p1 < ~/wine-patches/<PATCH> make sudo checkinstall --fstrans=no --pkgversion=1.1.13
Method 2: swift, but untested
However, the precious procedure will have to recompile everything and so, it will take quite long. The unsure way to do this while avoiding (I mean unsure cause I havent test it) is to unpatch your sources:
Where the patch command should be run for all patches you wish to undo. This should take much less time than compiling with the first method. If it works for you, please let me know...Code:cd ~/wine-git patch -p1 -R < ~/wine-patches/<PATCH> make sudo checkinstall --fstrans=no --pkgversion=1.1.13
5. Wine prefixes, or as I like to call them, BOTTLES!
Next, Ill explain an additional topic, BOTTLES!. Bottles (actually called wine prefixes, but I got accustomed to this term) let you encapsulate different applications, and apply particular tweaks only to the envorionment of a particular application. Here Ill explain how to install an application in a bottle, run the wine configuration utility winecfg, downloading windows dlls and setting as native, and uing winetricks, all these for an specific bottle so we dont mess with other applications configuration.
5.1 Keeping all your application on separate "bottles"
It is highly recommended to keep all your applications on separete "bottles" with they're own tweaks. This is because the tweaks for one application usually render other ones useless. To do this, lets create first a directory to keep all your bottles (You only need to do this once!):
Then, to install an application, do the following:Code:mkdir ~/wine-bottles
So, for example, if I want to install spore, Ill call the bottle spore, my username is pablo, and the installer is in /media/cdrom0/SPORESetup.exe and the previous commands would read:Code:export WINEPREFIX=/home/<YOUR-USERNAME>/wine-bottles/<BOTTLE-NAME> wine <PATH-TO-INSTALLER>
And thats it!Code:export WINEPREFIX=/home/pablo/wine-bottles/spore wine /media/cdrom0/SPORESetup.exe
5.2 Running winecfg to configure different bottles
There are some windows applications that I prefer to keep windowed, while others full-screened. Another advantage of bottles is that you can configure this and many other stuff with winecfg for each bottle independently. To run winecfg for a bottle, you must open a terminal, specify the bottle, and run winecfg:
And go ahead and configure all you want!Code:export WINEPREFIX=/home/<YOUR-USERNAME>/wine-bottles/<BOTTLE-NAME> winecfg
5.3 Set a dll as native on a bottle
To use a downloaded dll as native for an specific bottle, you must download your dll and put it at the appropriate place in the appropriate bottle. The folder where you must put the dlls is:
(In case you dont know, ~/ is equal to /home/<YOUR-USERNAME>/)Code:~/wine-bottles/<BOTTLE-NAME>/drive_c/windows/system32
Then, open the winecfg application for the bottle as mentioned in the previous section, select libraries, look for your dll, and set it as native.
5.4 Use winetricks with a bottle
winetricks is an usefull app to install common packages needed for some applications. Usually, the versions required for different applications vary, for instance, some applications work with dotnet 1.1, and others with dotnet 2.0, so By keeping things on separate bottles, you can solve this.
First, lets download the winetricks script and make it executable (You only need to do this once). Ill keep winetricks on the wine-patches folder:
Then, you can run winetricks with the console, specifying first the bottle, and the running winetricks:Code:cd ~/wine-patches/ wget http://www.kegel.com/wine/winetricks chmod +x winetricks
5.5 File associationCode:export WINEPREFIX=/home/<YOUR-USERNAME>/wine-bottles/<BOTTLE-NAME> ~/wine-patches/winetricks
To associate a specific file type in gnome with a wine application, first, create an executable for your application in /usr/bin (WARNING: BE SURE NOT TO OVERWRITE ANYTHING ON /usr/bin).First, create an open the file to edit it:
Here <LAUNCHER-NAME> is the name of the file that will launch your application. REMEMBER NOT TO OVERWRITE ANYTHING UNDER /usr/bin. On the editor, add this content to the file and save it:Code:sudo gedit /usr/bin/<LAUNCHER-NAME>
Remember to change <YOUR-USERNAME> and <BOTTLE-NAME> accordingly, and where it says <PATH-TO-EXE> put the path of your program .exe file. If you are not using bottles, drop the line that starts with export. Then, make this executable:Code:export WINEPREFIX=/home/<YOUR-USERNAME>/wine-bottles/<BOTTLE-NAME> wine "<PATH-TO-EXE>" "`winepath -w "$*"`"
Then, on a file you want to associate to this application, select "open with another application", then choose "use custom command", and put this:Code:sudo chmod +x /usr/bin/<LAUNCHER-NAME>
After that, your files should be correctly associated.Code:/usr/bin/<LAUNCHER-NAME> %f
6. Conclusions
Well, I hope this helps someone. If something can be run with wine, then by following this instructions together with specific instructions for the installation of the application (such as patches, extra things needed, etc) you should get it done, as long as there are no hardware specific problems that affect you. Almost all the application-specific info you need can be found at appdb (http://appdb.winehq.org/).
Bye!



Adv Reply




Bookmarks