distribution/packages/jelos/package.mk

131 lines
3.4 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"
2022-02-05 14:23:32 +00:00
PKG_SHORTDESC="JELOS Meta Package"
PKG_LONGDESC="JELOS Meta Package"
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
PKG_TOOLCHAIN="make"
2023-03-04 16:20:58 +00:00
PKG_BASEOS="plymouth-lite grep wget util-linux xmlstarlet bluetool gnupg gzip patchelf imagemagick \
terminus-font vim bash pyudev dialog six git dbus-python coreutils miniupnpc nss-mdns \
avahi alsa-ucm-conf fbgrab modules system-utils autostart powerstate powertop ectool"
PKG_UI="emulationstation es-themes"
PKG_SOFTWARE=""
2022-02-05 14:23:32 +00:00
2023-03-05 01:50:26 +00:00
PKG_COMPAT="lib32"
2022-02-08 11:44:54 +00:00
2023-01-08 22:49:32 +00:00
PKG_MULTIMEDIA="ffmpeg vlc"
2023-01-08 22:49:32 +00:00
### Splitting out MPV
2022-10-17 21:39:43 +00:00
case "${DEVICE}" in
handheld)
2023-01-08 22:49:32 +00:00
PKG_MULTIMEDIA="mpv"
2022-10-17 21:39:43 +00:00
;;
esac
PKG_TOOLS="i2c-tools synctools jslisten evtest tailscale pygobject fileman"
2023-01-08 22:49:32 +00:00
### Project specific variables
case "${PROJECT}" in
PC)
PKG_BASEOS+=" installer"
;;
*)
PKG_EMUS+=" retropie-shaders"
;;
esac
if [ ! "${OPENGL}" = "no" ]; then
2023-03-01 22:14:52 +00:00
PKG_DEPENDS_TARGET+=" mesa-demos glmark2"
fi
2022-02-10 00:43:47 +00:00
if [ ! -z "${BASE_ONLY}" ]
then
PKG_DEPENDS_TARGET+=" ${PKG_BASEOS} ${PKG_TOOLS} ${PKG_UI}"
2022-02-10 00:43:47 +00:00
else
PKG_DEPENDS_TARGET+=" ${PKG_BASEOS} ${PKG_TOOLS} ${PKG_UI} ${PKG_COMPAT} ${PKG_MULTIMEDIA} ${PKG_SOFTWARE}"
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 "${LOCAL_SSH_KEYS_FILE}" ]; then
mkdir -p ${INSTALL}/usr/config/ssh
cp ${LOCAL_SSH_KEYS_FILE} ${INSTALL}/usr/config/ssh/authorized_keys
fi
if [ -n "${LOCAL_WIFI_SSID}" ]; then
sed -i "s#network.enabled=0#network.enabled=1#g" ${INSTALL}/usr/config/system/configs/system.cfg
cat <<EOF >> ${INSTALL}/usr/config/system/configs/system.cfg
wifi.ssid=${LOCAL_WIFI_SSID}
wifi.key=${LOCAL_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
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-12-07 05:15:00 +00:00
chmod 0755 ${INSTALL}/usr/bin/* ||:
enable_service jelos-automount.service
2022-02-10 21:39:12 +00:00
### Fix and migrate to autostart package
enable_service jelos-autostart.service
sed -i "s#@DEVICENAME@#${DEVICE}#g" ${INSTALL}/usr/config/system/configs/system.cfg
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
2023-03-08 17:34:56 +00:00
sed -i "s#network.enabled=0#network.enabled=1#g" ${INSTALL}/usr/config/system/configs/system.cfg
2022-04-14 11:03:39 +00:00
fi
2022-02-05 14:23:32 +00:00
}