source: npl/overig/boost/boost.SlackBuild.orig @ 0105685

gcc484ntopperl-5.22
Last change on this file since 0105685 was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100755
File size: 4.9 KB
Line 
1#!/bin/sh
2
3# Copyright 2007, 2008, 2012 Eric Hameleers, Eindhoven, NL
4# Copyright 2007-2008, 2013, 2014 Heinz Wiesinger, Amsterdam, NL
5# Copyright 2008, 2009, 2010, 2013, 2014, 2015  Patrick J. Volkerding, Sebeka, MN, USA
6# All rights reserved.
7#
8# Redistribution and use of this script, with or without modification, is
9# permitted provided that the following conditions are met:
10#
11# 1. Redistributions of this script must retain the above copyright
12#    notice, this list of conditions and the following disclaimer.
13#
14# THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESS OR IMPLIED
15# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
17# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
20# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
25# bjam-build system mostly taken from SlackBuild by Eric Hameleers
26# Script modified by Robby Workman - no copyright claims or added terms
27# Modified 2012 by Eric Hameleers <alien at slackware.com> for ARM port.
28
29
30PKGNAM=boost
31VERSION=${VERSION:-$(echo $PKGNAM_*.tar.?z* | rev | cut -f 3- -d . | rev | cut -f 2- -d _)}
32BUILD=${BUILD:-1}
33
34PKG_VERSION=$(echo $VERSION | tr _ .)   # Leave this alone
35NUMJOBS=${NUMJOBS:-" -j7 "}
36
37# Automatically determine the architecture we're building on:
38MARCH=$( uname -m )
39if [ -z "$ARCH" ]; then
40  case "$MARCH" in
41    i?86)    export ARCH=i586 ;;
42    armv7hl) export ARCH=$MARCH ;;
43    arm*)    export ARCH=arm ;;
44    # Unless $ARCH is already set, use uname -m for all other archs:
45    *)       export ARCH=$MARCH ;;
46  esac
47fi
48
49if [ "$ARCH" = "i586" ]; then
50  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
51  LIBDIRSUFFIX=""
52elif [ "$ARCH" = "s390" ]; then
53  SLKCFLAGS="-O2"
54  LIBDIRSUFFIX=""
55elif [ "$ARCH" = "x86_64" ]; then
56  SLKCFLAGS="-O2 -fPIC"
57  LIBDIRSUFFIX="64"
58elif [ "$ARCH" = "armv7hl" ]; then
59  SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16"
60  LIBDIRSUFFIX=""
61else
62  SLKCFLAGS="-O2"
63  LIBDIRSUFFIX=""
64fi
65
66CWD=$(pwd)
67TMP=${TMP:-/tmp}
68PKG=$TMP/package-boost
69
70rm -rf $PKG
71mkdir -p $TMP $PKG
72cd $TMP
73rm -rf boost_$VERSION
74tar xvf $CWD/boost_$VERSION.tar.?z* || exit 1
75cd boost_$VERSION || exit 1
76
77chown -R root:root .
78find . \
79 \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
80 -exec chmod 755 {} \; -o \
81 \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
82 -exec chmod 644 {} \;
83
84# Don't allow MOC to process this incompatible header:
85sed -e '1 i#ifndef Q_MOC_RUN' \
86  -e '$ a#endif' \
87  -i boost/type_traits/detail/has_binary_operator.hpp
88
89# This is the python we build against:
90PYTHON_VERSION=$(python -c 'import sys; print sys.version[:3]')
91PYTHON_FLAGS="-sPYTHON_ROOT=/usr -sPYTHON_VERSION=$PYTHON_VERSION"
92
93# First build bjam, the boost build system:
94cd tools/build/src/engine
95  CFLAGS="$SLKCFLAGS -fno-strict-aliasing" CC=gcc ./build.sh cc
96cd -
97
98BJAM=$(find tools/build/src/engine/ -name b2 -a -type f)
99
100# Create build subdirectory
101mkdir obj
102
103# Next, we build boost using bjam
104$BJAM \
105  release \
106  $NUMJOBS \
107  "-sNO_COMPRESSION=0" \
108  "-sZLIB_INCLUDE=/usr/include" \
109  "-sZLIB_LIBPATH=/usr/lib${LIBDIRSUFFIX}" \
110  "-sBZIP2_INCLUDE=/usr/include" \
111  "-sBZIP2_LIBPATH=/usr/lib${LIBDIRSUFFIX}" \
112  "-sEXPAT_INCLUDE=/usr/include" \
113  "-sEXPAT_LIBPATH=/usr/lib${LIBDIRSUFFIX}" \
114  --layout=system \
115  --builddir=obj \
116  --prefix=/usr \
117  --libdir=/usr/lib${LIBDIRSUFFIX} \
118  --build-type=minimal \
119  toolset=gcc \
120  variant=release \
121  link=shared \
122  threading=multi \
123  runtime-link=shared \
124  cflags="$SLKCFLAGS" \
125  cxxflags="$SLKCFLAGS $EXTRA_CXXFLAGS" \
126  $PYTHON_FLAGS \
127  stage || exit 1
128
129# And then install boost..
130mkdir -p $PKG/usr/{lib$LIBDIRSUFFIX,include}
131
132$BJAM \
133  release \
134  "-sEXPAT_INCLUDE=/usr/include" \
135  "-sEXPAT_LIBPATH=/usr/lib${LIBDIRSUFFIX}" \
136  --layout=system \
137  --builddir=obj \
138  --prefix=$PKG/usr \
139  --libdir=$PKG/usr/lib${LIBDIRSUFFIX} \
140  --build-type=minimal \
141  toolset=gcc \
142  variant=release \
143  link=shared \
144  threading=multi \
145  runtime-link=shared \
146  cflags="$SLKCFLAGS" \
147  cxxflags="$SLKCFLAGS $EXTRA_CXXFLAGS" \
148  $PYTHON_FLAGS \
149  install || exit 1
150
151find $PKG | xargs file | grep -e "executable" -e "shared object" \
152  | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
153
154mkdir -p $PKG/usr/doc/boost-$PKG_VERSION
155# Do not copy 44MB of developer 'doc/html' into our package...
156cp -a LICENSE* index.html $PKG/usr/doc/boost-$PKG_VERSION
157find $PKG/usr/doc -type f -exec chmod 0644 {} \;
158
159mkdir -p $PKG/install
160cat $CWD/slack-desc > $PKG/install/slack-desc
161
162cd $PKG
163/sbin/makepkg -l y -c n /tmp/boost-$PKG_VERSION-$ARCH-$BUILD.txz
164
Note: See TracBrowser for help on using the repository browser.