build automation!!
This commit is contained in:
parent
a80e7a5897
commit
9c5fc70321
|
@ -0,0 +1,3 @@
|
||||||
|
/sourcefiles/*.swf
|
||||||
|
/dist
|
||||||
|
/workdir
|
|
@ -0,0 +1,6 @@
|
||||||
|
[submodule "external/nspluginwrapper"]
|
||||||
|
path = external/nspluginwrapper
|
||||||
|
url = https://git.vvn.space/lifning/nspluginwrapper
|
||||||
|
[submodule "external/freshplayerplugin"]
|
||||||
|
path = external/freshplayerplugin
|
||||||
|
url = https://github.com/i-rinat/freshplayerplugin/
|
|
@ -0,0 +1,96 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
export XBPS_ARCH=armv6l
|
||||||
|
void_repository=https://alpha.us.repo.voidlinux.org/
|
||||||
|
|
||||||
|
set -eo pipefail
|
||||||
|
command -v curl tar zstd xz 7z zcat sudo rsync
|
||||||
|
test -f external/freshplayerplugin/CMakeLists.txt
|
||||||
|
test -f external/nspluginwrapper/configure
|
||||||
|
|
||||||
|
mkdir -p workdir
|
||||||
|
cd workdir
|
||||||
|
|
||||||
|
if [ ! -x usr/bin/xbps-install.static ] ; then
|
||||||
|
mkdir -p etc/xbps.d
|
||||||
|
cat > etc/xbps.d/00-repository-main.conf <<EOF
|
||||||
|
repository=$void_repository/current
|
||||||
|
ignorepkg=rpi-userland
|
||||||
|
EOF
|
||||||
|
curl $void_repository/static/xbps-static-latest.$XBPS_ARCH-musl.tar.xz | tar xJ
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f ../dist/lib/plugins/libpepflashplayer.so ] ; then
|
||||||
|
chromeos_url=`curl https://dl.google.com/dl/edgedl/chromeos/recovery/recovery.conf | grep -o 'https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_.*_elm_recovery_stable-channel_mp-v2.bin.zip'`
|
||||||
|
curl "$chromeos_url" | zcat > chromeos.bin
|
||||||
|
7z e chromeos.bin ROOT-A.img -y
|
||||||
|
test -f ROOT-A.img
|
||||||
|
rm chromeos.bin
|
||||||
|
7z e ROOT-A.img libpepflashplayer.so -r -y
|
||||||
|
test -f libpepflashplayer.so
|
||||||
|
rm ROOT-A.img
|
||||||
|
mkdir -p ../dist/lib/plugins
|
||||||
|
mv libpepflashplayer.so ../dist/lib/plugins/
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f ../dist/lib/alsa-lib/libasound_module_pcm_pulse.so ] ; then
|
||||||
|
cat ../pkglist | xargs usr/bin/xbps-install.static -r $PWD -SDy
|
||||||
|
|
||||||
|
set +e
|
||||||
|
for i in var/cache/xbps/*.xbps; do
|
||||||
|
tar --wildcards -xf $i ./usr/lib/\* 2>/dev/null
|
||||||
|
done
|
||||||
|
set -e
|
||||||
|
tar --wildcards -xf var/cache/xbps/bc-*.xbps ./usr/bin/\*bc
|
||||||
|
|
||||||
|
mkdir -p ../dist/lib/alsa-lib ../dist/bin
|
||||||
|
cp usr/bin/*bc ../dist/bin/bc
|
||||||
|
cp usr/lib/lib*.so.* ../dist/lib/
|
||||||
|
rm ../dist/lib/lib*.so.*.*
|
||||||
|
cp usr/lib/ld-linux-armhf.so.3 ../dist/lib/
|
||||||
|
cp usr/lib/pulseaudio/libpulsecommon-*.so ../dist/lib/
|
||||||
|
cp usr/lib/alsa-lib/libasound_module_pcm_pulse.so ../dist/lib/alsa-lib/
|
||||||
|
chmod -x ../dist/lib/lib* ../dist/lib/alsa-lib/libasound_module_pcm_pulse.so
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -x /lib/ld-linux-armhf.so.3 ] ; then
|
||||||
|
echo "/lib/ld-linux-armhf.so.3 not found, installing..."
|
||||||
|
sudo cp -v ../dist/lib/ld-linux-armhf.so.3 /lib/
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -x ../dist/bin/npplayer ] ; then
|
||||||
|
cat ../devpkglist | xargs usr/bin/xbps-install.static -r $PWD -Sy
|
||||||
|
ln -sf usr/lib .
|
||||||
|
ln -sf usr/bin .
|
||||||
|
mkdir -p src tmp dev
|
||||||
|
touch dev/null
|
||||||
|
cp -al ../external/* src/
|
||||||
|
|
||||||
|
cat > inner-build.sh <<EOF
|
||||||
|
#!/usr/bin/bash
|
||||||
|
set -e
|
||||||
|
cd /src/freshplayerplugin
|
||||||
|
cmake -B_build -H. -DWITH_GLES2=TRUE -DWITH_{HWDEC,JACK,PULSEAUDIO,LIBV4L2}=FALSE
|
||||||
|
make -C_build -j`nproc`
|
||||||
|
cd /src/nspluginwrapper
|
||||||
|
linux32 ./configure --target-cpu=arm
|
||||||
|
make -j`nproc` npplayer
|
||||||
|
EOF
|
||||||
|
chmod +x inner-build.sh
|
||||||
|
userspec="$USER:$(id -gn)"
|
||||||
|
sudo -n true || echo "need sudo to chroot for the compile..."
|
||||||
|
set -x
|
||||||
|
sudo mount -o bind /dev/null dev/null
|
||||||
|
cleanup() {
|
||||||
|
sudo umount dev/null
|
||||||
|
}
|
||||||
|
trap cleanup EXIT
|
||||||
|
sudo chroot --userspec=$userspec . /inner-build.sh
|
||||||
|
set +x
|
||||||
|
|
||||||
|
cp src/freshplayerplugin/_build/libfreshwrapper-flashplayer.so ../dist/lib/plugins/
|
||||||
|
chmod -x ../dist/lib/plugins/libfreshwrapper-flashplayer.so
|
||||||
|
cp src/nspluginwrapper/npplayer ../dist/bin/
|
||||||
|
fi
|
||||||
|
|
||||||
|
rsync -av ../sourcefiles/ ../dist
|
|
@ -0,0 +1,30 @@
|
||||||
|
bash
|
||||||
|
util-linux
|
||||||
|
coreutils
|
||||||
|
sed
|
||||||
|
grep
|
||||||
|
which
|
||||||
|
file
|
||||||
|
cmake
|
||||||
|
make
|
||||||
|
gcc
|
||||||
|
ragel
|
||||||
|
pkg-config
|
||||||
|
libglib-devel
|
||||||
|
alsa-lib-devel
|
||||||
|
libX11-devel
|
||||||
|
libXrandr-devel
|
||||||
|
libXrender-devel
|
||||||
|
libXcursor-devel
|
||||||
|
MesaLib-devel
|
||||||
|
libdrm-devel
|
||||||
|
libevent-devel
|
||||||
|
cairo-devel
|
||||||
|
pango-devel
|
||||||
|
freetype-devel
|
||||||
|
libressl-devel
|
||||||
|
icu-devel
|
||||||
|
libva-devel
|
||||||
|
gtk+-devel
|
||||||
|
libcurl-devel
|
||||||
|
libXt-devel
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit e608336b3e9382ceaa6888d122941baaaaa55e91
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit b98eea51e8d316916aaeca71ba4363494034907a
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,61 @@
|
||||||
|
alsa-lib
|
||||||
|
alsa-plugins-pulseaudio
|
||||||
|
atk
|
||||||
|
bc
|
||||||
|
bzip2
|
||||||
|
cairo
|
||||||
|
dbus-libs
|
||||||
|
expat
|
||||||
|
fontconfig
|
||||||
|
freetype
|
||||||
|
fribidi
|
||||||
|
gdk-pixbuf
|
||||||
|
glib
|
||||||
|
glibc
|
||||||
|
graphite
|
||||||
|
gtk+
|
||||||
|
icu-libs
|
||||||
|
libICE
|
||||||
|
libSM
|
||||||
|
libX11
|
||||||
|
libXau
|
||||||
|
libXcomposite
|
||||||
|
libXcursor
|
||||||
|
libXdamage
|
||||||
|
libXdmcp
|
||||||
|
libXext
|
||||||
|
libXfixes
|
||||||
|
libXi
|
||||||
|
libXinerama
|
||||||
|
libXrandr
|
||||||
|
libXrender
|
||||||
|
libXt
|
||||||
|
libasyncns
|
||||||
|
libblkid
|
||||||
|
libcrypto45
|
||||||
|
libcurl
|
||||||
|
libdatrie
|
||||||
|
libdrm
|
||||||
|
libevent
|
||||||
|
libffi
|
||||||
|
libflac
|
||||||
|
libgcc
|
||||||
|
libglvnd
|
||||||
|
libharfbuzz
|
||||||
|
libmount
|
||||||
|
libogg
|
||||||
|
libpcre
|
||||||
|
libpng
|
||||||
|
libpulseaudio
|
||||||
|
libsndfile
|
||||||
|
libssh2
|
||||||
|
libssl47
|
||||||
|
libstdc++
|
||||||
|
libthai
|
||||||
|
libuuid
|
||||||
|
libvorbis
|
||||||
|
libxcb
|
||||||
|
nghttp2
|
||||||
|
pango
|
||||||
|
pixman
|
||||||
|
zlib
|
|
@ -4,10 +4,13 @@ set -euo pipefail
|
||||||
dir=`dirname "$(readlink -f $0)"`
|
dir=`dirname "$(readlink -f $0)"`
|
||||||
|
|
||||||
if [ ! -x /lib/ld-linux-armhf.so.3 ] ; then
|
if [ ! -x /lib/ld-linux-armhf.so.3 ] ; then
|
||||||
echo "/lib/ld-linux-armhf.so.3 not found, installing..."
|
echo "/lib/ld-linux-armhf.so.3 not found, installing..."
|
||||||
sudo cp -v "$dir/lib/ld-linux-armhf.so.3" /lib/
|
set -x
|
||||||
|
sudo cp -v "$dir/lib/ld-linux-armhf.so.3" /lib/
|
||||||
|
set +x
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export LD_LIBRARY_PATH="$dir/lib"
|
||||||
export MOZ_PLUGIN_PATH="$dir/lib/plugins/"
|
export MOZ_PLUGIN_PATH="$dir/lib/plugins/"
|
||||||
export XDG_CONFIG_HOME="$dir/etc/"
|
export XDG_CONFIG_HOME="$dir/etc/"
|
||||||
if pactl stat &> /dev/null ; then
|
if pactl stat &> /dev/null ; then
|
||||||
|
@ -15,23 +18,28 @@ if pactl stat &> /dev/null ; then
|
||||||
fi
|
fi
|
||||||
cd "$dir"
|
cd "$dir"
|
||||||
|
|
||||||
game_swf="$dir/Anodyne_STANDALONE_1_506.swf"
|
game_swf=`ls -1 "$dir"/Anodyne*.swf | head -1`
|
||||||
game_savefile="$dir/etc/freshwrapper-data/Shockwave Flash/WritableRoot/#SharedObjects/ANODYNE1/#localWithNet/$game_swf/ANODYNE_SAVE_123.sol"
|
game_savefile="$dir/etc/freshwrapper-data/Shockwave Flash/WritableRoot/#SharedObjects/ANODYNE1/#localWithNet/$game_swf/ANODYNE_SAVE_123.sol"
|
||||||
|
|
||||||
if [[ "${1:-NaN}" =~ ^[1-9][0-9]*$ ]] ; then
|
if [[ "${1:-NaN}" =~ ^[1-9][0-9]*$ ]] ; then
|
||||||
scale="$1"
|
scale="$1"
|
||||||
elif [[ "${1:-NaN}" =~ ^-*[fF] ]] ; then
|
elif [[ "${1:-NaN}" =~ ^-*[fF] ]] ; then
|
||||||
display_height=$(xdpyinfo | grep -E '^ *dimensions:' | grep -Po '(?<=[0-9]x)[0-9]+(?= pixels)')
|
display_height=$(xdpyinfo | grep -E '^ *dimensions:' | grep -Po '(?<=[0-9]x)[0-9]+(?= pixels)')
|
||||||
scale=`echo "scale=10; $display_height/180" | bc`
|
scale=`echo "scale=10; $display_height/180" | $dir/bin/bc`
|
||||||
fs_param="--fullscreen"
|
fs_param="--fullscreen"
|
||||||
else
|
else
|
||||||
scale=$( (grep -Poa '(?<=scale_factor.).' "$game_savefile" | od -An -N1 -td1) || echo 3)
|
scale=$( (grep -Poa '(?<=scale_factor.).' "$game_savefile" | od -An -N1 -td1) || echo 3)
|
||||||
|
# default is x6 for some reason, which would make an obscenely large window
|
||||||
|
# after a player saved without touching the setting...
|
||||||
|
if [ "$scale" == 6 ] ; then
|
||||||
|
scale=3
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
width=`echo "($scale * 160)/1" | bc`
|
width=`echo "($scale * 160)/1" | $dir/bin/bc`
|
||||||
height=`echo "($scale * 180)/1" | bc`
|
height=`echo "($scale * 180)/1" | $dir/bin/bc`
|
||||||
device_scale=`echo "scale=10; sqrt($scale/3)" | bc`
|
device_scale=`echo "scale=10; sqrt($scale/3)" | $dir/bin/bc`
|
||||||
|
|
||||||
sed -i "s/^device_scale = .*/device_scale = $device_scale/" "$dir/etc/freshwrapper.conf"
|
sed -i "s/^device_scale = .*/device_scale = $device_scale/" "$dir/etc/freshwrapper.conf"
|
||||||
|
|
||||||
exec env LD_LIBRARY_PATH="$dir/lib" "$dir/bin/npplayer" ${fs_param:-} src="$game_swf" width="$width" height="$height" pepperflash_path="$dir/lib/plugins/libpepflashplayer.so"
|
exec "$dir/bin/npplayer" ${fs_param:-} src="$game_swf" width="$width" height="$height" pepperflash_path="$dir/lib/plugins/libpepflashplayer.so"
|
Loading…
Reference in New Issue