diff --git a/.gitignore b/.gitignore index 4787e8518a..72820f508b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,4 @@ .DS_Store /*/ -!/Cellar/ -!/Formula/ -/Cellar/*/ -!/Cellar/homebrew/ \ No newline at end of file +!/Library/ +!/bin/brew \ No newline at end of file diff --git a/Formula/ack.rb b/Formula/ack.rb deleted file mode 100644 index 4bab09c89e..0000000000 --- a/Formula/ack.rb +++ /dev/null @@ -1,10 +0,0 @@ -require 'brewkit' - -class Ack > Homebrew -GRC=`which grc` -if [ "$TERM" != dumb ] && [ -n GRC ] -then - alias colourify="$GRC -es --colour=auto" - alias configure='colourify ./configure' - alias diff='colourify diff' - alias make='colourify make' - alias gcc='colourify gcc' - alias g++='colourify g++' - alias as='colourify as' - alias gas='colourify gas' - alias ld='colourify ld' - alias netstat='colourify netstat' - alias ping='colourify ping' - alias traceroute='colourify /usr/sbin/traceroute' -fi -################################################################## << Homebrew - sput -end - -######################################################################### ARGV -case ARGV[0] - when '--profile' then - puts profile_string - exit 0 -end - -######################################################################### cook -class Grc > ~/.profile - - EOS - end -end \ No newline at end of file diff --git a/Formula/lame.rb b/Formula/lame.rb deleted file mode 100644 index 2c248285c5..0000000000 --- a/Formula/lame.rb +++ /dev/null @@ -1,12 +0,0 @@ -require 'brewkit' - -class Lame > src/#{makefile}` } - end - - configure=<<-EOS - ./configure -prefix '#{prefix}' - -system-sqlite -system-libpng -system-zlib - -nomake demos -nomake examples -no-qt3support - -release -cocoa -arch x86 - -confirm-license -opensource - -I /usr/X11R6/include -L /usr/X11R6/lib - -fast - EOS - - system configure.gsub("\n", ' ').strip.squeeze(' ') - system "make install" - - # fuck weird prl files - `find #{lib} -name \*.prl -delete` - # fuck crazy disk usage - `rm -r #{prefix+'doc'+'html'} #{prefix+'doc'+'src'}` - # wtf are these anyway? - `rm -r #{bin}/Assistant_adp.app #{bin}/pixeltool.app #{bin}/qhelpconverter.app` - # we specified no debug already! :P - `rm #{lib}/libQtUiTools_debug.a` - # meh - `rm #{prefix}/q3porting.xml` - end - - def caveats - "We agreed to the Qt opensource license for you.\nIf this is unacceptable you should uninstall :P" - end -end \ No newline at end of file diff --git a/Formula/taglib.rb b/Formula/taglib.rb deleted file mode 100644 index 2811decec2..0000000000 --- a/Formula/taglib.rb +++ /dev/null @@ -1,12 +0,0 @@ -require 'brewkit' - -class Taglib -# Licensed as per the GPL version 3 +# Copyright 2009 Max Howell +# +# This file is part of Homebrew. +# +# Homebrew is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Homebrew is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Homebrew. If not, see . + require 'pathname' require 'osx/cocoa' # to get number of cores +require "#{File.dirname __FILE__}/env" HOMEBREW_VERSION='0.1' @@ -181,36 +197,28 @@ public FileUtils.rm_rf tmp if tmp FileUtils.rm tgz if tgz and not self.cache? end - - ohai 'Finishing up' - - begin - prefix - rescue RuntimeError - # you can have packages that aren't for installing, see git - # this is a HACK though, and dirty, and not right - return - end - - prefix.find do |path| - if path==prefix #rubysucks - next - elsif path.file? - if path.extname == '.la' - path.unlink - else - fo=`file -h #{path}` - args=nil - args='-SxX' if fo =~ /Mach-O dynamically linked shared library/ - args='' if fo =~ /Mach-O executable/ #defaults strip everything - if args - puts "Stripping: #{path}" if ARGV.include? '--verbose' - `strip #{args} #{path}` - end + end + end + + def clean + prefix.find do |path| + if path==prefix #rubysucks + next + elsif path.file? + if path.extname == '.la' + path.unlink + else + fo=`file -h #{path}` + args=nil + args='-SxX' if fo =~ /Mach-O dynamically linked shared library/ + args='' if fo =~ /Mach-O executable/ #defaults strip everything + if args + puts "Stripping: #{path}" if ARGV.include? '--verbose' + `strip #{args} #{path}` end - elsif path.directory? and path!=prefix+'bin' and path!=prefix+'lib' - Find.prune end + elsif path.directory? and path!=prefix+'bin' and path!=prefix+'lib' + Find.prune end end end diff --git a/Library/Homebrew/env.rb b/Library/Homebrew/env.rb new file mode 100644 index 0000000000..e1beac1c17 --- /dev/null +++ b/Library/Homebrew/env.rb @@ -0,0 +1,22 @@ +# Copyright 2009 Max Howell +# +# This file is part of Homebrew. +# +# Homebrew is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Homebrew is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Homebrew. If not, see . + +require 'pathname' + +$root=Pathname.new(__FILE__).dirname.parent.parent.realpath +$formula=$root+'Library'+'Formula' +$cellar=$root+'Cellar' \ No newline at end of file diff --git a/Cellar/homebrew/unittest.rb b/Library/Homebrew/unittest.rb similarity index 92% rename from Cellar/homebrew/unittest.rb rename to Library/Homebrew/unittest.rb index 1982faefc1..5ec8f0e5de 100755 --- a/Cellar/homebrew/unittest.rb +++ b/Library/Homebrew/unittest.rb @@ -1,11 +1,6 @@ #!/usr/bin/ruby -$:.unshift File.dirname(__FILE__) -require 'pathname' -$root=Pathname.new(__FILE__).realpath.dirname.parent.parent -$cellar=$root+'Cellar' -require 'brewkit' require 'test/unit' - +require "#{__FILE__}/../brewkit" class TestFormula -# Licensed as per the GPL version 3 + require 'find' require 'pathname' -$:.unshift "#{File.dirname __FILE__}/../Cellar/homebrew" -$root=Pathname.new(__FILE__).realpath.dirname.parent.parent -$formula=$root+'Formula' -$cellar=$root+'Cellar' +$:.unshift Pathname.new(__FILE__).dirname.parent.realpath+'Library'+'Homebrew' +require 'env' def prune n=0 @@ -14,7 +11,7 @@ def prune $root.find do |path| if path.directory? name=path.relative_path_from($root).to_s - if name == '.git' or name == 'Cellar' or name == 'Formula' + if name == '.git' or name == 'Cellar' or name == 'Library/Homebrew' or name == 'Library/Formula' Find.prune else dirs<