63 lines
1.4 KiB
Bash
Executable File
63 lines
1.4 KiB
Bash
Executable File
#!/bin/sh
|
|
# This mechanism is fairly unreliable, but it is the only "okay" way currently :/
|
|
# realpath is also not part of any POSIX standard
|
|
|
|
cd $(dirname $(realpath "$0"))
|
|
if test $? -eq 1; then
|
|
alert --stop "cant figure out where this script is" "Ill adjust it!"
|
|
exit
|
|
fi
|
|
|
|
uname=`uname -o`
|
|
if test "$uname" = "Haiku"
|
|
then
|
|
if test ! -L fonts/font.ttf
|
|
then
|
|
mkdir fonts/
|
|
ln -s /system/data/fonts/ttfonts/NotoSans-Regular.ttf fonts/font.ttf
|
|
fi
|
|
else
|
|
if test ! -L fonts/font.ttf
|
|
then
|
|
alert --info "Don't know this OS, so don't know the fonts!
|
|
Please symlink a font to fonts/font.ttf!
|
|
(This is normally NotoSans-Regular.ttf)
|
|
|
|
Falling back to love2d default font." Okay
|
|
fi
|
|
fi
|
|
if test "$uname" = "Haiku"; then
|
|
if test $(getarch) = "x86_gcc2"; then
|
|
if command -v love-x86; then
|
|
love-x86 .
|
|
else
|
|
if alert --stop "Could not find love2d!" "Install love2d" "Exit"; then
|
|
if pkgman install -y love_x86; then
|
|
love-x86 .
|
|
else
|
|
alert --stop "Unable to install love2d!" "Exit"
|
|
fi
|
|
fi
|
|
fi
|
|
else
|
|
if command -v love; then
|
|
love .
|
|
else
|
|
if alert --stop "Could not find love2d!" "Install love2d" "Exit"; then
|
|
if pkgman install -y cmd:love; then
|
|
love .
|
|
else
|
|
alert --stop "Unable to install love2d!" "Exit"
|
|
fi
|
|
fi
|
|
fi
|
|
fi
|
|
else
|
|
#other sh providing OS, not known what package manager
|
|
if command -v love; then
|
|
love .
|
|
else
|
|
alert --stop "Could not find the love executable!" "Damn"
|
|
fi
|
|
fi
|