distribution/packages/jelos/package.mk

165 lines
6.1 KiB
Makefile
Raw Normal View History

2022-02-05 14:23:32 +00:00
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2020-present Fewtarius
PKG_NAME="jelos"
PKG_VERSION="$(date +%Y%m%d)"
2022-02-05 14:23:32 +00:00
PKG_ARCH="any"
2022-02-09 01:27:20 +00:00
PKG_LICENSE="apache2"
2022-02-05 14:23:32 +00:00
PKG_SITE=""
PKG_URL=""
PKG_DEPENDS_TARGET="toolchain ${OPENGLES}"
PKG_SHORTDESC="JELOS Meta Package"
PKG_LONGDESC="JELOS Meta Package"
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
PKG_TOOLCHAIN="make"
2022-06-07 23:00:45 +00:00
PKG_BASEOS="plymouth-lite grep wget libjpeg-turbo util-linux xmlstarlet bluetool gnupg gzip patchelf \
imagemagick terminus-font vim bash pyudev dialog six git dbus-python coreutils miniupnpc \
2022-05-27 22:33:28 +00:00
nss-mdns avahi alsa-ucm-conf MC fbgrab modules"
2022-02-05 14:23:32 +00:00
PKG_UI="emulationstation"
PKG_EMUS="common-shaders glsl-shaders libretro-database retroarch hatarisa openbor \
scummvmsa PPSSPPSDL yabasanshiroSA vicesa mupen64plussa-audio-sdl \
mupen64plussa-input-sdl mupen64plussa-ui-console mupen64plussa-video-rice \
2022-03-30 13:44:03 +00:00
mupen64plussa-core mupen64plussa-rsp-hle mupen64plussa-video-glide64mk2 \
2022-05-13 12:33:30 +00:00
lzdoom gzdoom ecwolf amiberry raze pico-8 flycastsa hypseus-singe \
2022-05-26 22:14:52 +00:00
core-info moonlight"
2022-02-05 14:23:32 +00:00
2022-03-20 13:43:23 +00:00
LIBRETRO_CORES="2048 81 a5200 atari800 beetle-gba beetle-lynx beetle-ngp beetle-pce beetle-pcfx \
beetle-supafaust beetle-supergrafx beetle-vb beetle-wswan bluemsx cannonball cap32 \
crocods daphne dinothawr dosbox-svn dosbox-pure duckstation easyrpg fbalpha2012 \
fbalpha2019 fbneo fceumm fmsx flycast flycast_libretro freechaf freeintv \
freej2me fuse-libretro gambatte gearboy gearcoleco gearsystem genesis-plus-gx \
genesis-plus-gx-wide gme gpsp gw-libretro handy hatari mame2000 mame2003-plus \
2022-06-07 23:00:45 +00:00
mame2010 mame2015 mame melonds meowpc98 mgba mrboom mupen64plus mupen64plus-nx \
neocd_libretro nestopia np2kai nxengine o2em opera parallel-n64_rice \
parallel-n64_gln64 parallel-n64_glide64 pcsx_rearmed picodrive pokemini potator \
ppsspp prboom prosystem puae px68k quasi88 quicknes race reminiscence sameboy \
sameduck scummvm smsplus-gx snes9x snes9x2002 snes9x2005_plus snes9x2010 stella \
stella-2014 swanstation TIC-80 tgbdual tyrquake xrick uae4arm uzem vba-next vbam \
2022-05-25 14:58:27 +00:00
vecx vice yabasanshiro xmil mesen virtualjaguar"
2022-02-05 14:23:32 +00:00
2022-02-09 01:27:20 +00:00
PKG_COMPAT="lib32"
2022-02-08 11:44:54 +00:00
2022-05-27 22:33:28 +00:00
PKG_TOOLS="i2c-tools"
2022-02-09 01:27:20 +00:00
PKG_MULTIMEDIA="ffmpeg mpv vlc"
2022-02-05 14:23:32 +00:00
2022-02-09 01:27:20 +00:00
PKG_GAMESUPPORT="sixaxis jslisten evtest rg351p-js2xbox gptokeyb textviewer 351files jstest-sdl \
gamecontrollerdb jelosaddons libgo2 rclone sdljoytest"
2022-02-05 14:23:32 +00:00
PKG_EXPERIMENTAL=""
### Project/Device specific items
if [ "${PROJECT}" == "Rockchip" ]
then
PKG_BASEOS+=" system-utils"
PKG_EMUS+=" retropie-shaders"
fi
2022-02-10 00:43:47 +00:00
if [ ! -z "${BASE_ONLY}" ]
then
2022-05-27 22:33:28 +00:00
PKG_DEPENDS_TARGET+=" ${PKG_BASEOS} ${PKG_TOOLS} ${PKG_UI} ${PKG_GAMESUPPORT}"
2022-02-10 00:43:47 +00:00
else
2022-05-27 22:33:28 +00:00
PKG_DEPENDS_TARGET+=" ${PKG_BASEOS} ${PKG_TOOLS} ${PKG_UI} ${PKG_EMUS} ${LIBRETRO_CORES} ${PKG_COMPAT} ${PKG_MULTIMEDIA} ${PKG_GAMESUPPORT} ${PKG_EXPERIMENTAL}"
2022-02-10 00:43:47 +00:00
fi
2022-02-05 14:23:32 +00:00
make_target() {
:
}
makeinstall_target() {
mkdir -p ${INSTALL}/usr/config/
rsync -av ${PKG_DIR}/config/* ${INSTALL}/usr/config/
ln -sf /storage/.config/system ${INSTALL}/system
find ${INSTALL}/usr/config/system/ -type f -exec chmod o+x {} \;
2022-02-05 14:23:32 +00:00
mkdir -p ${INSTALL}/usr/bin/
## Compatibility links for ports
ln -s /storage/roms ${INSTALL}/roms
ln -sf /storage/roms/opt ${INSTALL}/opt
### Add some quality of life customizations for hardworking devs.
if [ -n "${JELOS_SSH_KEYS_FILE}" ]; then
mkdir -p ${INSTALL}/usr/config/ssh
cp ${JELOS_SSH_KEYS_FILE} ${INSTALL}/usr/config/ssh/authorized_keys
fi
if [ -n "${JELOS_WIFI_SSID}" ]; then
sed -i "s#wifi.enabled=0#wifi.enabled=1#g" ${INSTALL}/usr/config/system/configs/system.cfg
cat <<EOF >> ${INSTALL}/usr/config/system/configs/system.cfg
wifi.ssid=${JELOS_WIFI_SSID}
wifi.key=${JELOS_WIFI_KEY}
EOF
fi
2022-02-05 14:23:32 +00:00
}
post_install() {
ln -sf jelos.target ${INSTALL}/usr/lib/systemd/system/default.target
mkdir -p ${INSTALL}/etc/profile.d
cp ${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/device.config ${INSTALL}/etc/profile.d/01-deviceconfig
# Split this up into other packages
cp ${PKG_DIR}/sources/autostart/autostart ${INSTALL}/usr/bin
mkdir -p ${INSTALL}/usr/lib/autostart/common
mkdir -p ${INSTALL}/usr/lib/autostart/daemons
cp ${PKG_DIR}/sources/autostart/common/* ${INSTALL}/usr/lib/autostart/common
cp ${PKG_DIR}/sources/autostart/daemons/* ${INSTALL}/usr/lib/autostart/daemons
2022-02-10 11:37:23 +00:00
if [ -d "${PKG_DIR}/sources/autostart/${DEVICE}" ]
then
mkdir -p ${INSTALL}/usr/lib/autostart/${DEVICE}
cp ${PKG_DIR}/sources/autostart/${DEVICE}/* ${INSTALL}/usr/lib/autostart/${DEVICE}
fi
2022-02-05 14:23:32 +00:00
chmod -R 0755 ${INSTALL}/usr/lib/autostart ${INSTALL}/usr/bin/autostart
enable_service jelos-autostart.service
if [ ! -d "${INSTALL}/usr/share" ]
then
mkdir "${INSTALL}/usr/share"
fi
cp ${PKG_DIR}/sources/post-update ${INSTALL}/usr/share
chmod 755 ${INSTALL}/usr/share/post-update
2022-02-05 14:23:32 +00:00
# Issue banner
cp ${PKG_DIR}/sources/issue ${INSTALL}/etc
ln -s /etc/issue ${INSTALL}/etc/motd
cat <<EOF >> ${INSTALL}/etc/issue
==> Build Date: ${BUILD_DATE}
==> Version: ${OS_VERSION}
2022-04-14 11:56:57 +00:00
2022-02-05 14:23:32 +00:00
EOF
cp ${PKG_DIR}/sources/scripts/* ${INSTALL}/usr/bin
2022-02-10 21:39:12 +00:00
if [ -d "${PKG_DIR}/sources/asound/${DEVICE}" ]
then
cp ${PKG_DIR}/sources/asound/${DEVICE}/* ${INSTALL}/usr/config/
2022-02-05 14:23:32 +00:00
fi
sed -i "s#@DEVICENAME@#${DEVICE}#g" ${INSTALL}/usr/config/system/configs/system.cfg
if [[ "${DEVICE}" =~ RG351P ]]
then
sed -i "s#.integerscale=1#.integerscale=0#g" ${INSTALL}/usr/config/system/configs/system.cfg
2022-03-29 02:35:27 +00:00
sed -i "s#.rgascale=0#.rgascale=1#g" ${INSTALL}/usr/config/system/configs/system.cfg
2022-03-27 02:47:04 +00:00
sed -i "s#audio.volume=.*\$#audio.volume=100#g" ${INSTALL}/usr/config/system/configs/system.cfg
fi
2022-04-14 11:03:39 +00:00
if [[ "${DEVICE}" =~ RG503 ]]
then
sed -i "s#.integerscale=1#.integerscale=0#g" ${INSTALL}/usr/config/system/configs/system.cfg
fi
2022-04-14 11:03:39 +00:00
### Defaults for non-main builds.
BUILD_BRANCH="$(git branch --show-current)"
if [[ ! "${BUILD_BRANCH}" =~ main ]]
then
sed -i "s#ssh.enabled=0#ssh.enabled=1#g" ${INSTALL}/usr/config/system/configs/system.cfg
fi
2022-02-05 14:23:32 +00:00
}