Is it possible for homebrew to "brew" a forked version of a package?

424 Views Asked by At

There is a very useful software package (libdc1394) that I would like to use, however there are some modifications needed, and the owners of the sourceforge project may be on vacation for the summer. If I fork the project how do I get homebrew to serve my modified formula? I'm pretty new to open-source software.

Also, homebrew is currently serving binary bottles of the existing project. To create these binary bottles from the forked library, is homebrew capable of doing the building itself, or would I need to compile to produce the binaries for the various OSX 10.X systems? The reason I ask is that ./configure of the existing library gives all sorts of problems on my system (but it must work on somebody's system).


The location of the cellar is here, /usr/local/Cellar/libdc1394/2.2.2, and the binaries are in here: /usr/local/Cellar/libdc1394/2.2.2/lib;

Contents: libdc1394.22.dylib, libdc1394.dylib, libdc1394.a, pkgconfig


The location of the bottle I poured, in the cache, containing binaries:

/Library/Caches/Homebrew/libdc1394-2.2.2.mavericks.bottle.tar.gz

Here is the existing homebrew formula, a ruby script (/usr/local/Library/Formula/libdc1394.rb):

require "formula"

class Libdc1394 < Formula
  homepage "http://damien.douxchamps.net/ieee1394/libdc1394/"
  url "https://downloads.sourceforge.net/project/libdc1394/libdc1394-2/2.2.2/libdc1394-2.2.2.tar.gz"
  sha1 "13958c3cd0709565b5e4a9012dcf2a9b710264e2"

  bottle do
    cellar :any
    sha1 "063e3babff63f462de1b7d053690ae3f0e250bcb" => :mavericks
    sha1 "52d23eb6514dfc5c9aa554bade7dac92deefec70" => :mountain_lion
    sha1 "9f703002e33433885f3f2cb9e4a4006585282a01" => :lion
  end

  depends_on "sdl"

  # fix issue due to bug in OSX Firewire stack
  # libdc1394 author comments here:
  # http://permalink.gmane.org/gmane.comp.multimedia.libdc1394.devel/517
  patch :DATA

  def install
    system "./configure", "--disable-dependency-tracking",
                          "--prefix=#{prefix}",
                          "--disable-examples",
                          "--disable-sdltest"
    system "make install"
  end
end

__END__
diff --git a/dc1394/macosx/capture.c b/dc1394/macosx/capture.c
index c7c71f2..8959535 100644
--- a/dc1394/macosx/capture.c
+++ b/dc1394/macosx/capture.c
@@ -150,7 +150,7 @@ callback (buffer_info * buffer, NuDCLRef dcl)

     for (i = 0; i < buffer->num_dcls; i++) {
         int packet_size = capture->frames[buffer->i].packet_size;
-        if ((buffer->pkts[i].status & 0x1F) != 0x11) {
+        if (buffer->pkts[i].status && (buffer->pkts[i].status & 0x1F) != 0x11) {
             dc1394_log_warning ("packet %d had error status %x",
                     i, buffer->pkts[i].status);
             corrupt = 1;
1

There are 1 best solutions below

0
On BEST ANSWER

There is a guide to opening a pull request and getting it merged that might help you!

Patches should be submitted (but not necessarily accepted) upstream before you send a pull request to Homebrew. If your changes are not of general interest, you don't need Homebrew to accept your changes in order to take advantage of the Homebrew build system; you can write or modify your own formula and point Homebrew at the .rb file locally, like brew install ./my_formula.rb. You can also give brew install a URL to a .rb file.

Bottling is done by a buildbot at the behest of the Homebrew maintainers after they've accepted modifications to the formulas.