aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Howell2009-08-11 14:46:04 +0100
committerMax Howell2009-08-11 14:52:45 +0100
commitecf64c3679f7442bcf52dad7d2e7800b8e03c715 (patch)
treeb3d67ca91d3e7bc8545bb47ec4f713697ab87922
parentba8ac7d02ddb6e7782e8645bae64d36a1143e979 (diff)
downloadhomebrew-ecf64c3679f7442bcf52dad7d2e7800b8e03c715.tar.bz2
Remove MacPorts and Fink from the build environment
Closes #13
-rw-r--r--Library/Formula/apr.rb28
-rw-r--r--Library/Homebrew/brewkit.rb8
2 files changed, 36 insertions, 0 deletions
diff --git a/Library/Formula/apr.rb b/Library/Formula/apr.rb
new file mode 100644
index 000000000..a7fdf5817
--- /dev/null
+++ b/Library/Formula/apr.rb
@@ -0,0 +1,28 @@
+require 'brewkit'
+
+class AprUtil <Formula
+ @url='http://www.mirrorservice.org/sites/ftp.apache.org/apr/apr-util-1.3.9.tar.bz2'
+ @md5='29dd557f7bd891fc2bfdffcfa081db59'
+end
+
+class Apr <Formula
+ @url='http://www.mirrorservice.org/sites/ftp.apache.org/apr/apr-1.3.8.tar.bz2'
+ @homepage='http://apr.apache.org'
+ @md5='3c7e3a39ae3d3573f49cb74e2dbf87a2'
+
+ def install
+ ENV.j1
+ system "./configure --prefix=#{prefix} --disable-debug --disable-dependency-tracking"
+ system "make install"
+
+ AprUtil.new.brew do
+ system "./configure", "--prefix=#{prefix}",
+ "--disable-debug",
+ "--disable-dependency-tracking",
+ "--with-apr=#{bin}/apr-1-config"
+ system "make install"
+ end
+
+ (prefix+'build-1').rmtree # wtf?
+ end
+end
diff --git a/Library/Homebrew/brewkit.rb b/Library/Homebrew/brewkit.rb
index 92cd3b65b..c8702c4b1 100644
--- a/Library/Homebrew/brewkit.rb
+++ b/Library/Homebrew/brewkit.rb
@@ -113,6 +113,14 @@ end
ENV.extend HomebrewEnvExtension
+# remove MacPorts and Fink from the PATH, this prevents issues like:
+# http://github.com/mxcl/homebrew/issues/#issue/13
+paths=ENV['PATH'].split(':').reject do |p|
+ p.squeeze! '/'
+ p=~%r[^/opt/local] or p=~%r[^/sw]
+end
+ENV['PATH']=paths*':'
+
def inreplace(path, before, after)
before=Regexp.escape before.to_s