Upgrade to Pro — share decks privately, control downloads, hide ads and more …

homebrew

 homebrew

Introduction to writing a homebrew formula

Tommy Murphy

June 10, 2015
Tweet

More Decks by Tommy Murphy

Other Decks in Programming

Transcript

  1. why? • Learn a lot about build processes/tools • Help

    others, help maintainers • Easy win PR’s to large/high vis projects
  2. ~ $ brew search honggfuzz No formula found for "honggfuzz".

    Searching pull requests... does a brew exist?
  3. does it build? $ git clone [email protected]:google/honggfuzz.git (master) $ make

    ... /usr/include/servers/bootstrap.h:20:14: error: extra ';' outside of a function [- Werror,-Wextra-semi] __BEGIN_DECLS; ^ /usr/include/servers/bootstrap.h:112:12: error: extra ';' outside of a function [- Werror,-Wextra-semi] __END_DECLS; ^ 2 errors generated. make: *** [mac/arch.o] Error 1
  4. Start brewing! $ brew create https://github.com/google/honggfuzz/archive/master.tar.gz Warning: Version cannot be

    determined from URL. You'll need to add an explicit 'version' to the formula. Please `brew audit --strict honggfuzz` before submitting, thanks.
  5. (master) $ brew install honggfuzz --debug --verbose ... make: ***

    [mac/arch.o] Error 1 /usr/local/Library/Homebrew/debrew.rb:11:in `raise' BuildError: Failed executing: make 1. raise 2. ignore 3. backtrace 4. irb 5. shell Choose an action:
  6. Recap • Use homebrew • Starting a brew (brew create)

    • Debugging a brew (--debug) • Resolving problems (google + brew docs)
  7. Checking dependencies brew search dependencies in the README otool -L

    honggfuzz /System/Library/PrivateFrameworks/CoreSymbolication.framework/... /System/Library/Frameworks/IOKit.framework/... /System/Library/Frameworks/Foundation.framework/... /System/Library/Frameworks/ApplicationServices.framework/... /System/Library/PrivateFrameworks/Symbolication.framework/... /System/Library/Frameworks/CoreServices.framework/... /System/Library/PrivateFrameworks/CrashReporterSupport.framework/... /System/Library/Frameworks/CoreFoundation.framework/... /System/Library/PrivateFrameworks/CommerceKit.framework/... /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0) /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)