Skip to content
This repository has been archived by the owner on Sep 1, 2021. It is now read-only.
Sharpie edited this page Sep 13, 2010 · 10 revisions

A list of things that would be neat to have in homebrew (feel free to fork and add one yourself).

This isn’t an official list, so don’t expect work you do to always be pulled in.

  • Installation tests
    • A method in each formula, `def test_install` or similar, would be invoked after the formula is installed to test things went well. For example, imagemagick might have the following:
      def test_install
        formats = `identify -list formats`
        %w{ jpeg png tiff }.each do |format|
          assert formats.include?(format)
        end
      end
    • If an assertion fails, homebrew would prompt about a possible corrupted installation, otherwise, it wouldn’t prompt anything. This system would go a long way to maintaining multi OS support when the time comes.
  • Installation hooks
    • Sometimes it might be necessary to hook into various parts of the installation process. Various hooks would be good to have to allow as much flexibility as possible.
      • before_dependency_resolution
      • after_dependency_resolution
      • before_install
      • after_install
      • before_symlink
      • after_symlink
      • before_uninstall
      • before_unsymlink
      • after_unsymlink
      • after_uninstall
    • I pretty much disagree with all of these —mxcl
    • Some hooks like before_install would be nice as they would let one do things such as set up the environment, then do debugging and testing with brew install i without worrying about duplicating the homebrew environment settings. - Sharpie
  • Multiple OS integration
    • Split out code that is tied to Mac into a os/mac.rb file or similar (various things like determining cores, memory, arch types etc will be different)
    • Add support for other Operating systems, example os/ubuntu.rb
      • May be worth adding a super class for linux (os/linux.rb) which most operating system files can inherit from
    • A file called os.rb in the homebrew source root would determine which OS is being used, and include the file needed
  • Aliases
    • Formula like jpeg can also be called libjpeg or jpegsrc. Add an `aliased_as` method similar to the url/homepage/version/md5 etc methods to the formula class, which allows formula to be installed via other named.
      • If an alias is the same in two different formula, homebrew should prompt you to use the proper name of the formula, listing which formula used this alias. If only one formula uses this alias, homebrew should assume thats what you want.
  • Multiple version support
    • Add support for multiple versions of formula installed.
    • When you install for the first time, it installs as per normal.
    • If you try to install it again, it says ‘already installed’ if the version is the same
    • If the version is different (i.e. after an update of homebrew), it should unlink the old version, and install/link the new version
    • A new `brew switch [formula]` command be added. It’ll list the available versions for the formula, and ask for numeric input (which correspond to versions). The command will unlink the currently linked version, and link the selected version.
      • Homebrew doesn’t know which formula is currently linked when multiple ones exist. Code needs to be added to make it aware. Maybe symlink a ‘current’ dir to the current links formula folder.
    • Similar function of the `brew switch` command be applied to the `brew uninstall` command (prompt which one be uninstall if multiple versions exist). If uninstalling the currently linked one, it’ll link to the latest version.
Clone this wiki locally