85 lines
2.1 KiB
Bash
Executable File
85 lines
2.1 KiB
Bash
Executable File
#/bin/sh
|
|
# -*- mode: sh; tab-width: 8; encoding: utf-8-unix -*-
|
|
|
|
PREFIX=/usr/local
|
|
. /usr/local/etc/testforge/testforge.bash
|
|
ROLE=toxcore
|
|
|
|
PYVER=3
|
|
P="BASE_PYTHON${PYVER}_MINOR"
|
|
[ -z "$PYTHON_MINOR" ] && PYTHON_MINOR="$(eval echo \$$P)"
|
|
PYTHON_EXE_MSYS=$PREFIX/bin/python$PYVER.bash
|
|
PYTHON_EXE=$PYTHON_EXE_MSYS
|
|
DESC=""
|
|
. /var/local/src/var_local_src.bash || exit 1
|
|
SITE_PACKAGES_MSYS=$PREFIX/$LIB/python$PYTHON_MINOR/site-packages
|
|
HTTP_DIR=$PREFIX/net/Http
|
|
|
|
DIR=toxygen_wrapper
|
|
MOD=$DIR
|
|
GIT_HUB=git.plastiras.org
|
|
GIT_USER=emdee
|
|
GIT_DIR=$DIR
|
|
# tox_profile
|
|
|
|
cd $PREFIX/src || exit 2
|
|
WD=$PWD
|
|
|
|
if [ "$#" -eq 0 ] ; then
|
|
|
|
if [ ! -d "$DIR" ] ; then
|
|
if [ ! -d "$PREFIX/net/Git/$GIT_HUB/$GIT_USER/$GIT_DIR" ] ; then
|
|
ols_are_we_connected || exit 0
|
|
[ -d "$PREFIX/net/Git/$GIT_HUB/$GIT_USER" ] || \
|
|
mkdir "$PREFIX/net/Git/$GIT_HUB/$GIT_USER"
|
|
( cd "$PREFIX/net/Git/$GIT_HUB/$GIT_USER" && \
|
|
git clone "https://$GIT_HUB/$GIT_USER/$GIT_DIR" ) ||\
|
|
exit 2
|
|
( cd "$PREFIX/net/Git/$GIT_HUB/$GIT_USER" && \
|
|
git config user emdee && \
|
|
git config email emdee@ )
|
|
|
|
fi
|
|
cp -rip "$PREFIX/net/Git/$GIT_HUB/$GIT_USER/$GIT_DIR" . || exit 3
|
|
fi
|
|
|
|
|
|
cd $DIR || exit 4
|
|
[ -f __init__.py ] || touch __init__.py
|
|
|
|
[ -d libs ] || mkdir libs
|
|
cd libs
|
|
for file in libtoxav.so libtoxcore.so libtoxencryptsave.so ; do
|
|
[ -e $file ] && continue
|
|
ln -s $PREFIX//src/c-toxcore/_build/libtoxcore.so $file
|
|
done
|
|
cd ..
|
|
|
|
# ols_apply_testforge_patches
|
|
|
|
# "$PYTHON_EXE_MSYS" -c "import $MOD" 2>/dev/null || exit 10
|
|
|
|
exit 0
|
|
|
|
elif [ $1 = 'check' ] ; then # 1*
|
|
# "$PYTHON_EXE_MSYS" -c "import $MOD" 2>/dev/null || exit 10
|
|
:
|
|
|
|
elif [ "$1" = 'lint' ] ; then # 2*
|
|
[ -n "$PYVER" ] || return 20
|
|
ols_run_lint_pylint -E --recursive y || exit 2$?
|
|
|
|
elif [ "$1" = 'test' ] ; then # 3*
|
|
|
|
cd $PREFIX/src/$DIR/$DIR/wrapper_tests || exit 32
|
|
$PYTHON_EXE_MSYS tests_wrapper.py \
|
|
>> $WD/$DIR/test.log 2>&1 || \
|
|
{ ERROR "$MOD code $?" ; cat $WD/$DIR/test.log ; exit 35 ; }
|
|
|
|
elif [ "$1" = 'refresh' ] ; then # 6*
|
|
|
|
cd $PREFIX/src/$DIR || exit 60
|
|
/usr/local/sbin/base_diff_from_dst.bash $ROLE || exit 6$?
|
|
|
|
fi
|