在 Mac OS Catalina 上安装 Wine。错误:没有名称为 "wine" 的可用公式



我正试图通过Brew在Mac上安装Wine。我正在使用Catalina,刚刚更新了brew,安装了XQuartz并安装了Xcode。当我键入命令"Brew install wine"时,它会返回以下内容:

Error: No available formula with the name "wine" 
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow
wine was deleted from homebrew/core in commit 82bd38bc:
wine: delete
To show the formula before removal run:
git -C "$(brew --repo homebrew/core)" show 82bd38bc^:Formula/wine.rb
If you still use this formula consider creating your own tap:
https://docs.brew.sh/How-to-Create-and-Maintain-a-Tap

我正在学习本教程:https://www.davidbaumgold.com/tutorials/wine-mac/

当我运行Brew医生时,我会得到以下信息:

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7-config
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7m-config
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3-config
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libtcl8.6.dylib
/usr/local/lib/libtk8.6.dylib
Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected header files:
/usr/local/include/fakemysql.h
/usr/local/include/fakepq.h
/usr/local/include/fakesql.h
/usr/local/include/itcl.h
/usr/local/include/itcl2TclOO.h
/usr/local/include/itclDecls.h
/usr/local/include/itclInt.h
/usr/local/include/itclIntDecls.h
/usr/local/include/itclMigrate2TclCore.h
/usr/local/include/itclTclIntStubsFcn.h
/usr/local/include/mysqlStubs.h
/usr/local/include/odbcStubs.h
/usr/local/include/pqStubs.h
/usr/local/include/tcl.h
/usr/local/include/tclDecls.h
/usr/local/include/tclOO.h
/usr/local/include/tclOODecls.h
/usr/local/include/tclPlatDecls.h
/usr/local/include/tclThread.h
/usr/local/include/tclTomMath.h
/usr/local/include/tclTomMathDecls.h
/usr/local/include/tdbc.h
/usr/local/include/tdbcDecls.h
/usr/local/include/tdbcInt.h
/usr/local/include/tk.h
/usr/local/include/tkDecls.h
/usr/local/include/tkPlatDecls.h
Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected .pc files:
/usr/local/lib/pkgconfig/tcl.pc
/usr/local/lib/pkgconfig/tk.pc
Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected static libraries:
/usr/local/lib/libtclstub8.6.a
/usr/local/lib/libtkstub8.6.a

我不确定这些警告是否与此有关。

提前感谢!

我能够在macOS Catalina上从源代码构建Wine 64位,并在其上成功运行Notepad++64位。

