Wine/ja

From Gentoo Wiki
Jump to:navigation Jump to:search
This page is a translated version of the page Wine and the translation is 71% complete.
Other languages:

Wine (Wine Is Not an Emulator) は、Microsoft Windows ソフトウェアを Linux および他の POSIX 互換オペレーティングシステム上で実行できるようにする、アプリケーション互換レイヤーです。この記事では、Gentoo 上の汎用的な Wine 環境のインストール、設定、および保守について取り扱います。

Wine の変種

変種を選択する

追加のパッチセットは vanilla Wine には存在しないバグを導入することもありますが、他の Wine に存在するバグを修正していることもあります。

インストール

USE フラグ

USE flags for virtual/wine Virtual for Wine that supports multiple variants and slotting

proton Enable Valve Software's fork of Wine
staging Enable Wine-Staging's Patchset

USE flags for app-emulation/wine-vanilla Free implementation of Windows(tm) on Unix, without external patchsets

+X Add support for X11
+alsa Add support for media-libs/alsa-lib (Advanced Linux Sound Architecture)
+fontconfig Support for configuring and customizing font access via media-libs/fontconfig
+gecko Enable mshtml support using app-emulation/wine-gecko
+gstreamer Add support for media-libs/gstreamer (Streaming media)
+mingw Build PE files using a MinGW toolchain for better compatibility
+mono Enable .NET support using app-emulation/wine-mono
+opengl Add support for OpenGL (3D graphics)
+sdl Enable gamepad support using media-libs/libsdl2
+ssl Add support for SSL/TLS connections (Secure Socket Layer / Transport Layer Security)
+strip Allow symbol stripping to be performed by the ebuild for special files
+truetype Add support for FreeType and/or FreeType2 fonts
+unwind Add support for call stack unwinding and function name resolution
+vkd3d Enable DirectX 12 support using app-emulation/vkd3d
+vulkan Add support for 3D graphics and computing via the Vulkan cross-platform API
+xcomposite Enable support for the Xorg composite extension
capi Enable ISDN support using net-libs/libcapi
crossdev-mingw Use sys-devel/crossdev for the toolchain rather than dev-util/mingw64-toolchain (requires manual setting up)
cups Add support for CUPS (Common Unix Printing System)
custom-cflags Build with user-specified CFLAGS (unsupported)
debug Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
dos Pull in games-emulation/dosbox to run DOS applications
ffmpeg Enable ffmpeg/libav-based audio/video codec support
gphoto2 Add digital camera support
kerberos Add kerberos support
ldap Add LDAP support (Lightweight Directory Access Protocol)
llvm-libunwind Use sys-libs/llvm-libunwind instead of sys-libs/libunwind
netapi Enable support for configuring remote shares using net-fs/samba
nls Add Native Language Support (using gettext - GNU locale utilities)
odbc Add ODBC Support (Open DataBase Connectivity)
openal Add support for the Open Audio Library
opencl Enable OpenCL support (computation on GPU)
osmesa Enable off-screen rendering (OpenGL in bitmaps) support
pcap Support packet capture software (e.g. wireshark)
perl Install helpers that require perl (winedump/winemaker)
pulseaudio Add sound server support via media-libs/libpulse (may be PulseAudio or PipeWire)
samba Pull in net-fs/samba with winbind for NTLM auth support
scanner Add support for scanner hardware (e.g. build the sane frontend in kdegraphics)
selinux !!internal use only!! Security Enhanced Linux support, this must be set by the selinux profile or breakage will occur
smartcard Enable smartcard support
udev Enable virtual/udev integration (device discovery, power and storage device support, etc)
udisks Enable storage management support (automounting, volume monitoring, etc)
usb Add USB support to applications that have optional USB support (e.g. cups)
v4l Enable support for video4linux (using linux-headers or userspace libv4l libraries)
wayland Enable dev-libs/wayland backend
wow64 Enable running 32bit applications without 32bit ELF multilib by mapping to 64bit calls (experimental, *may* have worse/unusable OpenGL performance or other issues compared to USE=abi_x86_32, also lacks 16bit support) -- still need dev-util/mingw64-toolchain with abi_x86_32 which itself does not need multilib
xinerama Add support for querying multi-monitor screen geometry through the Xinerama API

