detect SDL version 3 #41
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test | |
on: | |
push: | |
pull_request: | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: install dependencies | |
run: | | |
sudo apt-get update && \ | |
sudo DEBIAN_FRONTEND=noninteractive \ | |
apt-get install -y --no-install-recommends \ | |
zip grep file ca-certificates autotools-dev autoconf automake \ | |
git bc wget rsync cmake make pkg-config yasm libtool \ | |
libasound2-dev libv4l-dev ssh gzip tar \ | |
python3-pip python3-distutils \ | |
ca-certificates \ | |
libconfig-dev \ | |
libopus-dev \ | |
libsodium-dev \ | |
libvpx-dev \ | |
pkg-config \ | |
libavutil-dev \ | |
libavcodec-dev \ | |
libavformat-dev \ | |
libavdevice-dev \ | |
libavfilter-dev \ | |
libswresample-dev \ | |
libswscale-dev \ | |
libx264-dev \ | |
libx11-dev \ | |
libsdl2-dev | |
- name: check for python3 | |
run: | | |
python3 --version | |
- name: pwd | |
run: | | |
ls -al | |
pwd | |
- name: install python deps | |
run: | | |
python3 -m pip install evdev | |
- name: test-python-script | |
run: | | |
mkdir -p _test_python_/ | |
cd _test_python_/;ls -al ../toxblinkenwall/ext_keys_scripts/ext_keys_evdev.py;sleep 15;python3 ../toxblinkenwall/ext_keys_scripts/ext_keys_evdev.py > log.txt 2> log.txt & | |
- name: test-python-script-reader | |
run: | | |
cd _test_python_/; mkfifo ../ext_keys.fifo;sleep 10; if [ -s log.txt ]; then ls -al log.txt;echo "python script ERROR"; cat log.txt;exit 1; fi | |
- name: install deps | |
run: | | |
pwd | |
mkdir -p build_dir/ | |
cd build_dir/ | |
wget -O toxcore_amalgamation.c 'https://raw.githubusercontent.com/zoff99/c-toxcore/zoff99/zoxcore_local_fork/amalgamation/toxcore_amalgamation.c' | |
wget -O Makefile 'https://raw.githubusercontent.com/zoff99/c-toxcore/zoff99/zoxcore_local_fork/amalgamation/Makefile' | |
mkdir -p tox/ | |
wget -O tox/tox.h 'https://raw.githubusercontent.com/zoff99/c-toxcore/zoff99/zoxcore_local_fork/toxcore/tox.h' | |
wget -O tox/toxutil.h 'https://raw.githubusercontent.com/zoff99/c-toxcore/zoff99/zoxcore_local_fork/toxutil/toxutil.h' | |
wget -O tox/toxav.h 'https://raw.githubusercontent.com/zoff99/c-toxcore/zoff99/zoxcore_local_fork/toxav/toxav.h' | |
make | |
ls -al | |
- name: compile binary for Linux with SDL | |
run: | | |
mkdir -p build_dir/ | |
cd build_dir/ | |
pwd | |
cp -av ../toxblinkenwall/toxblinkenwall.c ./ | |
cp -av ../toxblinkenwall/rb.c ./ | |
cp -av ../toxblinkenwall/rb.h ./ | |
cp -av ../toxblinkenwall/stb_image_resize.h ./ | |
ls -al | |
# sed -i -e 's/#define HAVE_OUTPUT_OPENGL /#define HAVE_FRAMEBUFFER /' toxblinkenwall.c | |
# sed -i -e 's/#define HAVE_OUTPUT_OMX /#define HAVE_FRAMEBUFFER /' toxblinkenwall.c | |
# sed -i -e 'sx^// #define HAVE_X11_AS_FB 1x#define HAVE_X11_AS_FB 1x' toxblinkenwall.c | |
cat toxblinkenwall.c|grep 'define HAVE_OUTPUT_OPENGL'||echo _ | |
cat toxblinkenwall.c|grep 'define HAVE_OUTPUT_OMX'||echo _ | |
cat toxblinkenwall.c|grep 'define HAVE_FRAMEBUFFER'||echo _ | |
cat toxblinkenwall.c|grep 'define HAVE_X11_AS_FB'||echo _ | |
# make certain warnings into errors! | |
WARNS=' -Werror=implicit-function-declaration -Werror=div-by-zero -Werror=sign-compare -Werror=format=2 -Werror=int-conversion -Werror=implicit-function-declaration ' | |
IGNRS=' -Wno-error=format-truncation= ' | |
gcc \ | |
-O3 -g \ | |
$WARNS $IGNRS \ | |
-fstack-protector-all \ | |
-Wno-unused-variable \ | |
-fPIC -export-dynamic -I./ \ | |
-o toxblinkenwall \ | |
-lm \ | |
toxblinkenwall.c rb.c \ | |
-std=gnu99 \ | |
./libtoxcore.a \ | |
$(pkg-config --cflags --libs x11 libsodium libswresample opus vpx libavcodec libswscale libavformat libavdevice libavutil x264) \ | |
$(pkg-config --cflags --libs sdl2) \ | |
-pthread \ | |
-lrt \ | |
-lasound \ | |
-lm \ | |
-lv4lconvert || exit 1 | |
res2=$? | |
ldd toxblinkenwall | |
ls -hal toxblinkenwall | |
file toxblinkenwall | |
cp -av toxblinkenwall toxblinkenwall_linux_x11 | |
- name: compile binary for Linux Framebuffer | |
run: | | |
mkdir -p build_dir/ | |
cd build_dir/ | |
pwd | |
cp -av ../toxblinkenwall/toxblinkenwall.c ./ | |
cp -av ../toxblinkenwall/rb.c ./ | |
cp -av ../toxblinkenwall/rb.h ./ | |
cp -av ../toxblinkenwall/stb_image_resize.h ./ | |
ls -al | |
sed -i -e 's/#define HAVE_OUTPUT_OPENGL /#define HAVE_FRAMEBUFFER /' toxblinkenwall.c | |
sed -i -e 's/#define HAVE_OUTPUT_OMX /#define HAVE_FRAMEBUFFER /' toxblinkenwall.c | |
cat toxblinkenwall.c|grep 'define HAVE_OUTPUT_OPENGL'||echo _ | |
cat toxblinkenwall.c|grep 'define HAVE_OUTPUT_OMX'||echo _ | |
cat toxblinkenwall.c|grep 'define HAVE_FRAMEBUFFER'||echo _ | |
cat toxblinkenwall.c|grep 'define HAVE_X11_AS_FB'||echo _ | |
# make certain warnings into errors! | |
WARNS=' -Werror=implicit-function-declaration -Werror=div-by-zero -Werror=sign-compare -Werror=format=2 -Werror=int-conversion -Werror=implicit-function-declaration ' | |
IGNRS=' -Wno-error=format-truncation= ' | |
gcc \ | |
-O3 -g \ | |
$WARNS $IGNRS \ | |
-fstack-protector-all \ | |
-Wno-unused-variable \ | |
-fPIC -export-dynamic -I./ \ | |
-o toxblinkenwall \ | |
-lm \ | |
toxblinkenwall.c rb.c \ | |
-std=gnu99 \ | |
./libtoxcore.a \ | |
$(pkg-config --cflags --libs x11 libsodium libswresample opus vpx libavcodec libswscale libavformat libavdevice libavutil x264) \ | |
-pthread \ | |
-lrt \ | |
-lasound \ | |
-lm \ | |
-lv4lconvert || exit 1 | |
res2=$? | |
ldd toxblinkenwall | |
ls -hal toxblinkenwall | |
file toxblinkenwall | |
cp -av toxblinkenwall toxblinkenwall_linux_fb | |