From cc50131728fc20016e9cdb8383c8faf723448f51 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Thu, 4 Jun 2009 19:21:19 +0100 Subject: [PATCH] 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. --- .gitignore | 6 +- Formula/ack.rb | 10 --- Formula/asciidoc.rb | 12 ---- Formula/boost.rb | 16 ----- Formula/cmake.rb | 13 ---- Formula/dmd.rb | 42 ----------- Formula/fftw.rb | 21 ------ Formula/git.rb | 20 ------ Formula/grc.rb | 70 ------------------- Formula/lame.rb | 12 ---- Formula/liblastfm.rb | 19 ----- Formula/libogg.rb | 12 ---- Formula/libsamplerate.rb | 12 ---- Formula/mad.rb | 12 ---- Formula/pkg-config.rb | 14 ---- Formula/pngcrush.rb | 12 ---- Formula/qt.rb | 43 ------------ Formula/taglib.rb | 12 ---- Formula/term.rb | 10 --- Formula/wget.rb | 13 ---- Formula/xmlrpc-c.rb | 16 ----- Formula/yajl.rb | 21 ------ .../homebrew => Library/Homebrew}/brewkit.rb | 68 ++++++++++-------- Library/Homebrew/env.rb | 22 ++++++ .../homebrew => Library/Homebrew}/unittest.rb | 7 +- {Cellar/homebrew => bin}/brew | 30 ++++---- 26 files changed, 75 insertions(+), 470 deletions(-) delete mode 100644 Formula/ack.rb delete mode 100644 Formula/asciidoc.rb delete mode 100644 Formula/boost.rb delete mode 100644 Formula/cmake.rb delete mode 100644 Formula/dmd.rb delete mode 100644 Formula/fftw.rb delete mode 100644 Formula/git.rb delete mode 100644 Formula/grc.rb delete mode 100644 Formula/lame.rb delete mode 100644 Formula/liblastfm.rb delete mode 100644 Formula/libogg.rb delete mode 100644 Formula/libsamplerate.rb delete mode 100644 Formula/mad.rb delete mode 100644 Formula/pkg-config.rb delete mode 100644 Formula/pngcrush.rb delete mode 100644 Formula/qt.rb delete mode 100644 Formula/taglib.rb delete mode 100644 Formula/term.rb delete mode 100644 Formula/wget.rb delete mode 100644 Formula/xmlrpc-c.rb delete mode 100644 Formula/yajl.rb rename {Cellar/homebrew => Library/Homebrew}/brewkit.rb (84%) create mode 100644 Library/Homebrew/env.rb rename {Cellar/homebrew => Library/Homebrew}/unittest.rb (92%) rename {Cellar/homebrew => bin}/brew (90%) 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<