Skip to content
This repository
Browse code

Created /Library moved brew tool to /bin

Moved Forumla and Cellar/homebrew into Library.

This way the homebrew core files are more sensibly placed, Cellar is
more internally consistent and only generated. And Homebrew is ready for
use straight out of the tarball.
  • Loading branch information...
commit e91aeafc82edb2b79af67e342009cd019cd1ede5 1 parent 84ad47b
Max Howell authored June 04, 2009
6  .gitignore
... ...
@@ -1,6 +1,4 @@
1 1
 .DS_Store
2 2
 /*/
3  
-!/Cellar/
4  
-!/Formula/
5  
-/Cellar/*/
6  
-!/Cellar/homebrew/
  3
+!/Library/
  4
+!/bin/brew
0  Formula/ack.rb → Library/Formula/ack.rb
File renamed without changes
0  Formula/asciidoc.rb → Library/Formula/asciidoc.rb
File renamed without changes
0  Formula/boost.rb → Library/Formula/boost.rb
File renamed without changes
0  Formula/cmake.rb → Library/Formula/cmake.rb
File renamed without changes
0  Formula/dmd.rb → Library/Formula/dmd.rb
File renamed without changes
0  Formula/fftw.rb → Library/Formula/fftw.rb
File renamed without changes
6  Formula/git.rb → Library/Formula/git.rb
@@ -11,10 +11,10 @@ class Git <Formula
11 11
   @homepage='http://git-scm.com'
12 12
 
13 13
   def install
14  
-    system "./configure --prefix='#{prefix}' --disable-debug"
15  
-    system "make install"
16  
-
17 14
     # the manuals come separately, well sort of, it's easier this way though
18 15
     GitManuals.new.brew { FileUtils.mv Dir['*'], man }
  16
+
  17
+    system "./configure --prefix='#{prefix}' --disable-debug"
  18
+    system "make install"
19 19
   end
20 20
 end
2  Formula/grc.rb → Library/Formula/grc.rb
@@ -63,7 +63,7 @@ def caveats
63 63
     grc won't work as is. One option is to add some aliases to your ~/.profile 
64 64
     file. Homebrew can do that for you, just execute this command:
65 65
 
66  
-        ruby #{$0} --profile >> ~/.profile
  66
+        brew grc --profile >> ~/.profile
67 67
 
68 68
     EOS
69 69
   end
0  Formula/lame.rb → Library/Formula/lame.rb
File renamed without changes
4  Formula/liblastfm.rb → Library/Formula/liblastfm.rb
@@ -2,8 +2,8 @@
2 2
 
3 3
 class Liblastfm <Formula
4 4
   @homepage='http://github.com/mxcl/liblastfm/'
5  
-  @url='http://github.com/mxcl/liblastfm/tarball/0.3.0'
6  
-  @md5='08e90275ccd06476426a5002d1dad762'
  5
+  @url='http://static.last.fm/src/liblastfm-0.3.0.tar.bz2'
  6
+  @md5='3f73222ebc31635941832b01e7a494b6'
7 7
 
8 8
   def deps
9 9
     dep_test_bin 'qmake' or 'qt'
0  Formula/libogg.rb → Library/Formula/libogg.rb
File renamed without changes
0  Formula/libsamplerate.rb → Library/Formula/libsamplerate.rb
File renamed without changes
0  Formula/mad.rb → Library/Formula/mad.rb
File renamed without changes
0  Formula/pkg-config.rb → Library/Formula/pkg-config.rb
File renamed without changes
0  Formula/pngcrush.rb → Library/Formula/pngcrush.rb
File renamed without changes
0  Formula/qt.rb → Library/Formula/qt.rb
File renamed without changes
0  Formula/taglib.rb → Library/Formula/taglib.rb
File renamed without changes
0  Formula/term.rb → Library/Formula/term.rb
File renamed without changes
0  Formula/wget.rb → Library/Formula/wget.rb
File renamed without changes
0  Formula/xmlrpc-c.rb → Library/Formula/xmlrpc-c.rb
File renamed without changes
0  Formula/yajl.rb → Library/Formula/yajl.rb
File renamed without changes
68  Cellar/homebrew/brewkit.rb → Library/Homebrew/brewkit.rb
... ...
@@ -1,7 +1,23 @@
1  
-# Copyright 2009 Max Howell <max@methylblue.com>
2  
-# Licensed as per the GPL version 3
  1
