2 # Copyright (c) 2013 Vojtech Horky
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
9 # - Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # - Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the distribution.
14 # - The name of the author may not be used to endorse or promote products
15 # derived from this software without specific prior written permission.
17 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 shipsources="ftp://ftp.gnu.org/gnu/${shipname_}/${shipname_}-${shipversion}.tar.gz"
33 shiptugs="libgmp libmpfr"
37 run tar xzf ${shipname_}-${shipversion}.tar.gz
38 cd ${shipname_}-${shipversion}
42 $HSCT_CONFIGURE_ARGS \
46 msg "Building the library..."
47 run make -j$shipfunnels STATIC_ONLY=y
49 msg "Building the tests..."
50 run make check || true
54 find tabs tacos tacosh tadd tadd_fr tadd_si tadd_ui targ tasin \
55 tasinh tatan tatanh tconj tcos tcosh tdiv tdiv_2si tdiv_2ui tdiv_fr tdiv_ui \
56 texp tfma tfr_div tfr_sub timag tio_str tlog tlog10 \
57 tmul tmul_2si tmul_2ui tmul_fr tmul_i tmul_si tmul_ui \
58 tneg tnorm tpow tpow_ld tpow_d tpow_fr tpow_si tpow_ui tpow_z \
59 tprec tproj treal treimref tset tsin tsin_cos tsinh tsqr tsqrt tstrtoc tsub \
60 tsub_fr tsub_ui tswap ttan ttanh tui_div tui_ui_sub tget_version
66 cd ${shipname_}-${shipversion}
68 msg "Pretending standard Unix installation..."
69 run make install DESTDIR=$PWD/PKG
71 # Copy the headers and static library
72 msg "Copying relevant files to the coast..."
73 run cp PKG/usr/local/include/mpc.h "$HSCT_INCLUDE_DIR/"
74 run cp PKG/usr/local/lib/libmpc.a "$HSCT_LIB_DIR/"
76 run mkdir -p "$HSCT_MY_DIR/inc/c"
77 run cp PKG/usr/local/include/mpc.h "$HSCT_MY_DIR/inc/c"
79 run mkdir -p "$HSCT_MY_DIR/lib"
80 run cp PKG/usr/local/lib/libmpc.a "$HSCT_MY_DIR/lib"
84 msg "Preparing tests..."
85 run mkdir -p "$HSCT_MY_DIR/tests/${shipname}/"
87 echo "echo Running ${shipname} tests..." >"$HSCT_MY_DIR/tests/run_${shipname}.bdsh"
88 find . -executable -type f | while read testname; do
89 run cp "$testname" "$HSCT_MY_DIR/tests/${shipname}/$testname" || exit 1
90 echo "/tests/${shipname}/$testname" | sed 's#\./##' >>"$HSCT_MY_DIR/tests/run_${shipname}.bdsh"