46 Commits

Author SHA1 Message Date
Max Howell
6c2555b476 Allow --force for blacklisted formula names 2009-10-15 16:51:59 +01:00
Max Howell
1ead455b83 Blacklist brew create scons 2009-10-15 16:51:58 +01:00
Max Howell
ca1a6492bc s/require 'brewkit'/require 'formula'/g
brewkit.rb changes ENV destructively, so lets not do that everytime a formula
is required. Now it's possible for other tools to require a formula
description without worrying about side-effects.
2009-10-15 16:48:03 +01:00
Max Howell
e2bed20d21 Revert "Set homepage in created scripts to frontmost Safari URL"
This reverts commit a1ed2cb19706e317d34f1a9f2efe8a2d2388afae.

The is running part of the Applescript didn't seem to prevent Safari getting
loaded when it wasn't running when used via osascript. It worked in
ScriptEditor! Honest!

Also we decided that it probably wouldn't work often enough anyway.

Discussion: a1ed2cb197
2009-10-09 00:09:05 +01:00
Max Howell
346e42d4b9 Set homepage in created scripts to frontmost Safari URL
A bit of fun with Applescript, for those of us who use Safari.
2009-10-04 20:15:33 +01:00
Max Howell
64899bbbff Blacklist creation for some formula
We don't duplicate, so libxml and that are already provided by OS X. Mercurial is provided by easy_install.

I'm adding this to save people contributing stuff that we won;t accept. I hate disappointing people :(
2009-10-01 15:48:54 +01:00
Max Howell
c61d96529c brew list --unbrewed fix
Determine all directories that aren't Homebrew ones.

Exec find.

I prefer to keep short stuff in bin/brew so people reading the code have a better idea of what happens, and what sort of functions are useful for the sorts of things we do with Homebrew.
2009-09-30 18:11:49 +01:00
Max Howell
512a3da886 brew list lists root keg files if not README, etc. 2009-09-30 17:45:38 +01:00
Max Howell
396ec2efae Show trailing / for dirs with brew list 2009-09-30 01:24:31 +01:00
Kieran Pilkington
0e9edbb285 An additional reference for warn_about_macports_or_fink 2009-09-29 16:26:38 +01:00
Kieran Pilkington
aedaaf79bf brew list --unbrewed
Very quick way to find files not installed by homebrew.

Taken from a command by mxcl on the homebrew wiki.

.DS_Store files and bin/brew are ignored.
2009-09-29 16:26:37 +01:00
Max Howell
14818039ae If brew create can't figure out the name, prompt for it
This was adapted from adamv@d5e78ee26535dec4b11c33d14832a9ee945a29fd

I decided prompting would was the most usable solution here, as the stem is
unlikely to be useful so the user would have to rename the file and change
the class name as well as type the command once and then again with --force.

Dissent welcome.

Fixes Homebrew/homebrew#15
2009-09-29 15:46:34 +01:00
Max Howell
1004df181e fix_PATH changed to warn_about_macports_or_fink
We shouldn't mess with the user's PATH anyway. So assume our users are smart and just warn them about potential issues instead.
2009-09-28 00:20:51 +01:00
Max Howell
af6c890294 Quote path parameters where appropriate
Our build directories are space-less, but the final destination may have
spaces, especially since OS X often uses your full name as your home directory
path.
2009-09-28 00:20:50 +01:00
Max Howell
bab6515668 Summarised listings with brew list
I'm trying to only show the interesting stuff. You can see a full listing with
brew -v list, or by piping to other commands.

Tell me if you hate it or love it.
2009-09-24 22:38:42 +01:00
Max Howell
a6ba0c4800 Use new instance var syntax for brew create 2009-09-24 18:49:49 +01:00
Max Howell
44a1fa418e Use full paths to all system utilities
Otherwise you run the risk of not running the exact version / make of the utility you planned.

Fixes Homebrew/homebrew#48