USE flags for app-emulation/wine-staging Free implementation of Windows(tm) on Unix, with Wine-Staging patchset

+X Add support for X11
+alsa Add support for media-libs/alsa-lib (Advanced Linux Sound Architecture)
+fontconfig Support for configuring and customizing font access via media-libs/fontconfig
+gecko Enable mshtml support using app-emulation/wine-gecko
+gstreamer Add support for media-libs/gstreamer (Streaming media)
+mingw Build PE files using a MinGW toolchain for better compatibility
+mono Enable .NET support using app-emulation/wine-mono
+opengl Add support for OpenGL (3D graphics)
+sdl Enable gamepad support using media-libs/libsdl2
+ssl Add support for SSL/TLS connections (Secure Socket Layer / Transport Layer Security)
+strip Allow symbol stripping to be performed by the ebuild for special files
+truetype Add support for FreeType and/or FreeType2 fonts
+unwind Add support for call stack unwinding and function name resolution
+vulkan Add support for 3D graphics and computing via the Vulkan cross-platform API
+xcomposite Enable support for the Xorg composite extension
capi Enable ISDN support using net-libs/libcapi
crossdev-mingw Use sys-devel/crossdev for the toolchain rather than dev-util/mingw64-toolchain (requires manual setting up)
cups Add support for CUPS (Common Unix Printing System)
custom-cflags Build with user-specified CFLAGS (unsupported)
dos Pull in games-emulation/dosbox to run DOS applications
ffmpeg Enable ffmpeg/libav-based audio/video codec support
gphoto2 Add digital camera support
kerberos Add kerberos support
llvm-libunwind Use sys-libs/llvm-libunwind instead of sys-libs/libunwind
netapi Enable support for configuring remote shares using net-fs/samba
nls Add Native Language Support (using gettext - GNU locale utilities)
odbc Add ODBC Support (Open DataBase Connectivity)
opencl Enable OpenCL support (computation on GPU)
osmesa Enable off-screen rendering (OpenGL in bitmaps) support
pcap Support packet capture software (e.g. wireshark)
perl Install helpers that require perl (winedump/winemaker)
pulseaudio Add sound server support via media-libs/libpulse (may be PulseAudio or PipeWire)
samba Pull in net-fs/samba with winbind for NTLM auth support
scanner Add support for scanner hardware (e.g. build the sane frontend in kdegraphics)
selinux !!internal use only!! Security Enhanced Linux support, this must be set by the selinux profile or breakage will occur
smartcard Enable smartcard support
udev Enable virtual/udev integration (device discovery, power and storage device support, etc)
udisks Enable storage management support (automounting, volume monitoring, etc)
usb Add USB support to applications that have optional USB support (e.g. cups)
v4l Enable support for video4linux (using linux-headers or userspace libv4l libraries)
wayland Enable dev-libs/wayland backend
wow64 Enable running 32bit applications without 32bit ELF multilib by mapping to 64bit calls (experimental, *may* have worse/unusable OpenGL performance or other issues compared to USE=abi_x86_32, also lacks 16bit support) -- still need dev-util/mingw64-toolchain with abi_x86_32 which itself does not need multilib
xinerama Add support for querying multi-monitor screen geometry through the Xinerama API

USE flags for app-emulation/wine-proton Valve Software's fork of Wine

