packages feed

reedsolomon-0.0.4.1: build-tools/ghc-wrapper

#!/bin/bash -ue

set -ue

set +e
# The `tr` below turns Windows path separators into Unix ones for the `grep` to
# succeed.
echo $@ | tr '\\' '/' | grep "Data/ReedSolomon/Galois/SIMD\.[a-z_]*o" > /dev/null 2>&1
RC=$?
set -e

set +e
$1 --version | grep 'version 8'
GHC8=$?
set -e

if test ${RC} -eq 0; then
    exec $@ ${CABAL_BUILD_DIR}/cbits/libreedsolomon_*_a-reedsolomon.o \
            ${CABAL_BUILD_DIR}/cbits/reedsolomon_dispatch.o
else
    if test ${GHC8} -eq 0; then
        exec $@ -fno-warn-redundant-constraints
    else
        exec $@
    fi
fi