Index: files/libs-random-build-Jamfile.v2
===================================================================
--- files/libs-random-build-Jamfile.v2	(révision 0)
+++ files/libs-random-build-Jamfile.v2	(révision 0)
@@ -0,0 +1,15 @@
+# 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 ;
Index: files/patch-configure.diff
===================================================================
--- files/patch-configure.diff	(révision 52116)
+++ files/patch-configure.diff	(copie de travail)
@@ -1,15 +0,0 @@
---- configure.orig	2008-04-29 14:46:53.000000000 -0400
-+++ configure	2008-12-07 13:24:30.000000000 -0500
-@@ -9,7 +9,11 @@
- 
- BJAM=""
- TOOLSET=""
--BJAM_CONFIG=""
-+BJAM_CONFIG="__MACPORTS_BJAM_CONFIG__"
-+# Handle MACOSX_DEPLOYMENT_TARGET
-+if test "x$MACOSX_DEPLOYMENT_TARGET" != x; then
-+    BJAM_CONFIG="$BJAM_CONFIG macosx-version=$MACOSX_DEPLOYMENT_TARGET"
-+fi
- BUILD=""
- PREFIX=/usr/local
- EPREFIX=
Index: files/patch-libs-mpi-build-Jamfile.v2.diff
===================================================================
--- files/patch-libs-mpi-build-Jamfile.v2.diff	(révision 0)
+++ files/patch-libs-mpi-build-Jamfile.v2.diff	(révision 0)
@@ -0,0 +1,10 @@
+--- libs/mpi/build/Jamfile.v2.orig	2009-06-11 01:57:28.000000000 +0200
++++ libs/mpi/build/Jamfile.v2	2009-06-11 01:57:28.000000000 +0200
+@@ -99,6 +99,7 @@
+         <link>shared:<define>BOOST_PYTHON_DYN_LINK=1    
+         <link>shared 
+         <variant>release   
++	<threading>multi
+       ;
+   }
+ }
Index: files/patch-libs-random-random_device.cpp.diff
===================================================================
--- files/patch-libs-random-random_device.cpp.diff	(révision 0)
+++ files/patch-libs-random-random_device.cpp.diff	(révision 0)
@@ -0,0 +1,11 @@
+--- 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
Index: Portfile
===================================================================
--- Portfile	(révision 52116)
+++ Portfile	(copie de travail)
@@ -3,184 +3,163 @@
 PortSystem 1.0
 
 name			boost
-version			1.38.0
+version			1.39.0
 categories		devel
 maintainers		gmail.com:sanchom
 description		Collection of portable C++ source libraries
-long_description 	Boost provides free portable peer-reviewed C++ \
+long_description	Boost provides free portable peer-reviewed C++ \
 			libraries. The emphasis is on portable libraries \
 			which work well with the C++ Standard Library.
 homepage		http://www.boost.org
 master_sites		sourceforge
-distname		${name}_[strsed ${version} {g/[.]/_/}]
+distname		${name}_[join [split ${version} .] _]
 use_bzip2		yes
-checksums		md5 5eca2116d39d61382b8f8235915cb267 \
-			sha1 b32ff8133b0a38a74553c0d33cb1d70b3ce2d8f1 \
-			rmd160 1d7eb126151e4363ecd5617082cd45674f1352be
+checksums		md5	a17281fd88c48e0d866e1a12deecbcc0 \
+			sha1	6af42f74ab24ccc51589a025593bad298c8adde8 \
+			rmd160	4962256b48fa8563bf373b8bed97cc8655206a51
 platforms		darwin
 use_parallel_build	yes
 
-# not autoconf
-universal_variant	no
+patchfiles		patch-libs-random-random_device.cpp.diff
 
-patchfiles		patch-configure.diff
+post-extract {
+	file mkdir ${worksrcpath}/libs/random/build
+	copy ${filesdir}/libs-random-build-Jamfile.v2 ${worksrcpath}/libs/random/build/Jamfile.v2
+}
 
 depends_build		path:bin/bjam:boost-jam
 depends_lib		port:zlib port:bzip2
 