+alsa Add support for media-libs/alsa-lib (Advanced Linux Sound Architecture)
+fontconfig Support for configuring and customizing font access via media-libs/fontconfig
+gecko Enable mshtml support using app-emulation/wine-gecko
+gstreamer Add support for media-libs/gstreamer (Streaming media)
+mono Enable .NET support using app-emulation/wine-mono
+sdl Enable gamepad support using media-libs/libsdl2
+ssl Add support for SSL/TLS connections (Secure Socket Layer / Transport Layer Security)
+strip Allow symbol stripping to be performed by the ebuild for special files
+unwind Add support for call stack unwinding and function name resolution
+vkd3d Enable DirectX 12 support using app-emulation/vkd3d
+xcomposite Enable support for the Xorg composite extension
crossdev-mingw Use sys-devel/crossdev for the toolchain rather than dev-util/mingw64-toolchain (requires manual setting up)
custom-cflags Build with user-specified CFLAGS (unsupported)
debug Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
llvm-libunwind Use sys-libs/llvm-libunwind instead of sys-libs/libunwind
nls Add Native Language Support (using gettext - GNU locale utilities)
openal Add support for the Open Audio Library
osmesa Enable off-screen rendering (OpenGL in bitmaps) support
perl Install helpers that require perl (winedump/winemaker)
pulseaudio Add sound server support via media-libs/libpulse (may be PulseAudio or PipeWire)
selinux !!internal use only!! Security Enhanced Linux support, this must be set by the selinux profile or breakage will occur
udev Enable virtual/udev integration (device discovery, power and storage device support, etc)
udisks Enable storage management support (automounting, volume monitoring, etc)
usb Add USB support to applications that have optional USB support (e.g. cups)
v4l Enable support for video4linux (using linux-headers or userspace libv4l libraries)
wow64 Enable running 32bit applications without 32bit ELF multilib by mapping to 64bit calls (experimental, *may* have worse/unusable OpenGL performance or other issues compared to USE=abi_x86_32, also lacks 16bit support) -- still need dev-util/mingw64-toolchain with abi_x86_32 which itself does not need multilib
xinerama Add support for querying multi-monitor screen geometry through the Xinerama API

32 ビット vs 64 ビット

多くの場合、Windows アプリケーションは 32 ビットサポートを必要とするでしょう。64 ビットアプリケーションの場合でも、32 ビットインストーラを使用していることがあるため、これに当てはまることがあります。

これは、Wine の多くの依存も 32 ビットサポートを必要とするだろうということを意味します。すべてのパッケージに対してグローバルに有効化されているのでなければ、emerge とともに autounmask オプションを使用すると、リストを構築するのに便利でしょう。

wow64 USE フラグを有効化して Wine をコンパイルすると、Wine とその依存を 32 ビットサポートを有効化してビルドすることなく 32 ビットアプリケーションを実行できるでしょう。ですがこれは (これを書いている時点で) 少々実験的な機能です。多くのアプリケーションでとてもよく動作しますが、不安定になるものもあります。

Wine の依存の一部は、機能するために、カーネルコンフィグで CONFIG_COMPAT_32BIT_TIME が設定されている必要があることに注意してください。これに失敗すると、ビルド時または実行時に “The futex facility returned an unexpected error code.” という種類のエラーメッセージを生成するでしょう。例えば、dev-libs/icu[1] および sys-devel/llvm がこの影響を受けます。

ビルド時環境変数

live (9999) ebuild は以下の環境変数を介して、リポジトリブランチ、コミット、コミット日時、およびリポジトリの設定に対応しています:

  • EGIT_OVERRIDE_BRANCH
  • EGIT_OVERRIDE_COMMIT
  • EGIT_OVERRIDE_COMMIT_DATE
  • EGIT_OVERRIDE_REPO

例として、WineHQ のタグ "wine-2.0-rc5" を選択して 2.0 RC 5 を emerge することができます:

root #EGIT_OVERRIDE_COMMIT_WINE_WINE="wine-2.0-rc5" emerge -a '=app-emulation/wine-vanilla-9999'

さらに、適切なタグ "v2.0-rc5" を見つけて、上の例を次のように拡張することで、Wine Staging を同じリリースに固定することもできます:

root #EGIT_OVERRIDE_COMMIT_WINE_WINE="wine-2.0-rc5" EGIT_OVERRIDE_COMMIT_WINE_WINE_STAGING="v2.0-rc5" emerge -a '=app-emulation/wine-staging-9999'

実行時に Wine に影響を与える他の変数については、で説明します。

Emerge

Enable the USE flags of your choosing on the virtual and then on the variant selected (automatically by the virtual or manually by yourself) and emerge the package:

root #emerge --ask virtual/wine

または

root #emerge --ask app-emulation/wine-${VARIANT}

