diff options
| author | Chris Hoffman | 2010-01-30 08:35:48 -0600 |
|---|---|---|
| committer | Adam Vandenberg | 2010-03-12 22:01:09 -0800 |
| commit | 7dde1d05fed3924371d0571c759f5fb4239d6180 (patch) | |
| tree | 33a411f7683b3d1ba607a2321338a1a32eae3de0 /Library | |
| parent | a61db2c865a455edba4d1d967028e591b0269915 (diff) | |
| download | homebrew-7dde1d05fed3924371d0571c759f5fb4239d6180.tar.bz2 | |
Boost 1.42
With patches for:
* homebrew outside of /usr/local
* compile problems with llvm-g++
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/boost.rb | 110 |
1 files changed, 83 insertions, 27 deletions
diff --git a/Library/Formula/boost.rb b/Library/Formula/boost.rb index 34acfe9fd..2257c21c8 100644 --- a/Library/Formula/boost.rb +++ b/Library/Formula/boost.rb @@ -1,42 +1,98 @@ require 'formula' class Boost <Formula - @homepage='http://www.boost.org' - @url='http://downloads.sourceforge.net/project/boost/boost/1.41.0/boost_1_41_0.tar.bz2' - @md5='8bb65e133907db727a2a825c5400d0a6' + homepage 'http://www.boost.org' + url 'http://downloads.sourceforge.net/project/boost/boost/1.42.0/boost_1_42_0.tar.bz2' + md5 '7bf3b4eb841b62ffb0ade2b82218ebe6' def patches - { :p2 => DATA } + { :p0 => DATA } end def install + # Use GCC 4.2 because the standard llvm-gcc causes errors with dropped arugments + # to functions when linking with the boost library + ENV.gcc_4_2 + + # Not sure about this, but added since macports has it + mkdir 'libs/random/build' + open("libs/random/build/Jamfile.v2", "w") do |file| + file.write <<-EOF.gsub(/^\s+/, '') + # Copyright (c) 2006 Tiziano Mueller + # + # Use, modification and distribution of the file is subject to the + # Boost Software License, Version 1.0. + # (See at http://www.boost.org/LICENSE_1_0.txt) + + + project boost/random + : source-location ../ ; + + SOURCES = random_device ; + + lib boost_random + : $(SOURCES).cpp + : <link>shared:<define>BOOST_RANDOM_DYN_LINK=1 ; + EOF + end + + # Adjust the name the libs are installed under to include the path to the + # Homebrew lib directory. It has the following effect: + # + # otool -L `which mkvmerge` + # /Users/cehoffman/.homebrew/bin/mkvmerge: + # /Users/cehoffman/.homebrew/Cellar/libvorbis/1.2.3/lib/libvorbis.0.dylib (compatibility version 5.0.0, current version 5.3.0) + # /Users/cehoffman/.homebrew/Cellar/libogg/1.1.4/lib/libogg.0.dylib (compatibility version 7.0.0, current version 7.0.0) + # /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3) + # /usr/lib/libbz2.1.0.dylib (compatibility version 1.0.0, current version 1.0.5) + # /usr/lib/libexpat.1.dylib (compatibility version 7.0.0, current version 7.2.0) + # /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0) + # libboost_regex-mt.dylib (compatibility version 0.0.0, current version 0.0.0) + # libboost_filesystem-mt.dylib (compatibility version 0.0.0, current version 0.0.0) + # libboost_system-mt.dylib (compatibility version 0.0.0, current version 0.0.0) + # /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0) + # /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.0) + # + # becomes + # + # /Users/cehoffman/.homebrew/bin/mkvmerge: + # /Users/cehoffman/.homebrew/Cellar/libvorbis/1.2.3/lib/libvorbis.0.dylib (compatibility version 5.0.0, current version 5.3.0) + # /Users/cehoffman/.homebrew/Cellar/libogg/1.1.4/lib/libogg.0.dylib (compatibility version 7.0.0, current version 7.0.0) + # /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3) + # /usr/lib/libbz2.1.0.dylib (compatibility version 1.0.0, current version 1.0.5) + # /usr/lib/libexpat.1.dylib (compatibility version 7.0.0, current version 7.2.0) + # /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0) + # /Users/cehoffman/.homebrew/lib/libboost_regex-mt.dylib (compatibility version 0.0.0, current version 0.0.0) + # /Users/cehoffman/.homebrew/lib/libboost_filesystem-mt.dylib (compatibility version 0.0.0, current version 0.0.0) + # /Users/cehoffman/.homebrew/lib/libboost_system-mt.dylib (compatibility version 0.0.0, current version 0.0.0) + # /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0) + # /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.0) + # + # Hence executables that link against the boost library will work when + # Homebrew is installed in a non standard location + inreplace 'tools/build/v2/tools/darwin.jam', '-install_name "', "-install_name \"#{`brew --prefix`.strip}/lib/" + + # Force boost to compile using the GCC 4.2 compiler + open("user-config.jam", "a") do |file| + file.write "using darwin : : #{ENV['CXX']} ;\n" + end + # we specify libdir too because the script is apparently broken system "./bootstrap.sh --prefix='#{prefix}' --libdir='#{lib}'" - system "./bjam --layout=tagged --prefix='#{prefix}' --libdir='#{lib}' threading=multi install" + system "./bjam -j#{Hardware.processor_count} --layout=tagged --prefix='#{prefix}' --libdir='#{lib}' --user-config=user-config.jam threading=multi install" end end __END__ -https://svn.boost.org/trac/boost/changeset/56467 -Index: /trunk/boost/test/impl/framework.ipp =================================================================== ---- /trunk/boost/test/impl/framework.ipp (revision 53665) -+++ /trunk/boost/test/impl/framework.ipp (revision 56467) -@@ -125,11 +125,12 @@ - { - while( !m_test_units.empty() ) { -- test_unit_store::value_type const& tu = *m_test_units.begin(); -+ test_unit_store::value_type const& tu = *m_test_units.begin(); -+ test_unit* tu_ptr = tu.second; - - // the delete will erase this element from map - if( ut_detail::test_id_2_unit_type( tu.second->p_id ) == tut_suite ) -- delete static_cast<test_suite const*>(tu.second); -+ delete (test_suite const*)tu_ptr; - else -- delete static_cast<test_case const*>(tu.second); -+ delete (test_case const*)tu_ptr; - } - } - - +--- libs/random/random_device.cpp.orig 2009-06-11 15:27:21.000000000 +0200 ++++ libs/random/random_device.cpp 2009-06-11 15:28:01.000000000 +0200 +@@ -22,7 +22,7 @@ + #endif + + +-#if defined(__linux__) || defined (__FreeBSD__) ++#if defined(__linux__) || defined (__FreeBSD__) || defined(__APPLE__) + + // the default is the unlimited capacity device, using some secure hash + // try "/dev/random" for blocking when the entropy pool has drained |
