#!/bin/bash
set -e
# just helping function
function echodo() {
echo "$@"
"$@"
}
# take prefix from argument, environment or default (/usr/local)
if [ ! -z "$1" ]; then
PREFIX="$1"
fi
if [ -z "$PREFIX" ]; then
PREFIX="/usr/local"
fi
echo "install to: $PREFIX"
# make install dir and determine its absolute path
BUILDDIR="$PWD"
echodo mkdir -p "$PREFIX"
cd "$PREFIX"
PREFIX="$PWD"
cd "$BUILDDIR"
echo "full path: $PREFIX"
# install headers
cd ../src
echodo mkdir -p "$PREFIX/include/helianthus/helianthus"
echodo cp animation.h colors.h common.h drawing.h font.h framebuffer.h \
group.h nuklear.h nuklear-heli.h sound.h sprite.h window.h \
"$PREFIX/include/helianthus/helianthus/"
echodo cp helianthus.h helianthus-nk.h \
"$PREFIX/include/helianthus/"
cd "$BUILDDIR"
# install libs and pkgconfig file
echodo mkdir -p "$PREFIX/lib/pkgconfig"
echodo cp libhelianthus.a libhelianthus.so libhelianthus.so.0 libhelianthus.so.0.1.0 \
"$PREFIX/lib/"
echo echo "prefix=$PREFIX" \| cat - helianthus.pc.in > "$PREFIX/lib/pkgconfig/helianthus.pc"
echo "prefix=$PREFIX" | cat - helianthus.pc.in > "$PREFIX/lib/pkgconfig/helianthus.pc"
echo "done"