[43281] trunk/dports/devel/boost/Portfile

mcalhoun at macports.org mcalhoun at macports.org
Sun Dec 7 22:28:38 PST 2008


Revision: 43281
          http://trac.macports.org/changeset/43281
Author:   mcalhoun at macports.org
Date:     2008-12-07 22:28:38 -0800 (Sun, 07 Dec 2008)
Log Message:
-----------
boost: version update 1.35.0 -> 1.37.0
Use MacPorts zlib and bzip2.
Ensure that correct c++ compiler is used.
Add python 2.6 support.
Add variant descriptions.
Split complete variant into debug and st variants.
Attempt to fix #15664, #15671, #16378, #17338, #17405, and #13843 (maintainer timeout).

Modified Paths:
--------------
    trunk/dports/devel/boost/Portfile

Modified: trunk/dports/devel/boost/Portfile
===================================================================
--- trunk/dports/devel/boost/Portfile	2008-12-08 06:26:39 UTC (rev 43280)
+++ trunk/dports/devel/boost/Portfile	2008-12-08 06:28:38 UTC (rev 43281)
@@ -3,10 +3,9 @@
 PortSystem 1.0
 
 name			boost
-version			1.35.0
-revision		2
+version			1.37.0
 categories		devel
-maintainers		sanchom at gmail.com
+maintainers		gmail.com:sanchom
 description		Collection of portable C++ source libraries
 long_description 	Boost provides free portable peer-reviewed C++ \
 			libraries. The emphasis is on portable libraries \
@@ -15,132 +14,161 @@
 master_sites		sourceforge
 distname		${name}_[strsed ${version} {g/[.]/_/}]
 use_bzip2		yes
-checksums		md5 dce952a7214e72d6597516bcac84048b
+checksums		md5 8d9f990bfb7e83769fa5f1d6f065bc92 \
+			sha1 c0d0cf9ad8d954507824aed51a3e93e6a9da1d99 \
+			rmd160 3c4cf7eb97a8fb126e564ba529ed9edec8765185
 platforms		darwin
 use_parallel_build	yes
 
-patchfiles		patch-tools-build-v2-tools-darwin.jam \
-			patch-boost-serialization-utility.hpp \
-			patch-configure
+patchfiles		patch-configure.diff
 
-depends_build		bin:bjam:boost-jam
+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
 }
 
+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
+}
+
+post-configure {
+	# Ensure that the coorect compiler is used
+	reinplace "s|using darwin ;|using darwin : : ${configure.cxx} ;|" ${worksrcpath}/user-config.jam
+}
+
 platform darwin {
 	post-destroot {
-
-		# get the library version as it shows up in the library names:
-		# eg. 1_35
-		# this should be ...] 0 2] {_}] when 1_35_1 and later come out
-		set libver [join [lrange [split ${version} {.}] 0 1] {_}]
-		
 		# 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/ *-${libver}.dylib] {
+		foreach lib [glob -directory ${destroot}${prefix}/lib/ *.dylib] {
 			set libtail [file tail ${lib}]
 			system "install_name_tool -id ${prefix}/lib/${libtail} ${lib}"
 		}
+
 		# set the install_name for every library referenced by another library
 		# to include the final destination path as well
-		foreach lib [glob -directory ${destroot}${prefix}/lib/ *-${libver}.dylib] {
-			set libtail [file tail ${lib}]
-			set installed_name ${prefix}/lib/${libtail}
-			foreach lib2 [glob -directory ${destroot}${prefix}/lib/ *-${libver}.dylib] {
-				system "install_name_tool -change ${libtail} ${installed_name} ${lib2}"
+		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}"
 			}
 		}
 
-		# create relative symbolic links to the versioned libraries (.dylib only;
-		# .a were built with unversioned extensions that are duplicate files of the
-		# versioned extensions... handled next)
-		foreach lib [glob -directory ${destroot}${prefix}/lib/ *-${libver}.dylib] {
-			set libtail [file tail ${lib}]
-			set libroot [join [lrange [split [file rootname ${lib}] {-}] 0 end-1] {-}]
-			set libname [file tail ${libroot}]
-			set libext [file extension ${lib}]
-			set liblink "${libroot}${libext}"
-			if {![catch {set libtype [file type ${liblink}]}]} {
-				if {${libtype} == "link"} {
-					file delete -force ${liblink}
-				}
+		# mpi.so needs to be in a specific directory for Python to find it
+		if { [file exists ${destroot}${prefix}/lib/mpi.so] } {
+			# Can be removed once MacPorts 1.7.0 is released
+			if {![info exists frameworks_dir]} {
+				set frameworks_dir ${prefix}/Library/Frameworks
 			}
-			system "cd  ${destroot}${prefix}/lib;ln -s ${libtail} ${libname}${libext}"
-		}
+			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
+			}
 
-		# change the duplicated non-version-named .a libraries to
-		# symbolic links to the version-named .a libraries
-		foreach lib [glob -directory ${destroot}${prefix}/lib/ *-${libver}.a] {
-			set libtail [file tail ${lib}]
-			set libroot [join [lrange [split [file rootname ${lib}] {-}] 0 end-1] {-}]
-			set libname [file tail ${libroot}]
-			set libext [file extension ${lib}]
-			set liblink "${libroot}${libext}"
-			# if this file is around, it is a duplicate, delete it
-			if {[file exists ${liblink}]} {
-				file delete -force ${liblink}
-			}
-			# add a symbolic link instead
-			system "cd  ${destroot}${prefix}/lib; ln -s ${libtail} ${libname}${libext}"
+			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
 		}
-		
-		# create a symbolic link in the include directory pointing to the current
-		# version of the boost include directory (e.g. boost-1_35/boost -> include/boost)
-		system "cd  ${destroot}${prefix}/lib; ln -fs boost-${libver}/boost ${destroot}${prefix}/include/boost"
 	}
 }
 