Really we need to do this formula too, so I guess a make and cmake function are on the way…
2009-09-24 18:26:24 +01:00
Max Howell
034fc40ae1 Remove Fink and Macports from the PATH earlier
References issue Homebrew/homebrew#48
2009-09-24 18:26:24 +01:00
Max Howell
e60ea7bd20 Clean up the empty dir cleaner a little
Using more Pathname methods.

Only show text if verbose mode is on, as is typical for the rest of our install output.

TODO: would be nice if we knew you were a dev and automatically enabled verbose mode perhaps.
2009-09-22 11:38:22 +01:00
Adam Vandenberg
50b981a469 Replace perl one-liner for removing empty dirs with Ruby.
Allow Formula.skip_clean? to prevent empty folders from being removed
as part of the brewing cleanup process.
2009-09-21 16:12:01 -07:00
Max Howell
e9701dbc81 Merge branch 'deps'
Conflicts:
	Library/Formula/imagemagick.rb
	Library/Formula/taglib.rb
	Library/Homebrew/brew.h.rb
	Library/Homebrew/formula.rb
	bin/brew
2009-09-21 18:46:28 +01:00
Max Howell
77dd27e8e6 Dependency resolution with fancy syntax
Is it a DSL? No. But people call it that apparently.

To add a dependency:

class Doe <Formula
  depends_on 'ray'
  depends_on 'mee' => :optional
  depends_on 'far' => :recommended
  depends_on Sew.new
end

Sew would be a formula you have defined in this Formula file. This is useful,
eg. see Python's formula. Formula specified in this fashion cannot be linked
into the HOMEBREW_PREFIX, they are considered private libraries. This allows
you to create custom installations that are very specific to your formula.

More features to come, like specifying versions
2009-09-21 18:27:48 +01:00
Max Howell
3d421c8649 Update references to masterbrew
I left update_from_masterbrew! as a historical reference.
2009-09-18 14:32:21 +01:00
Max Howell
c28bd7b571 Allow formulae to use __END__
For this to work the "running script" must be the formulae file. Making this
so wasn't so hard, there is now an install.rb script which is included with
the -r flag to the ruby executable. An at_exit handler calls the install
function.

Having the install logic in its own file made it feel like there was so much
space that I added extra error handling. So there is something to be said for
separating functionality out into its own files.

Still the error handling sucks, we'll need to marshall the exception back to
the bin/brew command. Which is another PITA.

Still overall I think this will prove worthwhile. But if it doesn't we'll
revert.

As a first usage, you can put a diff after __END__ and return DATA from
Formula::patches to make Homebrew aware of it.
2009-09-16 14:49:06 +01:00
Max Howell
f0f59659dd Overriding Object.class was not my intention
Renamed to Formula::class_s.
2009-09-11 17:42:53 +01:00
Max Howell
a793e30405 Only allow --interactive with one formula argument
See comments in commit for details.
2009-09-10 19:23:03 +01:00
Max Howell
fdaa267fb9 Don't install dependencies that are already installed 2009-09-10 19:23:03 +01:00
Max Howell
0a31190fdc Dependency resolution
Specify dependencies in your formula's deps function. You can return an Array,
String or Hash, eg:

    def deps
      { :optional => 'libogg', :required => %w[flac sdl], :recommended => 'cmake' }
    end

Note currently the Hash is flattened and qualifications are ignored. If you
only return an Array or String, the qualification is assumed to be :required.

Other packaging systems have problems when it comes to packages requiring a
specific version of a package, or some patches that may not work well with
other software. With Homebrew we have some options:

1.  If the formula is vanilla but an older version we can cherry-pick the old
    version and install it in the Cellar in parallel, but just not symlink it
    into /usr/local while forcing the formula that depends on it to link to
    that one and not any other versions of it.