-build.env-append	BZIP2_INCLUDE=${prefix}/include BZIP2_LIBPATH=${prefix}/lib \
-			ZLIB_INCLUDE=${prefix}/include ZLIB_LIBPATH=${prefix}/lib
-destroot.env-append	BZIP2_INCLUDE=${prefix}/include BZIP2_LIBPATH=${prefix}/lib \
-			ZLIB_INCLUDE=${prefix}/include ZLIB_LIBPATH=${prefix}/lib
-
-platform darwin 9 {
-	depends_build-append	port:gmake
-	build.cmd		gmake
+configure {
+	reinplace -E "s|-install_name \"|&${prefix}/lib/|" \
+		${worksrcpath}/tools/build/v2/tools/darwin.jam
+	touch ${worksrcpath}/user-config.jam
 }
 
-post-patch {
-	# --layout=system
-	#     (don't put compiler name or version number in the libraries;
-	#      don't put version number in the include directory)
-	#     [default: off]
-	#
-	# link=shared,static (build static and dynamic libraries)
-	#     [default: link=shared,static]
-	#
-	# runtime-link=shared,static
-	#     (link to static and shared C and C++ runtime (e.g. use -lstdc++-static))
-	#     static runtime-link libraries are of the form *-s.a or -sd.a
-	#     [default: runtime-link=shared]
-	#
-	# threading=single,multi
-	#     (build single- and multi-threaded libraries)
-	#     multi-threaded libraries are of the form of *-mt.dylib, -mt-d.dylib, *-mt.a, *-mt-s.a, *-mt-d.a, or *-mt-ds.a
-	#     [default: threading=multi]
-	#
-	# debug release
-	#     (buil debug and release versions of libraries)
-	#     debug libraries are of the form *-d.dylib, *-d.a, or *-ds.a
-	#     [default: release]
-	#
-	set bjam_config "--layout=system link=shared,static runtime-link=shared,static"
-	if { [variant_isset st] } {
-		append bjam_config " threading=single,multi"
-	}
-	if { [variant_isset debug] } {
-		append bjam_config " debug release"
-	}
-	reinplace "s|__MACPORTS_BJAM_CONFIG__|${bjam_config}|" ${worksrcpath}/configure
-}
+build.cmd		bjam [portbuild::build_getmakejobs]
+build.target
+build.args		--toolset=darwin \
+			--debug-configuration \
+			--ignore-site-config \
+			--user-config=user-config.jam \
+			--without-python \
+			--without-mpi \
+			-sBZIP2_INCLUDE=${prefix}/include \
+			-sBZIP2_LIBPATH=${prefix}/lib \
+			-sZLIB_INCLUDE=${prefix}/include \
+			-sZLIB_LIBPATH=${prefix}/lib
 
-post-configure {
-	# Ensure that the correct compiler is used
-	reinplace "s|using darwin ;|using darwin : : ${configure.cxx} ;|" ${worksrcpath}/user-config.jam
+destroot.cmd		bjam
+destroot.destdir	--prefix=${destroot}${prefix}
+
+pre-destroot {
+	eval destroot.args	${build.args}
 }
 
-platform darwin {
-	post-destroot {
-		# ensure the identification name of the dynamic libraries agree
-		# with their final destination path (not the destroot path that
-		# they've just been installed to)
-		foreach lib [glob -directory ${destroot}${prefix}/lib/ *.dylib] {
-			set libtail [file tail ${lib}]
-			system "install_name_tool -id ${prefix}/lib/${libtail} ${lib}"
-		}
+set pythons_suffixes {24 25 26}
 
-		# set the install_name for every library referenced by another library
-		# to include the final destination path as well
-		foreach lib [glob -tails -directory ${destroot}${prefix}/lib/ *.dylib] {
-			set installed_name ${prefix}/lib/${lib}
-			foreach lib2 [glob -directory ${destroot}${prefix}/lib/ *.dylib *.so] {
-				system "install_name_tool -change ${lib} ${installed_name} ${lib2}"
-			}
-		}
+set pythons_ports {}
+foreach s ${pythons_suffixes} {
+	lappend pythons_ports python${s}
+}
 
-		# mpi.so needs to be in a specific directory for Python to find it
-		if { [file exists ${destroot}${prefix}/lib/mpi.so] } {
-			if { [variant_isset python24] } {
-				set spkg ${prefix}/lib/python2.4/site-packages
-			} elseif { [variant_isset python25] } {
-				set spkg ${prefix}/lib/python2.5/site-packages
-			} elseif { [variant_isset python26] } {
-				set spkg ${frameworks_dir}/Python.framework/Versions/2.6/lib/python2.6/site-packages
-			}
-
-			set sodir ${spkg}/boost
-			xinstall -m 755 -d ${destroot}${sodir}
-			touch ${destroot}${sodir}/__init__.py
-			system "install_name_tool -id ${sodir}/mpi.so ${destroot}${prefix}/lib/mpi.so"
-			move ${destroot}${prefix}/lib/mpi.so ${destroot}${sodir}/mpi.so
+proc python_dir {} {
+	global pythons_suffixes
+	foreach s ${pythons_suffixes} {
+		if {[variant_isset python${s}]} {
+			set p python[string index ${s} 0].[string index ${s} 1]
+			return [exec ${p} -c "import sys; print sys.prefix"]/lib/${p}/site-packages
 		}
 	}
+	error "Python support not enabled."
 }
 
-destroot.destdir	prefix=${destroot}${prefix}
-
-configure.args		--without-libraries=python --without-icu --with-bjam=${prefix}/bin/bjam
-
-variant python24 description {build python 2.4 support} conflicts python25 python26 {
-	set pyversion		2.4
-	depends_lib-append      port:python[strsed ${pyversion} {g/[.]//}]
-
-	configure.args-delete	--without-libraries=python
-	configure.args-append	--with-python=${prefix}/bin/python${pyversion}
+proc write_jam s {
+	global worksrcpath
+	set config [open ${worksrcpath}/user-config.jam a]
+	puts ${config} ${s}
+	close ${config}
 }
 
-variant python25 description {build python 2.5 support} conflicts python24 python26 {
-	set pyversion		2.5
-	depends_lib-append      port:python[strsed ${pyversion} {g/[.]//}]
+foreach s ${pythons_suffixes} {
+	set p python${s}
+	set v [string index ${s} 0].[string index ${s} 1]
+	set i [lsearch -exact ${pythons_ports} ${p}]
+	set c [lreplace ${pythons_ports} ${i} ${i}]
+	eval [subst {
+		variant ${p} description "Build Boost.Python for Python ${v}" conflicts ${c} {
+			depends_lib-append	port:${p}
+			build.args-delete	--without-python
 
-	configure.args-delete	--without-libraries=python
-	configure.args-append	--with-python=${prefix}/bin/python${pyversion}
+			post-configure {
+				write_jam "using python : : ${prefix}/bin/python${v} ;"
+			}
+		}
+	}]
 }
 
-variant python26 description {build python 2.6 support} conflicts python24 python25 {
-	set pyversion		2.6
-	depends_lib-append      port:python[strsed ${pyversion} {g/[.]//}]
-
-	configure.args-delete	--without-libraries=python
-	configure.args-append	--with-python=${prefix}/bin/python${pyversion}
-}
-
-variant icu description {enable Unicode/ICU support in Regex} {
+variant icu description {Enable Unicode support in Boost.Regex through ICU} {
 	depends_lib-append	port:icu
-
-	configure.args-delete	--without-icu
-	configure.args-append	--with-icu=${prefix}
+	build.args-append	-sICU_PATH=${prefix}
 }
 
-variant graphml description {enable GraphML support} {
+variant graphml description {Enable GraphML support in Boost.Graph} {
 	depends_lib-append	port:expat
-
-	build.env-append	    EXPAT_INCLUDE=${prefix}/include EXPAT_LIBPATH=${prefix}/lib
-	destroot.env-append	    EXPAT_INCLUDE=${prefix}/include EXPAT_LIBPATH=${prefix}/lib
+	build.args-append	-sEXPAT_INCLUDE=${prefix}/include \
+				-sEXPAT_LIBPATH=${prefix}/lib
 }
 
-variant openmpi description {build mpi support} {
+variant openmpi description {Build Boost.MPI} {
 	depends_lib-append	port:openmpi
+	build.args-delete	--without-mpi
 
-    post-configure {
-        set config [open ${worksrcpath}/user-config.jam a]
-        puts ${config} "\nusing mpi : ${prefix}/bin/openmpicxx ;"
-        close ${config}
-    }
+	post-configure {
+		write_jam "using mpi : ${prefix}/bin/openmpic++ : : ${prefix}/bin/openmpirun ;"
+	}
+
+	if {![catch python_dir]} {
+		if {[variant_isset st]} {
+			patchfiles-append	patch-libs-mpi-build-Jamfile.v2.diff
+		}
+
+		post-destroot {
+			set site_packages [python_dir]
+			xinstall -d ${destroot}${site_packages}/boost
+			xinstall -m 644 ${worksrcpath}/libs/mpi/build/__init__.py \
+				${destroot}${site_packages}/boost
+
+			set l ${site_packages}/boost/mpi.so
+			move ${destroot}${prefix}/lib/mpi.so ${destroot}${l}
+			system "install_name_tool -id ${l} ${destroot}${l}"
+		}
+	}
 }
 
-variant docs description {install documentation} {
-    post-destroot {
-        # Install HTML documentation
-        xinstall -d ${destroot}${prefix}/share/doc/${name}
-        xinstall -W ${worksrcpath} index.htm index.html boost.css rst.css boost.png \
-            ${destroot}${prefix}/share/doc/${name}
-        file copy ${worksrcpath}/doc ${destroot}${prefix}/share/doc/${name}
-        file copy ${worksrcpath}/more ${destroot}${prefix}/share/doc/${name}
-        file copy ${worksrcpath}/tools ${destroot}${prefix}/share/doc/${name}
-        file copy ${worksrcpath}/libs ${destroot}${prefix}/share/doc/${name}
-        file copy ${worksrcpath}/wiki ${destroot}${prefix}/share/doc/${name}
-    }
+variant debug description {Build debug libraries} {
+	build.args-append	variant=debug,release
 }
 
-variant debug description {build debug libraries} {}
+variant doc description {Install documentation} {
+	post-destroot {
+		set docdir ${prefix}/share/doc/${name}-${version}
+		xinstall -d ${destroot}${docdir}
+		set l [expr [string length ${worksrcpath}] + 1]
+		fs-traverse f [glob -directory ${worksrcpath} *] {
+			set dest ${destroot}${docdir}/[string range ${f} ${l} end]
+			if {[file isdirectory ${f}]} {
+				xinstall -d ${dest}
+			} elseif {[lsearch -exact {css htm html png svg} [string range [file extension ${f}] 1 end]] != -1} {
+				xinstall -m 644 ${f} ${dest}
+			}
+		}
+	}
+}
 
-variant st description {build single-threaded libraries} {}
+variant st description {Build single-threaded libraries} {
+	build.args-append	threading=single,multi
+}
+
+variant universal {
+	# TODO: Handle 64 bits adressing.
+	build.args-append	architecture=combined
+}
