修改家庭酿造包的源代码

mar*_*ter 19 homebrew

我安装了自制软件包(qt).我想修改源代码并重建包.但我似乎无法找到源代码.brew --cache返回一个不存在的目录,qt的代码不在/ usr/local/Cellar中.我错过了什么吗?在构建应用程序后,自制软件是否删除了源代码?

mip*_*adi 18

Homebrew只保留二进制文件.如果您的Homebrew缓存目录(通常在/Library/Caches/Homebrew,但可以使用brew --cache,如您所述)可以移动或删除,那么您将不得不再次获取源代码.你可以用它来获取源代码brew fetch qt.

  • dunno如果这是家庭主妇最近改变的东西,但我发现我的下载包在`/ Library/Caches ...`而不是`〜/ Library/Caches ...`以防万一它可以帮助任何人! (4认同)

hsh*_*hib 5

如果仅获取源程序包,则可能缺少公式中包含的补丁程序,而可能不是您当前正在运行的二进制文件的源程序。要获取应用了补丁的源代码树,可以执行以下操作:

brew unpack --patch <formula>
Run Code Online (Sandbox Code Playgroud)

从手册页:

   unpack [--git|--patch] [--destdir=path] formulae
          Unpack the source files for formulae into subdirectories of  the
          current  working directory. If --destdir=path is given, the sub-
          directories will be created in the  directory  named  by  <path>
          instead.

          If  --patch  is  passed, patches for formulae will be applied to
          the unpacked source.

          If --git is passed, a Git repository will be initalized  in  the
          unpacked  source.  This  is  useful for creating patches for the
          software.
Run Code Online (Sandbox Code Playgroud)

  • 在根据自己的喜好对其进行修改之后,如何从本地源代码构建和安装该软件包? (2认同)