Skip to content
Open
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
108 changes: 108 additions & 0 deletions utils/fastfetch/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=fastfetch
PKG_VERSION:=2.67.1
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/fastfetch-cli/fastfetch/tar.gz/$(PKG_VERSION)?
PKG_HASH:=52489550d1fdeac8bde8b3442064e3bc78d28fda752a171dc46a6cd97454f237

PKG_MAINTAINER:=Valeriy Kosikhin <vkosikhin@gmail.com>
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
PKG_CPE_ID:=cpe:/a:fastfetch-cli:fastfetch

PKG_BUILD_DEPENDS:=elfutils

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ENABLE_ELF is left at its upstream default ON — cmake_dependent_option(ENABLE_ELF "Enable libelf" ON "LINUX OR ANDROID OR DragonFly OR Haiku OR GNU" OFF) in fastfetch 2.67.1 CMakeLists.txt — which is why elfutils is needed here. But the package declares no DEPENDS, so libelf is not on the device after install.

If libelf were linked directly, packaging would fail: CheckDependencies in include/package-pack.mk:271-290 rejects any NEEDED library not covered by a declared dependency, and the build is clean. So fastfetch is dlopen-ing libelf at runtime, meaning the ELF code path is compiled in but can never activate on a stock install.

Given how aggressively the rest of this Makefile trims features for size, is keeping it intentional? Either -DENABLE_ELF=OFF (and then PKG_BUILD_DEPENDS:=elfutils can go too) or DEPENDS:=+libelf would make the two ends agree.


Generated by Claude Code


include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk

define Package/fastfetch
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Neofetch-like system information tool
URL:=https://github.com/fastfetch-cli/fastfetch/
endef

define Package/fastfetch/description
Fastfetch is a Neofetch-like tool for fetching system information
and displaying it in a visually-appealing way.
endef

TARGET_CFLAGS += -fno-unwind-tables -fno-asynchronous-unwind-tables
TARGET_LDFLAGS += -Wl,--strip-all

CMAKE_OPTIONS += \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DBUILD_FLASHFETCH=OFF \
-DBUILD_TESTS=OFF \
-DIS_MUSL=ON \
-DSET_TWEAK=OFF \
-DENABLE_VULKAN=OFF \
-DENABLE_WAYLAND=OFF \
-DENABLE_XCB_RANDR=OFF \
-DENABLE_XRANDR=OFF \
-DENABLE_DRM=OFF \
-DENABLE_VADRM=OFF \
-DENABLE_VAX11=OFF \
-DENABLE_VDPAU=OFF \
-DENABLE_GIO=OFF \
-DENABLE_DCONF=OFF \
-DENABLE_EET=OFF \
-DENABLE_DBUS=OFF \
-DENABLE_SQLITE3=OFF \
-DENABLE_RPM=OFF \
-DENABLE_IMAGEMAGICK7=OFF \
-DENABLE_IMAGEMAGICK6=OFF \
-DENABLE_CHAFA=OFF \
-DENABLE_EGL=OFF \
-DENABLE_GLX=OFF \
-DENABLE_OPENCL=OFF \
-DENABLE_PULSE=OFF \
-DENABLE_DDCUTIL=OFF \
-DENABLE_ZLIB=OFF \
-DENABLE_QUICKJS=OFF \
-DENABLE_LIBZFS=OFF \
-DENABLE_WCWIDTH=OFF \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: ENABLE_LUA is the one optional-library switch left at its upstream default — option(ENABLE_LUA "Enable lua scripting for format strings" ON) in fastfetch 2.67.1 CMakeLists.txt — while every other optional library in this block is explicitly turned off.

That leaves the result dependent on what happens to be in staging: OpenWrt core's lua package installs lua.pc into the staging pkgconfig dir, so a buildroot that has already built lua produces a different (larger) fastfetch than one that hasn't. Deliberate, or should it get -DENABLE_LUA=OFF alongside the rest?


Generated by Claude Code

-DMODULE_DISABLE_BLUETOOTH=ON \
-DMODULE_DISABLE_BLUETOOTHRADIO=ON \
-DMODULE_DISABLE_BRIGHTNESS=ON \
-DMODULE_DISABLE_CODEC=ON \
-DMODULE_DISABLE_CURSOR=ON \
-DMODULE_DISABLE_DE=ON \
-DMODULE_DISABLE_DISPLAY=ON \
-DMODULE_DISABLE_FONT=ON \
-DMODULE_DISABLE_GAMEPAD=ON \
-DMODULE_DISABLE_ICONS=ON \
-DMODULE_DISABLE_KEYBOARD=ON \
-DMODULE_DISABLE_LM=ON \
-DMODULE_DISABLE_MEDIA=ON \
-DMODULE_DISABLE_MONITOR=ON \
-DMODULE_DISABLE_MOUSE=ON \
-DMODULE_DISABLE_OPENCL=ON \
-DMODULE_DISABLE_OPENGL=ON \
-DMODULE_DISABLE_PLAYER=ON \
-DMODULE_DISABLE_SOUND=ON \
-DMODULE_DISABLE_TERMINAL=ON \
-DMODULE_DISABLE_TERMINALFONT=ON \
-DMODULE_DISABLE_TERMINALSIZE=ON \
-DMODULE_DISABLE_TERMINALTHEME=ON \
-DMODULE_DISABLE_THEME=ON \
-DMODULE_DISABLE_VULKAN=ON \
-DMODULE_DISABLE_WALLPAPER=ON \
-DMODULE_DISABLE_WM=ON \
-DMODULE_DISABLE_WMTHEME=ON \
-DMODULE_DISABLE_ZPOOL=ON

define Build/Prepare
$(call Build/Prepare/Default)
find $(PKG_BUILD_DIR)/src/logo/ascii/[a-z]/ -type f ! -name 'openwrt*.txt' -delete
endef

define Package/fastfetch/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fastfetch $(1)/usr/bin
endef

$(eval $(call BuildPackage,fastfetch))