updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / boost-devel / PKGBUILD
blob01a2b24efba1d1e489cb7fb5ba824a3dd4a62149
1 # Maintainer: Peter Simons <simons@cryp.to>
2 _pkgname=boost
3 pkgname=${_pkgname}-devel
4 pkgver=1.46.0
5 _boostver=${pkgver//./_}
6 pkgrel=2
7 pkgdesc="Boost provides free peer-reviewed portable C++ source libraries."
8 arch=('i686' 'x86_64')
9 url="http://www.boost.org/"
10 depends=('bzip2' 'zlib' 'expat' 'gcc-libs')
11 optdepends=( 'python2: to enable building of Boost.Python2'
12              'python: to enable building of Boost.Python3' )
13 source=("http://downloads.sourceforge.net/sourceforge/${_pkgname}/${_pkgname}_${_boostver}.tar.bz2")
14 license=('custom')
15 provides=('boost=1.46.0')
16 md5sums=('37b12f1702319b73876b0097982087e0')
18 build()
20   # All source paths below are relative from here.
21   cd "${srcdir}/${_pkgname}_${_boostver}"
23   # Determine architecture-relevant settings for bjam.
24   local _os="linux"
25   local _arch _jam_arch _address_model _instruction_set
26   case "${CARCH}" in
27     i686)
28       _arch="x86"
29       _address_model="32"
30       _instruction_set="i686"
31       _jam_arch="x86"
32       ;;
33     x86_64)
34       _arch="x86"
35       _address_model="64"
36       _instruction_set="nocona"
37       _jam_arch="x86_64"
38       ;;
39     *)
40       echo "*** unknown architecture $CARCH"
41       exit 1
42       ;;
43   esac
45   # Determine version of installed Python.
46   local _python2_version _python3_version
47   _python2_version=$(python2 --version 2>&1 | sed -r 's/Python ([0-9]+)\.([0-9]+).*/\1.\2/')
48   _python3_version=$(python3 --version 2>&1 | sed -r 's/Python ([0-9]+)\.([0-9]+).*/\1.\2/')
49   echo >user-config.jam "# auto-generated user-config.jam file"
50   case "${_python2_version}" in
51     2.[0-9]*)   echo >>user-config.jam "using python : ${_python2_version} ;" ;;
52     *)          ;;
53   esac
54   case "${_python3_version}" in
55     3.[0-9]*)   echo >>user-config.jam "using python : ${_python3_version} ;" ;;
56     *)          ;;
57   esac
59   # Ensure that bjam has been built.
60   local _bjam_root="tools/build/v2/engine/src"
61   local _bjam="${_bjam_root}/bin.${_os}${_jam_arch}/bjam"
62   [ -x "${_bjam}" ] || ( cd "${_bjam_root}" && ./build.sh )
64   # If MAKEFLAGS enables a parallel build, use it. Unfortunately, we
65   # cannot pass all make flags, so some imperfect guessing is necessary.
66   local _bjam_j_flag=""
67   case "${MAKEFLAGS}" in
68     -j[0-9]|-j[0-9][0-9]|-j[0-9][0-9][0-9]) _bjam_j_flag="${MAKEFLAGS}";;
69     *) ;;
70   esac
72   # Build and install Boost.
73   echo ""
74   echo "The build is about to start. Please note that the initial dependency"
75   echo "scanning phase may take a long time, even on fast machines. Please"
76   echo "be patient."
77   echo ""
78   "${_bjam}" ${_bjam_j_flag} -d2 \
79     "architecture=${_arch}" \
80     "address-model=${_address_model}" \
81     "instruction-set=${_instruction_set}" \
82     ${CXXFLAGS:+"cxxflags=${CXXFLAGS}"} \
83     toolset=gcc \
84     --build-type=complete \
85     --layout=versioned \
86     "--prefix=${pkgdir}/usr" \
87     --user-config=user-config.jam \
88     -sEXPAT_INCLUDE=/usr \
89     -sEXPAT_LIBPATH=/usr \
90     install || return 1
92   # Copy license.
93   install -Dm645 \
94     "LICENSE_1_0.txt" \
95     "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE_1_0.txt" \
96     || return 1
98   # We don't build and install pyste: the code doesn't work with Python
99   # 2.6, because it doesn't manage to import the elementtree library
100   # correctly.
101   #
102   # cd libs/python/pyste/install || return 1
103   # python setup.py install --root="${pkgdir}" || return 1
105   # Use a symlink to install the version-specific set of includes from
106   # Boost 1.46.0 in the system for inclusion as <boost/header.hpp>.
107   cd "${pkgdir}/usr/include" || return 1
108   ln -sf boost-1_46/boost/ boost || return 1