Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add commander #41

Open
wants to merge 3 commits into
base: opendingux
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ concurrency:
jobs:
build:
name: Build
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
container:
image: ghcr.io/opendingux/retro-toolchain/buildroot

Expand Down
1 change: 1 addition & 0 deletions board/opendingux/Config.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
menu "OpenDingux packages"

source "$BR2_EXTERNAL_OPENDINGUX_PATH/package/bennugd/Config.in"
source "$BR2_EXTERNAL_OPENDINGUX_PATH/package/commander/Config.in"
source "$BR2_EXTERNAL_OPENDINGUX_PATH/package/fonts-droid/Config.in"
source "$BR2_EXTERNAL_OPENDINGUX_PATH/package/gcwconnect/Config.in"
source "$BR2_EXTERNAL_OPENDINGUX_PATH/package/gl4es/Config.in"
Expand Down
20 changes: 20 additions & 0 deletions board/opendingux/package/commander/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
config BR2_PACKAGE_COMMANDER
bool "commander"
select BR2_PACKAGE_SDL
select BR2_PACKAGE_SDL_GFX
select BR2_PACKAGE_SDL_IMAGE
select BR2_PACKAGE_SDL_TTF
select BR2_PACKAGE_DEJAVU
select BR2_PACKAGE_FONTS_DROID
help
Two-pane file manager in the style of Norton Commander.

https://github.com/od-contrib/commander

if BR2_PACKAGE_COMMANDER

config BR2_PACKAGE_COMMANDER_PLATFORM
string "Target platform: for key bindings, default folder locations, and the manual"
default "gcw0"

endif
2 changes: 2 additions & 0 deletions board/opendingux/package/commander/commander.hash
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Locally calculated (fetched from Github)
sha256 c72910fb8c638ef2f5f448973e284815f5710938e6706c4b7ae805e7ba81ba14 commander-2022-11-01.tar.gz
60 changes: 60 additions & 0 deletions board/opendingux/package/commander/commander.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
################################################################################
#
# DinguxCommander
#
################################################################################

COMMANDER_VERSION = 2022-11-01
COMMANDER_SITE = $(call github,od-contrib,commander,$(COMMANDER_VERSION))
COMMANDER_DEPENDENCIES = sdl sdl_gfx sdl_image sdl_ttf dejavu fonts-droid

COMMANDER_RESOURCES_DIR = /usr/share/commander/
COMMANDER_PLATFORM=$(call qstrip,$(BR2_PACKAGE_COMMANDER_PLATFORM))

COMMANDER_CONF_OPTS += \
-DWITH_SYSTEM_SDL_GFX=ON -DWITH_SYSTEM_SDL_TTF=ON \
-DFONTS="{\"/usr/share/fonts/dejavu/DejaVuSansCondensed.ttf\",10},{\"/usr/share/fonts/truetype/droid/DroidSansFallback.ttf\",9}" \
-DLOW_DPI_FONTS="{RES_DIR\"Fiery_Turk.ttf\",8},{\"/usr/share/fonts/dejavu/DejaVuSansCondensed.ttf\",10},{\"/usr/share/fonts/truetype/droid/DroidSansFallback.ttf\",9}" \
-DFILE_SYSTEM=\"/dev/mmcblk0p2\" \
-DRES_DIR="\"$(COMMANDER_RESOURCES_DIR)\"" \
-DTARGET_PLATFORM=$(COMMANDER_PLATFORM)

