updated on Mon Jan 23 16:10:15 UTC 2012
[aur-mirror.git] / boost-log-svn / PKGBUILD
blob477f8fb1512be6871784bbe8636ebab482db10b5
1 # Maintainer: Dmitriy Morozov <archlinux@foxcub.org>
2 # Contributor: kevin <kevin@archlinux.org>
3 # Contributor: Giovanni Scafora <giovanni@archlinux.org>
4 # Contributor: Kritoke <kritoke@gamebox.net>
5 # Contributor: Luca Roccia <little_rock@users.sourceforge.net>
7 # This PKGBUILD is modified from Arch's official Boost PKGBUILD to build the
8 # Boost.Logging library
10 pkgname=boost-log-svn
11 pkgver=592
12 _boostbase=boost
13 _boostver=1_46_0
14 pkgrel=1
15 arch=('i686' 'x86_64')
16 url="http://boost-log.sf.net"
17 makedepends=('icu' 'python' 'python2' 'bzip2' 'zlib' 'openmpi')
18 source=(http://downloads.sourceforge.net/sourceforge/${_boostbase}/${_boostbase}_${_boostver}.tar.gz
19         4994-compile-fix-for-Python32-v2.patch
20         boost-1.46.0-spirit.patch)
21 license=('custom')
22 options=('!ccache')
23 replaces=('boost-log')
24 conflicts=('boost-log')
25 md5sums=('820393d5746553c192db7b81ba0e53fe'
26          'cb59e8adbf2a45ef9264a2f4ab92b849'
27          '9d6e2f13fef23bf27d7bdddc104e182a')
29 _stagedir="${srcdir}/stagedir"
31 _svntrunk=https://boost-log.svn.sourceforge.net/svnroot/boost-log/trunk
32 _svnmod=boost-log
34 build() {
35   cd $srcdir
36   if [ -d $_svnmod/.svn ]; then
37     (cd $_svnmod && svn up -r $pkgver)
38   else
39     svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
40   fi
42   cp -a ${srcdir}/$_svnmod/$_svnmod/boost ${srcdir}/${_boostbase}_${_boostver}
43   cp -a ${srcdir}/$_svnmod/$_svnmod/libs  ${srcdir}/${_boostbase}_${_boostver}
45   # set python path for bjam
46   cd "${srcdir}/${_boostbase}_${_boostver}/tools"
47   echo "using python : 2.7 : /usr/bin/python2 ;" >> build/v2/user-config.jam
48   echo "using python : 3.2 : /usr/bin/python : /usr/include/python3.2mu : /usr/lib ;" >> build/v2/user-config.jam
49   echo "using mpi ;" >> build/v2/user-config.jam
51   # build bjam
52   cd "${srcdir}/${_boostbase}_${_boostver}/tools/build/v2/engine/src"
53   ./build.sh cc
55   _bindir="bin.linuxx86"
56   [ "${CARCH}" = "x86_64" ] && _bindir="bin.linuxx86_64"
58   install -d "${_stagedir}"/usr/bin
59   install ${_bindir}/bjam "${_stagedir}"/usr/bin/bjam
61   # build bcp
62   cd "${srcdir}/${_boostbase}_${_boostver}/tools/bcp"
63   ../build/v2/engine/src/${_bindir}/bjam --toolset=gcc
64   install -m755 "${srcdir}/${_boostbase}_${_boostver}/dist/bin/bcp" \
65                 ${_stagedir}/usr/bin/bcp
67   # build libs
68   cd "${srcdir}/${_boostbase}_${_boostver}"
69   #python 3.2 support
70   #https://svn.boost.org/trac/boost/ticket/4994
71   patch -Np0 -i "${srcdir}/4994-compile-fix-for-Python32-v2.patch"
72   patch -Np0 -i "${srcdir}/boost-1.46.0-spirit.patch"
74   # default "minimal" install: "release link=shared,static
75   # runtime-link=shared threading=single,multi"
76   # --layout=tagged will add the "-mt" suffix for multithreaded libraries
77   # and installs includes in /usr/include/boost.
78   # --layout=system no longer adds the -mt suffix for multi-threaded libs.
79   # install to ${_stagedir} in preparation for split packaging
81   ./tools/build/v2/engine/src/${_bindir}/bjam \
82       release debug-symbols=off threading=multi \
83       runtime-link=shared link=shared,static \
84       cflags=-fno-strict-aliasing \
85       toolset=gcc \
86       --prefix="${_stagedir}" \
87       -sTOOLS=gcc \
88       --layout=system \
89       --with-log \
90       ${MAKEFLAGS} \
91       install
93   # pyste is unmaintained: http://www.boost.org/doc/libs/1_46_0/libs/python/doc/index.html
94   # build pyste
95   #cd "${srcdir}/${pkgbase}_${_boostver}/libs/python/pyste/install"
96   #python2 setup.py install --root=${_stagedir} --optimize=1
99 package_boost() {
100     pkgdesc="Free peer-reviewed portable C++ source libraries - Development"
101     depends=("boost-libs=${pkgver}")
102     optdepends=('python: for python bindings'
103                 'python2: for python2 bindings')
105     install -d "${pkgdir}"/usr/{include,lib}
106     # headers/source files
107     cp -r "${_stagedir}"/include/ "${pkgdir}"/usr/
109     # static libs
110     cp -r "${_stagedir}"/lib/*.a "${pkgdir}"/usr/lib/
112     # utilities (bjam, bcp, pyste)
113     cp -r "${_stagedir}"/usr/* "${pkgdir}"/usr/
115     # license
116     install -D -m644 "${srcdir}/${_boostbase}_${_boostver}/LICENSE_1_0.txt" \
117         "${pkgdir}"/usr/share/licenses/boost/LICENSE_1_0.txt
120 package_boost-libs() {
121     pkgdesc="Free peer-reviewed portable C++ source libraries - Runtime"
122     depends=('gcc-libs' 'bzip2' 'zlib' 'icu')
123     optdepends=('openmpi: for mpi support')
125     install -d "${pkgdir}/usr/lib"
126     #shared libs
127     cp -r "${_stagedir}"/lib/*.so{,.*} "${pkgdir}/usr/lib/"
129     # license
130     install -D -m644 "${srcdir}/${_boostbase}_${_boostver}/LICENSE_1_0.txt" \
131         "${pkgdir}"/usr/share/licenses/boost-libs/LICENSE_1_0.txt
134 package_boost-log-svn() {
135     pkgdesc="Logging library provisionally accepted to Boost"
136     depends=('boost')
138     install -dm 755 "${pkgdir}"/usr/include/boost
139     install -dm 755 "${pkgdir}"/usr/lib
140     # headers/source files
141     cp -r "${_stagedir}"/include/boost/log "${pkgdir}"/usr/include/boost
143     # static libs
144     cp -r "${_stagedir}"/lib/*log*.a "${pkgdir}"/usr/lib/
145     cp -r "${_stagedir}"/lib/*log*.so{,.*} "${pkgdir}/usr/lib/"