-destroot.args		PREFIX=${destroot}${prefix} EPREFIX=${destroot}${prefix} \
-			LIBDIR=${destroot}${prefix}/lib INCLUDEDIR=${destroot}${prefix}/include \
-			install
+destroot.destdir	prefix=${destroot}${prefix}
 
 configure.args		--without-libraries=python --without-icu --with-bjam=${prefix}/bin/bjam
 
-variant python24 conflicts python25 {
+variant python24 description {build python 2.4 support} conflicts python25 python26 {
 	set pyversion		2.4
-	depends_lib-append      lib:libpython${pyversion}:python[strsed ${pyversion} {g/[.]//}]
+	depends_lib-append      port:python[strsed ${pyversion} {g/[.]//}]
 
 	configure.args-delete	--without-libraries=python
-	configure.args-append   --with-python=python${pyversion}
+	configure.args-append	--with-python=${prefix}/bin/python${pyversion}
 }
 
-variant python25 conflicts python24 {
+variant python25 description {build python 2.5 support} conflicts python24 python26 {
 	set pyversion		2.5
-	depends_lib-append      lib:libpython${pyversion}:python[strsed ${pyversion} {g/[.]//}]
+	depends_lib-append      port:python[strsed ${pyversion} {g/[.]//}]
 
 	configure.args-delete	--without-libraries=python
-	configure.args-append   --with-python=python${pyversion}
+	configure.args-append	--with-python=${prefix}/bin/python${pyversion}
 }
 
-variant icu {
+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} {
 	depends_lib-append	port:icu
 
 	configure.args-delete	--without-icu
 	configure.args-append	--with-icu=${prefix}
 }
 
-variant graphml {
+variant graphml description {enable GraphML support} {
 	depends_lib-append	port:expat
 
-	configure.env-append	EXPAT_INCLUDE=${prefix}/include EXPAT_LIBPATH=${prefix}/lib
 	build.env-append	    EXPAT_INCLUDE=${prefix}/include EXPAT_LIBPATH=${prefix}/lib
+	destroot.env-append	    EXPAT_INCLUDE=${prefix}/include EXPAT_LIBPATH=${prefix}/lib
 }
 
-variant openmpi {
+variant openmpi description {build mpi support} {
 	depends_lib-append	port:openmpi
 
     post-configure {
-        set config [open user-config.jam a]
-        puts ${config} "using mpi : ${prefix}/bin/openmpicxx ;"
+        set config [open ${worksrcpath}/user-config.jam a]
+        puts ${config} "\nusing mpi : ${prefix}/bin/openmpicxx ;"
         close ${config}
     }
 }
 
-variant docs {
+variant docs description {install documentation} {
     post-destroot {
         # Install HTML documentation
         xinstall -d ${destroot}${prefix}/share/doc/${name}
@@ -150,11 +178,10 @@
         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}
     }
 }
 
-# Should no longer conflict with icu in version 1.35.1, see:
-# http://svn.boost.org/trac/boost/ticket/1928
-variant complete conflicts icu description {Build all library types (debug, static, single-threaded)} {
-    patchfiles-append   patch-build-type-Jamroot
-}
+variant debug description {build debug libraries} {}
+
+variant st description {build single-threaded libraries} {}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20081207/26947f8a/attachment.html>


More information about the macports-changes mailing list