+#  Copyright 2009 Max Howell <max@methylblue.com>
  2
+#
  3
+#  This file is part of Homebrew.
  4
+#
  5
+#  Homebrew is free software: you can redistribute it and/or modify
  6
+#  it under the terms of the GNU General Public License as published by
  7
+#  the Free Software Foundation, either version 3 of the License, or
  8
+#  (at your option) any later version.
  9
+#
  10
+#  Homebrew is distributed in the hope that it will be useful,
  11
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13
+#  GNU General Public License for more details.
  14
+#
  15
+#  You should have received a copy of the GNU General Public License
  16
+#  along with Homebrew.  If not, see <http://www.gnu.org/licenses/>.
  17
+
3 18
 require 'pathname'
4 19
 require 'osx/cocoa' # to get number of cores
  20
+require "#{File.dirname __FILE__}/env"
5 21
 
6 22
 HOMEBREW_VERSION='0.1'
7 23
 
@@ -181,36 +197,28 @@ def brew
181 197
         FileUtils.rm_rf tmp if tmp
182 198
         FileUtils.rm tgz if tgz and not self.cache?
183 199
       end
184  
-
185  
-      ohai 'Finishing up'
186  
-
187  
-      begin
188  
-        prefix
189  
-      rescue RuntimeError
190  
-        # you can have packages that aren't for installing, see git
191  
-        # this is a HACK though, and dirty, and not right
192  
-        return
193  
-      end
194  
-
195  
-      prefix.find do |path|
196  
-        if path==prefix #rubysucks
197  
-          next
198  
-        elsif path.file?
199  
-          if path.extname == '.la'
200  
-            path.unlink
201  
-          else
202  
-            fo=`file -h #{path}`
203  
-            args=nil 
204  
-            args='-SxX' if fo =~ /Mach-O dynamically linked shared library/
205  
-            args='' if fo =~ /Mach-O executable/ #defaults strip everything
206  
-            if args
207  
-              puts "Stripping: #{path}" if ARGV.include? '--verbose'
208  
-              `strip #{args} #{path}`
209  
-            end
  200
+    end
  201
+  end
  202
+  
  203
+  def clean
  204
+    prefix.find do |path|
  205
+      if path==prefix #rubysucks
  206
+        next
  207
+      elsif path.file?
  208
+        if path.extname == '.la'
  209
+          path.unlink
  210
+        else
  211
+          fo=`file -h #{path}`
  212
+          args=nil 
  213
+          args='-SxX' if fo =~ /Mach-O dynamically linked shared library/
  214
+          args='' if fo =~ /Mach-O executable/ #defaults strip everything
  215
+          if args
  216
+            puts "Stripping: #{path}" if ARGV.include? '--verbose'
  217
+            `strip #{args} #{path}`
210 218
           end
211  
-        elsif path.directory? and path!=prefix+'bin' and path!=prefix+'lib'
212  
-          Find.prune
213 219
         end
  220
+      elsif path.directory? and path!=prefix+'bin' and path!=prefix+'lib'
  221
+        Find.prune
214 222
       end
215 223
     end
216 224
   end
22  Library/Homebrew/env.rb
... ...
@@ -0,0 +1,22 @@
  1
+#  Copyright 2009 Max Howell <max@methylblue.com>
  2
+#
  3
+#  This file is part of Homebrew.
  4
+#
  5
+#  Homebrew is free software: you can redistribute it and/or modify
  6
+#  it under the terms of the GNU General Public License as published by
  7
+#  the Free Software Foundation, either version 3 of the License, or
  8
+#  (at your option) any later version.
  9
+#
  10
+#  Homebrew is distributed in the hope that it will be useful,
  11
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13
+#  GNU General Public License for more details.
  14
+#
  15
