wine是linux下一款比较出色的运行Windows应用的工具。不过如果我们直接用apt install安装,那么只能安装很旧的版本。在此我想分享一下我编译安装wine的过程。
说在前面的是,wine分为32位和64位,一般我们用的是wine32位,因为大多数Windows程序还是32位的,32位wine只能运行32位应用,64位wine只能运行64位应用。与此同时还可以编译具有WoW64特性的wine,也就是既能运行32位应用也可以运行64位应用的,这个在下面会分别讲述。个人推荐使用Debian 10 64位系统进行编译。
下面开始吧!
1,下载wine源码并解压
去wine官网下载源码并解压。官方所有版本源码下载 备用地址
2, 安装编译wine必须的依赖库
编译wine源码必须要安装一些依赖库来执行编译和一些功能软件包来完善wine的功能,否则无法编译。这是官方给出的需要的库的列表以及各个发行版上的包名:
Library name(库名称) | Debian | Fedora | Arch | Function(作用) | Notes(说明) |
---|---|---|---|---|---|
Generally necessary(平常基本需要的库) | |||||
MinGW cross-compiler | gcc-mingw-w64 | mingw32-gcc, mingw64-gcc | mingw-w64-gcc | PE format DLLs | |
ALSA | libasound2-dev | alsa-devel | alsa-lib | Sound backend | At least one is necessary for sound. |
PulseAudio | libpulse-dev | libpulse-devel | libpulse | ||
libdbus | libdbus-1-dev | dbus-libs | dbus | Dynamic device detection (specifically, mass storage) | Removable drives may be incorrectly detected otherwise. |
libfontconfig | libfontconfig-dev | fontconfig-devel | fontconfig | Host font enumeration | Install if you want host fonts to be detected. |
libfreetype | libfreetype-dev | freetype-devel | freetype2 | FreeType font reading | |
libgnutls | libgnutls28-dev | gnutls-devel | gnutls | Cryptography | |
libinotify | N/A | N/A | N/A | File change notification | Only necessary for some platforms (Linux does not need this.) |
libjpeg | libjpeg62-turbo-dev | libjpeg-turbo-devel | libjpeg-turbo | Image format decoding | |
libpng | libpng-dev | libpng-devel | libpng | ||
libtiff | libtiff-dev | libtiff-devel | libtiff | ||
OpenGL | libgl-dev | mesa-libGL-devel | mesa | Hardware-accelerated/3D graphics | |
libunwind | libunwind-dev | libunwind-devel | libunwind | Exception unwinding | Necessary for x86_64 and arm64, but not used on other platforms. |
libX* | Window management | ||||
libxml, libxslt | libxml2-dev, libxslt1-dev | libxml2-devel, libxslt-devel | libxml2, libxslt | XML parsing | |
Needed for many applications(大多数程序运行需要的) | |||||
libfaudio | libfaudio-dev | libFAudio-devel | faudio | XAudio implementation | Needed for audio in some newer applications, especially games. (XAudio was initially released in 2008.) |
libgstreamer | libgstreamer1.0-dev, libgstreamer-plugins-base1.0-dev | gstreamer1-devel, gstreamer1-plugins-base-devel | gstreamer, gst-plugins-base-libs | Multimedia playback | Generally necessary for games or applications that play back audio or video files. |
libmpg123 | libmpg123-dev | mpg123-devel | mpg123 | mp3 decoding< |