define COMMANDER_INSTALL_TARGET_CMDS
mkdir -p $(TARGET_DIR)$(COMMANDER_RESOURCES_DIR)
$(INSTALL) -m 0644 $(@D)/res/Fiery_Turk.ttf \
$(TARGET_DIR)$(COMMANDER_RESOURCES_DIR)
$(INSTALL) -m 0644 $(@D)/res/*.png \
$(TARGET_DIR)$(COMMANDER_RESOURCES_DIR)
$(INSTALL) -m 0644 $(@D)/opkg/readme.$(COMMANDER_PLATFORM).txt \
$(TARGET_DIR)$(COMMANDER_RESOURCES_DIR)readme.txt
endef

define COMMANDER_INSTALL_DEFAULT
$(INSTALL) -m 0755 -D $(COMMANDER_BUILDDIR)commander \
$(TARGET_DIR)/usr/bin/commander
endef

define COMMANDER_INSTALL_RS90_RG99
$(INSTALL) -m 0755 -D $(COMMANDER_BUILDDIR)commander \
$(TARGET_DIR)/usr/libexec/commander
$(INSTALL) -m 0755 -D $(BR2_EXTERNAL_OPENDINGUX_PATH)/package/commander/commander.sh \
$(TARGET_DIR)/usr/bin/commander
$(INSTALL) -m 0644 $(@D)/opkg/commander.rg99.cfg \
$(TARGET_DIR)$(COMMANDER_RESOURCES_DIR)
endef

ifeq ($(COMMANDER_PLATFORM),rs90)
COMMANDER_POST_INSTALL_TARGET_HOOKS += COMMANDER_INSTALL_RS90_RG99
else
COMMANDER_POST_INSTALL_TARGET_HOOKS += COMMANDER_INSTALL_DEFAULT
endif

ifeq ($(BR2_PACKAGE_GMENU2X),y)
define COMMANDER_INSTALL_TARGET_GMENU2X
$(INSTALL) -m 0644 -D $(BR2_EXTERNAL_OPENDINGUX_PATH)/package/commander/gmenu2x \
$(TARGET_DIR)/usr/share/gmenu2x/sections/applications/25_commander
endef
COMMANDER_POST_INSTALL_TARGET_HOOKS += COMMANDER_INSTALL_TARGET_GMENU2X
endif

$(eval $(cmake-package))
10 changes: 10 additions & 0 deletions board/opendingux/package/commander/commander.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

IFS= read -r -d $'\0' MODEL </sys/firmware/devicetree/base/compatible
case $MODEL in
rg99)
exec /usr/libexec/commander --config-prelude /usr/share/commander/commander.rg99.cfg
;;
*)
exec /usr/libexec/commander
esac
5 changes: 5 additions & 0 deletions board/opendingux/package/commander/gmenu2x
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
title=Commander
description=Two-pane file manager
exec=/usr/bin/commander
icon=skin:icons/dinguxcmdr.png
manual=/usr/share/commander/readme.txt
2 changes: 2 additions & 0 deletions configs/od_gcw0_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ BR2_PACKAGE_LIBOPK=y
BR2_PACKAGE_LIBPNG14=y
BR2_PACKAGE_LIBSHAKE=y
BR2_PACKAGE_LIBXDGMIME=y
BR2_PACKAGE_COMMANDER=y
BR2_PACKAGE_COMMANDER_PLATFORM="gcw0"
BR2_PACKAGE_LOVE2D=y
BR2_PACKAGE_MININIT=y
BR2_PACKAGE_OD_PASSWD_CONFIG=y
Expand Down
2 changes: 2 additions & 0 deletions configs/od_lepus_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ BR2_TARGET_ROOTFS_SQUASHFS4_ZSTD=y
# BR2_TARGET_ROOTFS_TAR is not set
BR2_PACKAGE_HOST_MKPASSWD=y
BR2_PACKAGE_BENNUGD=y
BR2_PACKAGE_COMMANDER=y
BR2_PACKAGE_COMMANDER_PLATFORM="lepus"
BR2_PACKAGE_GMENU2X=y
BR2_PACKAGE_GMENU2X_SHOW_CLOCK=y
BR2_PACKAGE_GMENU2X_CPUFREQ=y
Expand Down
2 changes: 2 additions & 0 deletions configs/od_rs90_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ BR2_PACKAGE_NANO=y
BR2_TARGET_ROOTFS_SQUASHFS=y
# BR2_TARGET_ROOTFS_TAR is not set
BR2_PACKAGE_HOST_MKPASSWD=y
BR2_PACKAGE_COMMANDER=y
BR2_PACKAGE_COMMANDER_PLATFORM="rs90"
BR2_PACKAGE_GMENU2X=y
BR2_PACKAGE_GMENU2X_CPUFREQ=y
BR2_PACKAGE_KMSGRAB=y
Expand Down