我的步伐或多或少是这样的:

  1. 下载Wine 4.20https://dl.winehq.org/wine/source/4.x/wine-4.20.tar.xz
  2. 提取它
  3. 在终端中转到提取的目录
  4. 运行:/configure--enable-win64
  5. 它显示它找不到一些库(我不记得具体是什么),所以我用macports安装了它(sudo端口安装名称_of_missing_package由./configure报告)
  6. 在我能够跑步之后/configure--enable-win64在终端运行中成功无错误:make
  7. 它在30多分钟后编译完成
  8. 我用:来运行它/葡萄酒开始
  9. 它打开了windows控制台,在这里我可以cd到Notepad++64位目录(从https://notepad-plus-plus.org/repository/7.x/7.0/npp.7.bin.x64.zip注意,最新版本不起作用,并抛出了一些关于dll的错误)
  10. 我键入notepad++来运行exe文件
  11. 它显示了一些关于freetype字体的错误,所以我用macports安装了它们,在wine检测到它们之前,我必须将它们从/opt/X11/lib复制到/usr/local/lib
  12. 在修复了freetype字体问题后,我可以运行记事本了++
  13. 此外,如果您看到一些关于从未知开发人员加载应用程序的系统警报,您可能需要运行:sudo-spctl--master-disable来禁用gatekeeper
  14. 另请注意,而不是/葡萄酒开始你可以跑/用于图形文件管理器而非控制台的wine浏览器

这些步骤可能并不精确,因为我不确定我是否错过了什么,但希望它能帮助到别人。

还要注意的是,很明显,macOS Catalina上的wine只能运行一些64位windows应用程序,而所有32位windows应用都无法运行。我还用IrfanView 64位进行了测试(https://www.fosshub.com/IrfanView.html?dwl=iview453_x64_setup.exe)而且效果也很好。

如果你想让葡萄酒运行32位游戏,那么不幸的是,它不适用于葡萄酒,但你可以尝试使用virtualbox。你可以查看https://www.youtube.com/watch?v=3AO8dF0vviQ了解一些性能改进技巧。

由于与Macos Catalina 不兼容,Wine已从自制程序中删除

https://discourse.brew.sh/t/issue-with-wine/6188/3

如何在带有brew的Mac OS Catalina上安装葡萄酒

  • 使用安装自制程序
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  • 安装xquartz以使用brew安装葡萄酒
brew cask install xquartz
  • 使用brew安装葡萄酒
brew install homebrew/cask-versions/wine-devel
  • 运行wine并检查版本
wine64 --version

安装wine后,请尝试使用wine64运行.exe文件。手册和参考资料似乎没有明确提到这一点。

更多信息

我遵循了葡萄酒手册中的指导,使用自制葡萄酒进行安装。安装后,我在尝试测试安装时遇到了一个错误,就像快速启动中所说的那样。

使用自制软件安装葡萄酒稳定

brew tap homebrew/cask-versions
brew install --cask --no-quarantine wine-stable

安装后,打开记事本进行测试

wine notepad
zsh: bad CPU type in executable: wine

在卸载wine时,我注意到其中一个链接库名为wine64。我立即重新安装并再次尝试使用wine64作为调用,就像我在M1 Mac上使用葡萄酒一样。这是成功的!

您还可以使用winehelp来访问更多与64位处理器配合使用的命令。

基于https://github.com/Homebrew/homebrew-core/pull/46556#issuecomment-559938873您可以在较新版本的OS X上执行brew cask install wine-stable。自从源版本被移动以来,它可以与最新版本的自制软件一起使用:(

Wine 5.0的官方版本在mac上没有32位支持,但您可以通过实现

非官方葡萄酒酿造厂

您可以在这里从github版本下载。然后用WS11WineCX[64/32]bit19.0.[0/1]创建一个Wineskin。所有WS11版本都支持Catalina。要使用它,还需要关闭no32exec引导参数。理论上你可以通过输入:

sudo nvram boot-args="no32exec=0"

登录时进入终端,但对我来说没有效果,所以如果你有同样的问题,请重新启动到恢复模式,在菜单栏中选择实用程序->终端,然后键入:

nvram boot-args="no32exec=0"

(没有sudo)。

示例

更确切地说,要安装例如Steam 32bit,你会:

  1. 从提供的链接安装Unofficial Wineskin酒厂

  2. 进入恢复模式并在终端中输入nvram boot-args="no32exec=0",打开32位执行引导参数

  3. 打开Wineskin,单击"+"号并向下滚动以找到WS11WineCX64bit19.0.1(在撰写本文时支持64和32位的最新版本)

  4. 单击包装版本下的更新/安装。

  5. 单击Create New Blank Wrapper,命名它,然后单击mono和gecko的安装。

  6. 从Finder启动包装应用程序。单击"安装软件",选择"安装可执行文件",然后继续安装。然后从菜单中选择可执行文件。(如果是蒸汽,steam.exe)

注意:如果出现"No windows app to open the file"(像我一样)错误,请单击高级->配置并将windows EXE设置为安装程序的路径。然后找到它安装的位置,并将其设置为Windows EXE。然后,您可以通过单击"测试运行"来运行。

  1. 享受你的windows应用程序,作为.app文件

希望我能帮上忙

最新更新