2011-01-26 64 views
18

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

回答

18

自制软件只保留二进制文件。如果您的Homebrew缓存目录(通常位于/Library/Caches/Homebrew,但可以使用brew --cache找到)已被移动或删除,那么您必须再次获取源代码。你可以用brew fetch qt来获取源代码。

+4

说不上来,如果这是一件自制改变半最近,但我在`/ Library/Caches ...`中找到我下载的软件包,而不是`〜/ Library/Caches ...`,以防万一! – taber 2014-02-26 03:29:02

4

如果只获取源包,则可能缺少公式中包含的修补程序,而不是您正在运行的二进制文件的源。要获得应用补丁的源代码树,你可以这样做:

brew unpack --patch <formula> 

从手册页:

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. 
+1

如何根据我的喜好修改它,从本地源代码构建和安装软件包? – juanes 2017-06-14 21:02:14