【问题标题】:Modifying the source code of a home brew package修改 home brew 包的源代码
【发布时间】:2011-01-26 01:13:45
【问题描述】:

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

【问题讨论】:

    标签: homebrew


    【解决方案1】:

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

    【讨论】:

    • 不知道这是不是最近自制的东西,但我在/Library/Caches...找到我下载的包,而不是~/Library/Caches...,以防万一它对任何人有帮助!
    【解决方案2】:

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

    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.
    

    【讨论】:

    猜你喜欢
    • 2021-07-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-16
    • 2017-01-25
    • 2013-07-20
    相关资源
    最近更新 更多