2022-02-05 14:23:32 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
# Copyright (C) 2021-present Shanti Gilbert (https://github.com/shantigilbert)
|
|
|
|
|
|
|
|
PKG_NAME="textviewer"
|
2023-03-14 21:59:38 +00:00
|
|
|
PKG_VERSION="a01d9c23db92b0757b3e9b1ff11e040337d945c3"
|
2022-02-05 14:23:32 +00:00
|
|
|
PKG_LICENSE="MIT"
|
|
|
|
PKG_SITE="https://github.com/lethal-guitar/TvTextViewer"
|
2023-02-24 13:53:43 +00:00
|
|
|
PKG_URL="${PKG_SITE}.git"
|
2023-09-04 16:18:14 +00:00
|
|
|
PKG_DEPENDS_TARGET="toolchain dos2unix:host SDL2"
|
2022-02-05 14:23:32 +00:00
|
|
|
PKG_SHORTDESC="Full-screen text viewer tool with gamepad controls"
|
|
|
|
PKG_TOOLCHAIN="make"
|
|
|
|
GET_HANDLER_SUPPORT="git"
|
|
|
|
|
2022-07-11 12:08:11 +00:00
|
|
|
if [ ! "${OPENGL}" = "no" ]; then
|
2022-08-27 20:22:17 +00:00
|
|
|
PKG_DEPENDS_TARGET+=" ${OPENGL} glu"
|
2022-07-11 12:08:11 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${OPENGLES_SUPPORT}" = yes ]; then
|
|
|
|
PKG_DEPENDS_TARGET+=" ${OPENGLES}"
|
|
|
|
fi
|
|
|
|
|
2022-02-05 14:23:32 +00:00
|
|
|
pre_patch() {
|
2023-09-04 16:18:14 +00:00
|
|
|
find $(echo "${PKG_BUILD}" | cut -f1 -d\ ) -type f -exec ${TOOLCHAIN}/bin/dos2unix -q {} \;
|
2022-02-05 14:23:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pre_configure_target() {
|
2022-02-12 03:47:34 +00:00
|
|
|
sed -i "s|sdl2-config|${SYSROOT_PREFIX}/usr/bin/sdl2-config|g" Makefile
|
2022-02-05 14:23:32 +00:00
|
|
|
sed -i 's|ImGui::SetNextWindowFocus();|ImGui::SetFocusID(ImGui::GetID("Close"), ImGui::GetCurrentWindow());\n ImGui::GetCurrentContext()->NavDisableHighlight = false;\n ImGui::GetCurrentContext()->NavDisableMouseHover = true;|g' view.cpp
|
|
|
|
sed -i 's|ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(ImColor(94, 11, 22, 255))); // Set window background to red|ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(ImColor(100, 0, 0, 255)));\n ImGui::PushStyleColor(ImGuiCol_NavHighlight, ImVec4(ImColor(180, 0, 0, 255)));\n ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(ImColor(180, 0, 0, 255)));|g' main.cpp
|
|
|
|
sed -i 's|ImColor(94, 11, 22,|ImColor(180, 0, 0,|g' main.cpp
|
|
|
|
sed -i 's|BUTTON_START|BUTTON_INVALID|g' main.cpp
|
|
|
|
}
|
|
|
|
|
|
|
|
makeinstall_target(){
|
2023-02-24 13:53:43 +00:00
|
|
|
mkdir -p ${INSTALL}/usr/bin
|
|
|
|
cp text_viewer ${INSTALL}/usr/bin
|
2022-02-05 14:23:32 +00:00
|
|
|
}
|