2017-11-24 18:02:58 +00:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
set -e
|
2018-06-27 11:42:47 +00:00
|
|
|
set -o pipefail
|
2017-11-24 18:02:58 +00:00
|
|
|
|
2018-06-28 21:10:14 +00:00
|
|
|
if [ -n "$BUILD_DEBUG" ]; then
|
|
|
|
set -x
|
|
|
|
fi
|
|
|
|
|
2018-05-23 04:54:33 +00:00
|
|
|
SHELL=${SHELL-$(command -v sh)}
|
2018-05-03 18:32:06 +00:00
|
|
|
PREFIX=${PREFIX-/usr/local}
|
2017-11-24 18:02:58 +00:00
|
|
|
MES_PREFIX=${MES_PREFIX-$PREFIX/share/mes}
|
|
|
|
MES_SEED=${MES_SEED-../mes-seed}
|
|
|
|
TINYCC_SEED=${TINYCC_SEED-../tinycc-seed}
|
|
|
|
|
|
|
|
mkdir -p $PREFIX/bin
|
2018-04-07 16:27:26 +00:00
|
|
|
cp src/mes $PREFIX/bin/mes
|
2017-11-24 18:02:58 +00:00
|
|
|
|
|
|
|
mkdir -p $PREFIX/lib
|
|
|
|
mkdir -p $MES_PREFIX/lib
|
2018-04-27 21:47:31 +00:00
|
|
|
cp scripts/mescc $PREFIX/bin/mescc
|
2017-11-24 18:02:58 +00:00
|
|
|
|
|
|
|
mkdir -p $MES_PREFIX
|
2018-05-29 18:07:46 +00:00
|
|
|
tar -cf- doc guile include lib module scaffold | tar -xf- -C $MES_PREFIX
|
2018-04-29 16:38:57 +00:00
|
|
|
|
|
|
|
GUILE_EFFECTIVE_VERSION=${GUILE_EFFECTIVE_VERSION-2.2}
|
|
|
|
DATADIR=${MODULEDIR-$PREFIX/share/mes}
|
|
|
|
DOCDIR=${MODULEDIR-$PREFIX/share/doc/mes}
|
|
|
|
MODULEDIR=${MODULEDIR-$DATADIR/module}
|
|
|
|
GUILEDIR=${MODULEDIR-$PREFIX/share/guile/site/$GUILE_EFFECTIVE_VERSION}
|
|
|
|
GODIR=${GODIR-$PREFIX/lib/guile/$GUILE_EFFECTIVE_VERSION/site-ccache}
|
|
|
|
DOCDIR=${MODULEDIR-$PREFIX/share/doc/mes}
|
|
|
|
|
|
|
|
chmod +w $PREFIX/bin/mescc
|
|
|
|
sed \
|
2018-05-23 18:28:43 +00:00
|
|
|
-e "s,^#! /bin/sh,#! $SHELL," \
|
2018-04-29 16:38:57 +00:00
|
|
|
-e "s,module/,$MODULEDIR/," \
|
|
|
|
-e "s,@DATADIR@,$DATADIR,g" \
|
|
|
|
-e "s,@DOCDIR@,$DOCDIR,g" \
|
|
|
|
-e "s,@GODIR@,$GODIR,g" \
|
|
|
|
-e "s,@GUILEDIR@,$GUILEDIR,g" \
|
|
|
|
-e "s,@MODULEDIR@,$MODULEDIR,g" \
|
|
|
|
-e "s,@PREFIX@,$PREFIX,g" \
|
|
|
|
-e "s,@VERSION@,$VERSION,g" \
|
|
|
|
scripts/mescc > $PREFIX/bin/mescc
|
|
|
|
chmod +w $MODULEDIR/mes/boot-0.scm
|
|
|
|
sed \
|
2018-05-23 18:28:43 +00:00
|
|
|
-e "s,^#! /bin/sh,#! $SHELL," \
|
2018-04-29 16:38:57 +00:00
|
|
|
-e "s,module/,$MODULEDIR/," \
|
|
|
|
-e "s,@DATADIR@,$DATADIR,g" \
|
|
|
|
-e "s,@DOCDIR@,$DOCDIR,g" \
|
|
|
|
-e "s,@GODIR@,$GODIR,g" \
|
|
|
|
-e "s,@GUILEDIR@,$GUILEDIR,g" \
|
|
|
|
-e "s,@MODULEDIR@,$MODULEDIR,g" \
|
|
|
|
-e "s,@PREFIX@,$PREFIX,g" \
|
|
|
|
-e "s,@VERSION@,$VERSION,g" \
|
|
|
|
module/mes/boot-0.scm > $MODULEDIR/mes/boot-0.scm
|
2018-05-23 04:54:33 +00:00
|
|
|
|
|
|
|
sed \
|
2018-05-23 18:28:43 +00:00
|
|
|
-e "s,^#! /bin/sh,#! $SHELL," \
|
2018-05-23 04:54:33 +00:00
|
|
|
scripts/diff.scm > $PREFIX/bin/diff.scm
|
2018-06-12 05:05:33 +00:00
|
|
|
chmod -w+x $PREFIX/bin/diff.scm
|
2018-06-27 11:42:47 +00:00
|
|
|
|
|
|
|
if [ -f doc/mes.info ]; then
|
|
|
|
mkdir -p $PREFIX/share/info
|
|
|
|
install-info --info-dir=$PREFIX/share/info doc/mes.info
|
|
|
|
tar -cf- doc/mes.info* | tar -xf- --strip-components=1 -C $PREFIX/share/info
|
|
|
|
fi
|
2018-06-28 21:10:14 +00:00
|
|
|
|
|
|
|
if [ -f doc/mes.1 ]; then
|
|
|
|
mkdir -p $PREFIX/man/man1
|
|
|
|
cp doc/mes.1 $PREFIX/man/man1/
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f doc/mescc.1 ]; then
|
|
|
|
mkdir -p $PREFIX/man/man1
|
|
|
|
cp doc/mescc.1 $PREFIX/man/man1/
|
|
|
|
fi
|