登录 立即注册

首页 > 绿虎论坛 > Wine游戏助手 > 教程 (发帖)

标题: [精]Wine的编译依赖

作者: @Ta

时间: 03-12 10:27发布,07-12 11:38修改

点击: 6526

安装编译工具链

Ubuntu 22.04 执行

sudo apt install \
git \
cmake \
ninja-build \
pkg-config \
ccache \
flex \
bison \
clang \
llvm \
lld \
binfmt-support \
python-setuptools \
gcc-x86-64-linux-gnu \
g++-x86-64-linux-gnu \
libgcc-11-dev-i386-cross \
libgcc-11-dev-amd64-cross \
nasm \
python3-clang \
libstdc++-10-dev-i386-cross \
libstdc++-10-dev-amd64-cross \
libstdc++-10-dev-arm64-cross \
squashfs-tools \
squashfuse \
libc-bin \
libc6-dev-i386-amd64-cross \
lib32stdc++-11-dev-amd64-cross

Ubuntu 18.04 执行

sudo apt install \
git \
cmake \
ninja-build \
pkg-config \
ccache \
flex \
bison \
clang \
llvm \
lld \
binfmt-support \
python-setuptools \
gcc \
g++ \
libgcc-8-dev-i386-cross \
libgcc-8-dev-amd64-cross \
nasm \
libstdc++-8-dev-i386-cross \
libstdc++-8-dev-amd64-cross \
libstdc++-8-dev-arm64-cross \
squashfs-tools \
squashfuse \
libc-bin \
libc6-dev-i386-amd64-cross \
lib32stdc++-8-dev-amd64-cross

安装Wine的依赖(所有发行版执行)

如果某些包找不到,从命令里删除这一行即可,注意换行也要删掉,不能有多余的空行。命令结尾如果是\,要连续按两次回车。

64位版和wow64版(x32x64)编译依赖

sudo apt install \
libsdl2-dev \
libepoxy-dev \
libssl-dev \
libudev-dev \
libdbus-1-dev \
libxcomposite-dev \
libcups2-dev \
libopenal-dev \
libsane-dev \
libcapi20-dev \
libfreetype6-dev \
libxcursor-dev \
libxxf86vm-dev \
libdbus-1-dev \
libgphoto2-dev \
libxcomposite-dev \
liblcms2-dev \
libpulse-dev \
libgstreamer-plugins-base1.0-dev \
libudev-dev \
libunwind-dev \
libsdl2-dev \
libosmesa6-dev \
libcapi20-dev \
libcups2-dev \
libfontconfig1-dev \
libgsm1-dev \
libkrb5-dev \
libjxr-dev \
libmpg123-dev \
libopenal-dev \
libldap2-dev \
libxml2-dev \
libxslt1-dev \
libgnutls28-dev \
libgcrypt20-dev \
libvulkan-dev \
libpcap0.8-dev \
libsane-dev \
libvulkan-dev \
unixodbc-dev \
samba-libs \
samba-dev \
ocl-icd-opencl-dev \
libpcsclite-dev \
libusb-1.0-0-dev \
libv4l-dev

32位版编译依赖

如果要编译正常的 wine x86_64 版,请先编译安装32位版,然后把64位版编译安装到相同目录,此时64位的wine会自动安装为wine64。

64位依赖和32位依赖可能无法同时安装,你可能需要使用两个不同的容器安装不同的依赖。

开启i386架构:

sudo dpkg --add-architecture i386
sudo apt update

修复samba-dev的依赖问题:

rm -rf ./samba-dev*

apt download samba-dev:i386

dpkg -X samba-dev_*.deb ./samba-dev/
dpkg -e samba-dev_*.deb ./samba-dev/DEBIAN/

sed -i s/libparse-pidl-perl,/libparse-pidl-perl:amd64,/g ./samba-dev/DEBIAN/control
cat ./samba-dev/DEBIAN/control

dpkg -b ./samba-dev