Only versions classified as "stable" by upstream will be stabilized in Gentoo, and only as the app-emulation/wine-vanilla variant, as external patchsets are not considered stable. Some users may opt to add Wine variants to their package.accept_keywords file to allow for installation of development versions of Wine.

設定

実行時環境変数

wine を開始するシェルの環境変数は、Windows/DOS プロセスからアクセスすることができます。とても有用な Wine 固有の変数としては、WINEPREFIXWINEARCH、および WINEDEBUG が含まれますが、これに限定されません。

Wine の環境変数に関するより詳しい情報については、man wine および man wineserver マニュアルエントリを参照してください。

WINEPREFIX

重要
プリフィックスディレクトリ (デフォルトでは $HOME/.wine) は、何らかの方法で (例えば winecfg を実行することで) Wine が実行されたときに生成されます。これはまた、ルートユーザとして実行されると (WineHQ FAQ - Should I Run Wine as Root を参照してください)、Wine プリフィックスは (デフォルトでは) /root/.wine に生成されるということを意味します。

Wine プリフィックスを、デフォルトに影響を与えずに、(~/.wine 以外の) カスタムの場所に作成するには:

user $WINEPREFIX="$HOME/.wine-someprefix" wineboot

上は Wine プリフィックスを /home/<user>/.wine-someprefix に作成します。

メモ
Once a prefix has been created, the 'bitness' (arch) can not be changed. As such, the WINEARCH should be defined the when the prefix is created if the user wants to override the default. WINEARCH is meaningless beyond prefix instantiation.

WINEARCH

To create a 32-bit installation instead of the default (when built) 64-bit:

user $WINEARCH="win32" WINEPREFIX="$HOME/.wine-someprefix" wineboot

The Wine executable used could be anything that runs Wine, such as winecfg, which often makes sense while creating a clean, new prefix.

WINEARCH requires that Wine be built with the corresponding abi_x86 flags.

WINEDEBUG

Essential in finding out why an application is misbehaving when the basic terminal output or messages boxes are not enough. See https://wiki.winehq.org/Debug_Channels for examples.

設定ツール

The following tools include graphical and command line interfaces for managing Wine prefixes:

グラフィックスドライバ

Graphics registry value is comma seperated string and REG_SZ type.

Driver Description
x11 Use the X11 driver
wayland Use the Wayland driver
mac Use the native quartz driver (default on macOS)
null Use the null driver (a virtual screen will be created, but not displayed; available since Wine 5.2)

Default (on linux)

user $wine cmd /c "reg add HKEY_CURRENT_USER\\Software\\Wine\\Drivers /v Graphics /t REG_SZ /d x11 /f"

For enabling only experimental wayland driver:

user $wine cmd /c "reg add HKEY_CURRENT_USER\\Software\\Wine\\Drivers /v Graphics /t REG_SZ /d wayland /f"

Easy Anti Cheat サポート

Due to DT_HASH not being enabled by default since glibc 2.36 then the follow needs to be applied to allow EAC games to work

ファイル /etc/portage/package.use/glibc
sys-libs/glibc hash-sysv-compat
root #emerge --ask --oneshot sys-libs/glibc

上流 FAQ

Some upstream FAQ entries that users might find useful:

トラブルシューティング

When a user encounters a problem with an application, they should try the latest development version to see if the unwanted behavior still exists. If Wine has been built with options such as -fomit-frame-pointer or --hash-style=both, the Wine developers will likely be unable to help with the issue, and reports including output from such builds should not be reported to the Wine Bugzilla.

The strip USE flag should be disabled for debugging MinGW builds.

For more directions on reporting bugs, see Bugzilla and Bugs at wiki.winehq.

サポート

Users may find additional support in the #gentoo-wine (webchat) channel on Libera.Chat.

関連項目

  • DOSEMU — an application compatibility layer for MS-DOS geared more towards running MS-DOS applications than running games.
  • Game emulators — Gentoo によってパッケージ化されているゲームエミュレータのリスト-
  • Lutris — an open source gaming platform for Linux.
  • Steam — Valve によるビデオゲームのデジタル配布サービスです。
  • Winetricks — an easy way to work around problems in Wine.

外部資料

参照