2.  If the dependency requires patches then we shouldn't install this for use
    by any other tools, (I guess this needs to be decided on a per-situation
    basis). It can be installed into the parent formula's prefix, and not
    symlinked into /usr/local. In this case the dependency's Formula
    derivation should be saved in the parent formula's file (check git or
    flac for an example of this).

Both the above can be done currently with hacks, so I'll flesh out a proper
way sometime this week.
2009-09-10 19:23:03 +01:00
Max Howell
18d9fbee98 Closes Homebrew/homebrew#27 (permissions to strict)
I went with 0555 as the permissions changing only occurs to bin, sbin and lib, so there shouldn't be any files in there for editing in general anyway.

Formulae can specify not to "clean" any particular file by reimplementing the skip_clean? function, in case some config file or what not ends up in there.

Also committing cosmetic fix to pretty_duration function.
2009-09-03 20:58:33 +01:00
Max Howell
4c09e3ef2b brew info FIX if git isn't installed 2009-09-02 15:44:10 +01:00
Max Howell
4f8c46d627 Only time the build, not the download too 2009-09-02 15:44:10 +01:00
Max Howell
2ff0294e18 Foolish lack of backslash causes brew mk b0rkage 2009-08-31 22:05:42 +01:00
Max Howell
1e22bb4ee1 Use github.user for github history link
Discussion: d60fc4ba86d45255b0093303c45f6b1c2196fda2
2009-08-31 21:20:09 +01:00
Max Howell
5dd3708768 Use newer configure syntax as make template 2009-08-31 18:29:43 +01:00
Max Howell
84d034f9fb docs is an alias for doc sometimes apparently
We don't install documentation to save space. It seems pointless in this
modern age where the online docs are probably more up to date. However I do
believe this should be an option, defaulting to "don't install".
2009-08-31 18:23:41 +01:00
Christian Mayer
2a72c2fa0e If forked, open Github history of forked repository 2009-08-31 18:09:48 +01:00
Max Howell
4d63b87e0a Change license to BSD
I confirmed this change with all relevant contributors first.
2009-08-31 16:09:17 +01:00
Max Howell
c53e10f4aa FIX brew diy --set-version --set-name 2009-08-24 01:04:53 +01:00
Adeel Ahmad Khan
1c55642645 Link binaries in sbin as well as bin.
Signed-off-by: Max Howell <max@methylblue.com>
2009-08-12 23:55:57 +08:00
Max Howell
140bfc5592 brew diy command
Automagically determines prefix to install to for DIY installations.

README amended.
2009-08-12 13:43:51 +01:00
Max Howell
6661f78618 Allow skip_clean? to skip entire directories
Speeds up Python formula plenty in clean phase
2009-08-10 18:12:16 +01:00
Max Howell
0ea078e1ae Install README.txt etc. as README 2009-08-10 18:11:23 +01:00
Max Howell
f724f5ed52 Ensure ENV is pristine for each installation
Because we modified the ENV global each install this propagated to consecutive
formulae. So exec a new brew process each install. This is the safest way
although Ruby exceptions don't propagate to the parent process so I worry
about it somewhat.
2009-08-10 18:11:23 +01:00
Max Howell
a6577e5117 When safe, correct common install issues
Eg. man can be moved into share without consequences
2009-08-10 18:11:23 +01:00
Max Howell
a84bf77515 Delete installed documentation after install
Documentation is all online nowadays, and is more current there.

Documentation often takes up more space than the rest of the package.

Package listings are now more relevent.

We'll make it optional as soon as one person complains.
2009-08-10 18:11:23 +01:00
Max Howell
760c083c0c Refactor
Large refactor to Formula, mostly improving reliability and error handling but
also layout and readability.

General improvements so testing can be more complete.

Patches are automatically downloaded and applied for Formula that return a
list of urls from Formula::patches.

Split out the brew command logic to facilitate testing.

Facility from Adam Vandenberg to allow selective cleaning of files, added
because Python doesn't work when stripped.
2009-08-10 18:11:17 +01:00