Files
Arch-R/projects/ArchR/packages/ui/emulationstation/package.mk
T
Douglas Teles d06e18a2ad gaps: ampla varredura de bugs herdados + pré-pacman repo-stable
A varredura via SSH no R36S rodando a 20260624 expôs várias
divergências entre rootfs estagiado e tmpfs/runtime. Cada arquivo
deste commit resolve um gap encontrado na investigação.

archr/tmpfiles.d/z_02_archr-fhs-bridges.conf (NEW):
  /var é tmpfs (busybox/system.d/var.mount), então todos os bridges
  FHS instalados como symlinks no rootfs eram apagados pelo mount.
  Republicar a estrutura via systemd-tmpfiles após var.mount. Resolve
  /var/lib/pacman, /var/cache/archr/*, /var/lib/archr/{config,data,
  games,backup}, /var/lib/{samba/private,tailscale,bluetooth},
  /var/spool/cron, /var/cache/pacman/pkg. Inclui também os targets em
  /storage (cron, locpath, tailscale, samba, .local/share, fstrim.run,
  journald.conf.d, request-key.d) que estavam ausentes.

ui/emulationstation/package.mk:
  ln -sf usava \${INSTALL}/usr/config/... como alvo, vazando o caminho
  absoluto do builder para o symlink /etc/emulationstation/es_systems.cfg
  no SO final. Trocar pelo path do target.

archr/system.d/timers.target.wants/{rocknix→archr}-report-stats.timer:
  Symlink apontava para um arquivo inexistente (rocknix-report-stats);
  o timer real chama-se archr-report-stats. Renome.

misc/modules/sources/images/install-{rocknix→archr}.svg:
  gamelist.xml já referenciava install-archr.svg; o arquivo se chamava
  install-rocknix.svg, quebrando o asset.

emulators/.../gamepads/ROCKNIX→ArchR Gamepad.cfg:
  Conteúdo já estava com input_device="ArchR Gamepad"; rename casa o
  nome de arquivo com a string de matching.

archr/package.mk + profile.d/005-locale:
  LANG="" no SO rodando, todas LC_*=POSIX. glibc gera en_US.UTF-8.
  Criar /etc/locale.conf e profile.d que source-a para shells de login
  e SSH (que não herdam LANG via systemd env).

sysutils/systemd/scripts/userconfig-setup + freej2me-lr/freej2me.sh:
  /storage/jdk caiu como arquivo vazio em algumas builds antigas e
  transforma o symlink /opt/jdk em "Not a directory". Saneamento
  duplo: a cada boot e antes do download do JDK.

devel/crossguid/package.mk + standalone/hypseus-singe/package.mk:
  cmake_install.cmake / crossguid-config.cmake embutiam o BUILD path
  do host. Remover dos pacotes target (não rodam em runtime).

tools/pyFDT/package.mk + network/samba/package.mk:
  setuptools e waf escrevem o python3 do TOOLCHAIN no shebang dos
  entry-points (pydtc, samba-gpupdate). Reescrever pra /usr/bin/python3.

sysutils/systemd/package.mk:
  systemd-sysroot-fstab-check é um symlink para
  systemd-fstab-generator, que removemos para fora dos generators.
  Apagar o link junto. Strip também a regra do legacy.conf que cria
  /var/log/README apontando para /usr/share/doc (não embarcamos docs).

sysutils/udevil/package.mk:
  /etc/udevil/udevil-user-root.conf é symlink para
  /storage/.config/udevil.conf que nunca era populado. Copiar a conf
  também para /usr/config/udevil.conf, daí o rsync do userconfig-setup
  o semeia no primeiro boot.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-24 02:44:45 -03:00

134 lines
4.6 KiB
Makefile

# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2026 ArchR (https://github.com/archr-linux/Arch-R)
PKG_NAME="emulationstation"
PKG_VERSION="563e1057f944ddf0eb7b295831d2d09f0a8cdb6f"
PKG_GIT_CLONE_BRANCH="master"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/archr-linux/emulationstation-next"
PKG_URL="${PKG_SITE}.git"
PKG_DEPENDS_TARGET="boost toolchain SDL2 freetype curl freeimage bash rapidjson SDL2_mixer fping p7zip alsa vlc drm_tool pugixml"
PKG_NEED_UNPACK="busybox"
PKG_LONGDESC="Emulationstation emulator frontend"
PKG_BUILD_FLAGS="-gold"
GET_HANDLER_SUPPORT="git"
PKG_PATCH_DIRS+="${DEVICE}"
if [ ! "${OPENGL}" = "no" ]; then
PKG_DEPENDS_TARGET+=" ${OPENGL} glu"
PKG_CMAKE_OPTS_TARGET+=" -DGL=1"
fi
if [ ! "${OPENGLES_SUPPORT}" = no ]; then
PKG_DEPENDS_TARGET+=" ${OPENGLES}"
PKG_CMAKE_OPTS_TARGET+=" -DGLES2=1"
fi
PKG_CMAKE_OPTS_TARGET+=" -DARCHR=1 \
-DDISABLE_KODI=1 \
-DENABLE_FILEMANAGER=0 \
-DCEC=0 \
-DENABLE_PULSE=1 \
-DUSE_SYSTEM_PUGIXML=1 \
-DIntl_INCLUDE_DIR=${SYSROOT_PREFIX}/usr/include \
-DIntl_IS_BUILT_IN=TRUE \
-DCMAKE_CXX_FLAGS=-DHAVE_INTL"
pre_configure_target() {
for key in SCREENSCRAPER_DEV_LOGIN \
GAMESDB_APIKEY \
CHEEVOS_DEV_LOGIN
do
if [ -z "${!key}" ]
then
echo "WARNING: ${key} not declared, will not build support."
else
echo "USING: ${key} = ${!key}"
fi
done
export DEVICE=$(echo ${DEVICE^^} | sed "s#-#_##g")
}
makeinstall_target() {
mkdir -p ${INSTALL}/usr/config/locale
cp -rf ${PKG_BUILD}/locale/lang/* ${INSTALL}/usr/config/locale/
# Pre-generate default (en_US.UTF-8) locale for lower-end devices to speed up first boot
# This saves a minute or two on RK3326 in a cost of about 1 MB of SYSTEM size
# Copy-paste of a locale generating part of es_settings script
I18NPATH=$(get_install_dir glibc)/usr/share/i18n/locales/ \
localedef --force --verbose --inputfile=en_US --charmap=UTF-8 \
${INSTALL}/usr/config/locale/en_US.UTF-8 || true
mkdir -p ${INSTALL}/usr/config/emulationstation/resources
cp -rf ${PKG_BUILD}/resources/* ${INSTALL}/usr/config/emulationstation/resources/
rm -rf ${INSTALL}/usr/config/emulationstation/resources/logo.png
mkdir -p ${INSTALL}/usr/bin
cp ${PKG_BUILD}/es_settings ${INSTALL}/usr/bin
chmod 0755 ${INSTALL}/usr/bin/es_settings
cp ${PKG_BUILD}/start_es.sh ${INSTALL}/usr/bin
chmod 0755 ${INSTALL}/usr/bin/start_es.sh
cp ${PKG_BUILD}/serial_number_check ${INSTALL}/usr/bin
chmod 0755 ${INSTALL}/usr/bin/serial_number_check
mkdir -p ${INSTALL}/usr/bin
#ln -sf /storage/.config/emulationstation/resources ${INSTALL}/usr/bin/resources
cp -rf ${PKG_BUILD}/emulationstation ${INSTALL}/usr/bin
mkdir -p ${INSTALL}/etc/emulationstation/
ln -sf /storage/.config/emulationstation/themes ${INSTALL}/etc/emulationstation/
cp -rf ${PKG_DIR}/config/common/*.cfg ${INSTALL}/usr/config/emulationstation
# If we're not an emulation device, ES may still be installed so we need a default config.
if [ "${EMULATION_DEVICE}" = "no" ] || \
[ "${BASE_ONLY}" = "true" ]
then
cat <<EOF >${INSTALL}/usr/config/emulationstation/es_systems.cfg
<?xml version="1.0" encoding="UTF-8"?>
<systemList>
<system>
<name>tools</name>
<fullname>Tools</fullname>
<manufacturer>ArchR</manufacturer>
<release>2024</release>
<hardware>system</hardware>
<path>/storage/.config/modules</path>
<extension>.sh</extension>
<command>%ROM%</command>
<platform>tools</platform>
<theme>tools</theme>
</system>
</systemList>
EOF
fi
# Symlink target must be an in-target path (/usr/config/...), not the
# host's ${INSTALL} build dir, otherwise the staged symlink points to
# the builder's filesystem and breaks on the device.
ln -sf /usr/config/emulationstation/es_systems.cfg ${INSTALL}/etc/emulationstation/es_systems.cfg
ln -sf /storage/.cache/system_timezone ${INSTALL}/etc/timezone
#Delete all vulkan options from es_features when vulkan is not present
if [ ! "${VULKAN_SUPPORT}" = "yes" ]
then
sed -i '/vulkan/d' ${INSTALL}/usr/config/emulationstation/es_features.cfg
fi
}
post_install() {
mkdir -p ${INSTALL}/usr/share
ln -sf /storage/.config/locale ${INSTALL}/usr/share/locale
mkdir -p ${INSTALL}/usr/lib
ln -sf /usr/share/locale ${INSTALL}/usr/lib/locale
ln -sf /usr/share/locale ${INSTALL}/usr/config/emulationstation/locale
}