apt install --reinstall ./samba-dev.deb
sudo apt install \
libsdl2-dev:i386 \
libepoxy-dev:i386 \
libssl-dev:i386 \
libudev-dev:i386 \
libdbus-1-dev:i386 \
libxcomposite-dev:i386 \
libcups2-dev:i386 \
libopenal-dev:i386 \
libsane-dev:i386 \
libcapi20-dev:i386 \
libfreetype6-dev:i386 \
libxcursor-dev:i386 \
libxxf86vm-dev:i386 \
libdbus-1-dev:i386 \
libgphoto2-dev:i386 \
libxcomposite-dev:i386 \
liblcms2-dev:i386 \
libpulse-dev:i386 \
libgstreamer-plugins-base1.0-dev:i386 \
libudev-dev:i386 \
libunwind-dev:i386 \
libsdl2-dev:i386 \
libosmesa6-dev:i386 \
libcapi20-dev:i386 \
libcups2-dev:i386 \
libfontconfig1-dev:i386 \
libgsm1-dev:i386 \
libkrb5-dev:i386 \
libjxr-dev:i386 \
libmpg123-dev:i386 \
libopenal-dev:i386 \
libldap2-dev:i386 \
libxml2-dev:i386 \
libxslt1-dev:i386 \
libgnutls28-dev:i386 \
libgcrypt20-dev:i386 \
libvulkan-dev:i386 \
libpcap0.8-dev:i386 \
libsane-dev:i386 \
libvulkan-dev:i386 \
unixodbc-dev:i386 \
ocl-icd-opencl-dev:i386 \
libpcsclite-dev:i386 \
libusb-1.0-0-dev:i386 \
libv4l-dev:i386

llvm-mingw(所有发行版执行)

llvm-mingw用于编译Wine的PE DLL,可从github下载:

解压后将路径加到PATH和LD_LIBRARY_PATH中,如:

wget -C https://github.com/mstorsjo/llvm-mingw/releases/download/20230320/llvm-mingw-20230320-ucrt-ubuntu-18.04-$(uname -m).tar.xz

tar xf llvm-mingw-20230320-ucrt-ubuntu-18.04-$(uname -m).tar.xz

export LD_LIBRARY_PATH=$PWD/llvm-mingw-20230320-ucrt-ubuntu-18.04-$(uname -m)/lib

export PATH=$PWD/llvm-mingw-20230320-ucrt-ubuntu-18.04-$(uname -m)/bin:$PATH

其中$PWD表示当前目录,如果你的llvm-mingw-20230320-ucrt-ubuntu-18.04-x86_64目录已经解压出来了,可以先cd到解压出来的llvm-mingw-20230320-ucrt-ubuntu-18.04-x86_64文件夹的父目录再执行上述export命令,无需再执行tar命令解压。

图片.png(119.66 KB)

编译命令(在执行过上述export命令的终端继续执行)

# 假设 ./wine 是 wine的源代码
cd ./wine

export CC=clang
export CXX=clang++

# 启用ccache编译缓存
export PATH=/usr/lib/ccache:$PATH

# 编译wow64版(x32x64)
mkdir build.x32x64
cd build.x32x64
../configure --enable-win64 --disable-tests --with-mingw --enable-archs=i386,x86_64 --prefix=$PWD/../../wine-x32x64
make -j$(nproc)
make install -j

# 编译32位版(需要安装32位版依赖,你可能需要两个不同的容器安装不同的依赖,分别编译然后安装到同一个文件夹)
cd ..
mkdir build.x32
cd build.x32
../configure --disable-tests --with-mingw --prefix=$PWD/../../wine-x86_64
make -j$(nproc)
make install -j

# 编译64位版(注意安装顺序,要先安装32位版,再安装64位版)
cd ..
mkdir build.x64
cd build.x64
../configure --enable-win64 --disable-tests --with-mingw --prefix=$PWD/../../wine-x86_64
make -j$(nproc)
make install -j

[隐藏样式|查看源码]


『回复列表(1|隐藏机器人聊天)』

1.
(/@Ta/2024-07-16 18:35//)

回复需要登录

11月24日 11:04 星期天

本站由hu60wap6华为CPU驱动

备案号: 京ICP备18041936号-1