+#  You should have received a copy of the GNU General Public License
  16
+#  along with Homebrew.  If not, see <http://www.gnu.org/licenses/>.
  17
+
  18
+require 'pathname'
  19
+
  20
+$root=Pathname.new(__FILE__).dirname.parent.parent.realpath
  21
+$formula=$root+'Library'+'Formula'
  22
+$cellar=$root+'Cellar'
7  Cellar/homebrew/unittest.rb → Library/Homebrew/unittest.rb
... ...
@@ -1,11 +1,6 @@
1 1
 #!/usr/bin/ruby
2  
-$:.unshift File.dirname(__FILE__)
3  
-require 'pathname'
4  
-$root=Pathname.new(__FILE__).realpath.dirname.parent.parent
5  
-$cellar=$root+'Cellar'
6  
-require 'brewkit'
7 2
 require 'test/unit'
8  
-
  3
+require "#{__FILE__}/../brewkit"
9 4
 
10 5
 class TestFormula <Formula
11 6
   def initialize url, md5
30  Cellar/homebrew/brew → bin/brew
... ...
@@ -1,12 +1,9 @@
1 1
 #!/usr/bin/ruby
2  
-# Copyright 2009 Max Howell <max@methylblue.com>
3  
-# Licensed as per the GPL version 3
  2
+
4 3
 require 'find'
5 4
 require 'pathname'
6  
-$:.unshift "#{File.dirname __FILE__}/../Cellar/homebrew"
7  
-$root=Pathname.new(__FILE__).realpath.dirname.parent.parent
8  
-$formula=$root+'Formula'
9  
-$cellar=$root+'Cellar'
  5
+$:.unshift Pathname.new(__FILE__).dirname.parent.realpath+'Library'+'Homebrew'
  6
+require 'env'
10 7
 
11 8
 def prune
12 9
   n=0
@@ -14,7 +11,7 @@ def prune
14 11
   $root.find do |path|
15 12
     if path.directory?
16 13
       name=path.relative_path_from($root).to_s
17  
-      if name == '.git' or name == 'Cellar' or name == 'Formula'
  14
+      if name == '.git' or name == 'Cellar' or name == 'Library/Homebrew' or name == 'Library/Formula'
18 15
         Find.prune
19 16
       else
20 17
         dirs<<path
@@ -90,10 +87,10 @@ def ln name
90 87
     raise '#{keg} is not a keg'
91 88
   end
92 89
 
93  
-  #TODO consider using hardlinks
94  
-
95  
-  # yeah indeed, you have to force anything you want in the main tree into
96  
-  # these directories :P
  90
+  # yeah indeed, you have to force anything you need in the main tree into
  91
+  # these directories :P 
  92
+  # NOTE that not everything needs to be in the main tree
  93
+  # TODO consider using hardlinks
97 94
   $n=0
98 95
   lnd(keg, 'etc') {nil}
99 96
   lnd(keg, 'include') {nil}
@@ -113,13 +110,8 @@ def ln name
113 110
   end
114 111
 
115 112
   lnd(keg, 'share') do |path|
116  
-    path=path.to_s
117  
-    if ['man','doc','locale','info'].include? path
118  
-      :mkpath
119  
-    else
120  
-      mans=(1..9).collect {|x| "man/man#{x}"}
121  
-      :mkpath if mans.include? path
122  
-    end
  113
+    includes=(1..9).collect {|x| "man/man#{x}"} <<'man'<<'doc'<<'locale'<<'info'
  114
+    :mkpath if includes.include? path.to_s
123 115
   end
124 116
 
125 117
   return $n
@@ -219,6 +211,8 @@ begin
219 211
       o=__obj(name)
220 212
       raise "#{o.prefix} already exists!" if o.prefix.exist?
221 213
       o.brew { o.install }
  214
+      ohai 'Finishing up'
  215
+      o.clean
222 216
       ln name
223 217
       puts "#{o.prefix}: "+`find #{o.prefix} -type f | wc -l`.strip+
224 218
                            ' files, '+

0 notes on commit e91aeaf

Please sign in to comment.
Something went wrong with that request. Please try again.