个人工具

UbuntuHelp:BuildingWineFromGit

来自Ubuntu中文

跳转至: 导航, 搜索

Introduction

Wine is an open source implementation of the Windows API that allows you to run applications intended to run under the Microsoft Windows operating system on Linux, Unix and Unix-variant operating systems like Mac OS X. In this guide we will be compiling the latest version of wine from source code retrieved from the wine developer's git repository. The developer's repository contains the most recent code for the project and is updated on almost a daily basis.

Step 1: Install git

First you will need to install git. You can obtain git by opening a terminal and issuing the following command:

# sudo apt-get install git-core

Step 2: Installing dependencies

Next you will need to install a compiler and the necessary wine dependencies. You can obtain these packages by opening a terminal and issuing these commands:

# sudo apt-get install build-essential
# sudo apt-get build-dep wine

Step 3: Cloning the git repository

# git clone git://source.winehq.org/git/wine.git wine

This will create a folder containing the wine source code in your home directory.

Step 4: Enter Wine directory

After the wine source is finished downloading from git you will need to enter the folder containing the source code from the terminal using the command:

# cd wine

Step 5: Compiling Wine

Finally you are ready to build wine from source code. This can be achieved with the following set of commands.

# ./configure
# make depend && make
# sudo make install

At this point wine should be installed and usable. By default wine creates a hidden folder under your home directory called .wine and installs programs under .wine/drive_c, which acts as the local hard disk of a Microsoft Windows installation.

Step 5: Configuring Wine

Before running wine for the first time you will probably want to configure wine and adjust the settings. This can be achieved with the following command on the terminal or by using ctrl+alt+f2 and entering:

# winecfg

Using Wine

To install a program with wine you can click on the cdrom drive using the GUI “Places” menu in Ubuntu Linux, clicking on the “Computer” sub-menu item and then viewing the contents of the cdrom. The setup.exe file included on the cdrom can be executed using Wine. To execute the program right-click on the application and choose “run with wine”. Alternatively, you can execute the program from the command terminal using the command:

# wine (executable file name).exe

Uninstalling Wine

If at any point you wish to remove the wine installation you would enter the wine directory and enter the command:

# sudo make uninstall