2010-08-04 00:00:42 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Mldonkey < Formula
|
2010-08-04 00:00:42 +00:00
|
|
|
homepage 'http://mldonkey.sourceforge.net/Main_Page'
|
2012-06-14 02:54:33 +00:00
|
|
|
url 'http://downloads.sourceforge.net/project/mldonkey/mldonkey/3.1.2/mldonkey-3.1.2.tar.bz2'
|
|
|
|
sha1 'be8c261e2fbd365dd3866af15a854b074fbc59c1'
|
2010-08-04 00:00:42 +00:00
|
|
|
|
|
|
|
depends_on 'objective-caml'
|
2012-01-30 00:21:08 +00:00
|
|
|
|
2011-02-14 22:36:56 +00:00
|
|
|
if ARGV.include? "--with-x"
|
|
|
|
depends_on 'librsvg'
|
|
|
|
depends_on 'lablgtk'
|
|
|
|
end
|
|
|
|
|
|
|
|
def options
|
|
|
|
[["--with-x", "Build mldonkey with X11 support"]]
|
|
|
|
end
|
2010-08-04 00:00:42 +00:00
|
|
|
|
2012-06-14 02:54:33 +00:00
|
|
|
# Patches fix two compile errors with both clang and llvm. Reported as
|
|
|
|
# https://savannah.nongnu.org/patch/?7727 and in the following:
|
|
|
|
# https://savannah.nongnu.org/bugs/index.php?36654
|
|
|
|
# These patches are not yet in HEAD as of 13 JUN 2012. They do work according
|
|
|
|
# to the user report in issue #12774.
|
|
|
|
def patches
|
|
|
|
DATA
|
|
|
|
end
|
|
|
|
|
2010-08-04 00:00:42 +00:00
|
|
|
def install
|
2012-06-12 04:11:22 +00:00
|
|
|
ENV.libpng
|
|
|
|
|
|
|
|
# Fix compiler selection
|
|
|
|
ENV['OCAMLC'] = "#{HOMEBREW_PREFIX}/bin/ocamlc.opt -cc #{ENV.cc}"
|
2012-06-14 02:54:33 +00:00
|
|
|
|
|
|
|
# Let it build with standard Homebrew optimization
|
|
|
|
inreplace 'Makefile', '-O3', ''
|
2011-02-14 22:36:56 +00:00
|
|
|
|
2012-06-12 04:11:22 +00:00
|
|
|
args = ["--prefix=#{prefix}"]
|
|
|
|
args << "--enable-gui=newgui2" if ARGV.include? "--with-x"
|
2011-02-14 22:36:56 +00:00
|
|
|
|
|
|
|
system "./configure", *args
|
2010-08-04 00:00:42 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|
2012-06-14 02:54:33 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
--- a/Makefile 2012-04-05 07:11:34.000000000 -0700
|
|
|
|
+++ b/Makefile 2012-06-13 19:32:25.000000000 -0700
|
|
|
|
@@ -5447,7 +5447,7 @@
|
|
|
|
$(OCAMLC) $(DEVFLAGS) $(INCLUDES) -c $<
|
|
|
|
|
|
|
|
.mlcpp.ml:
|
|
|
|
- @$(CPP) -x c -P $< $(FIX_BROKEN_CPP) -o $@
|
|
|
|
+ cpp -P $< $(FIX_BROKEN_CPP) > $@
|
|
|
|
|
|
|
|
%.ml: %.mlp $(BITSTRING)/pa_bitstring.cmo
|
|
|
|
$(CAMLP4OF) build/bitstring.cma $(BITSTRING)/bitstring_persistent.cmo $(BITSTRING)/pa_bitstring.cmo -impl $< -o $@
|
|
|
|
--- a/config/Makefile.in 2012-04-04 13:22:49.000000000 -0700
|
|
|
|
+++ b/config/Makefile.in 2012-06-13 19:33:02.000000000 -0700
|
|
|
|
@@ -1848,7 +1848,7 @@
|
|
|
|
$(OCAMLC) $(DEVFLAGS) $(INCLUDES) -c $<
|
|
|
|
|
|
|
|
.mlcpp.ml:
|
|
|
|
- @$(CPP) -x c -P $< $(FIX_BROKEN_CPP) -o $@
|
|
|
|
+ cpp -P $< $(FIX_BROKEN_CPP) > $@
|
|
|
|
|
|
|
|
%.ml: %.mlp $(BITSTRING)/pa_bitstring.cmo
|
|
|
|
$(CAMLP4OF) build/bitstring.cma $(BITSTRING)/bitstring_persistent.cmo $(BITSTRING)/pa_bitstring.cmo -impl $< -o $@
|