From dc3a4255261013b42ca3ff9344402364c32745d2 Mon Sep 17 00:00:00 2001 From: Xronin Date: Sat, 10 May 2025 17:29:16 -0300 Subject: [PATCH] enhance(main/yazi): add .desktop entry and icons and clean up completions installation Co-authored-by: TomIO --- packages/yazi/build.sh | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/packages/yazi/build.sh b/packages/yazi/build.sh index 981274b0b9e2c7..947fe1fb0c266f 100644 --- a/packages/yazi/build.sh +++ b/packages/yazi/build.sh @@ -3,13 +3,16 @@ TERMUX_PKG_DESCRIPTION="Blazing fast terminal file manager written in Rust, base TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_VERSION="25.5.31" +TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/sxyazi/yazi/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=4d005e7c3f32b5574d51ab105597f3da3a4be2f7b5cd1bcb284143ad38253ed4 +TERMUX_PKG_BUILD_DEPENDS='aosp-libs, imagemagick' TERMUX_PKG_AUTO_UPDATE=true TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { termux_setup_rust + [[ "$TERMUX_ON_DEVICE_BUILD" == "false" ]] && termux_setup_proot } termux_step_make() { @@ -22,12 +25,29 @@ termux_step_make_install() { install -Dm700 -t "$TERMUX_PREFIX/bin" "target/${CARGO_TARGET_NAME}/release/yazi" install -Dm700 -t "$TERMUX_PREFIX/bin" "target/${CARGO_TARGET_NAME}/release/ya" - cd yazi-boot/completions - install -Dm644 "${TERMUX_PKG_NAME}.bash" "${TERMUX_PREFIX}/share/bash-completion/completions/${TERMUX_PKG_NAME}.bash" - install -Dm644 "${TERMUX_PKG_NAME}.elv" "${TERMUX_PREFIX}/share/elvish/lib/${TERMUX_PKG_NAME}.elv" - install -Dm644 "${TERMUX_PKG_NAME}.fish" "${TERMUX_PREFIX}/share/fish/vendor_completions.d/${TERMUX_PKG_NAME}.fish" - install -Dm644 "${TERMUX_PKG_NAME}.nu" "${TERMUX_PREFIX}/share/nushell/vendor/autoload/${TERMUX_PKG_NAME}.nu" - install -Dm644 "_${TERMUX_PKG_NAME}" "${TERMUX_PREFIX}/share/zsh/site-functions/_${TERMUX_PKG_NAME}" + # shell completions + install -Dm644 yazi-boot/completions/yazi.bash "$TERMUX_PREFIX/share/bash-completion/completions/yazi.bash" + install -Dm644 yazi-boot/completions/yazi.elv "$TERMUX_PREFIX/share/elvish/lib/yazi.elv" + install -Dm644 yazi-boot/completions/yazi.fish "$TERMUX_PREFIX/share/fish/vendor_completions.d/yazi.fish" + install -Dm644 yazi-boot/completions/yazi.nu "$TERMUX_PREFIX/share/nushell/vendor/autoload/yazi.nu" + install -Dm644 yazi-boot/completions/_yazi "$TERMUX_PREFIX/share/zsh/site-functions/_yazi" + + # desktop entry + install -Dm644 assets/yazi.desktop "$TERMUX_PREFIX/share/applications/yazi.desktop" + + # application icons + local res + echo -n "Generating icons:" + for res in 16 24 32 48 64 128 256; do + mkdir -p "${TERMUX_PREFIX}/share/icons/hicolor/${res}x${res}/apps" + termux-proot-run magick assets/logo.png \ + -resize "${res}x${res}" \ + "${TERMUX_PREFIX}/share/icons/hicolor/${res}x${res}/apps/yazi.png" + [[ -e "${TERMUX_PREFIX}/share/icons/hicolor/${res}x${res}/apps/yazi.png" ]] && { + echo -n " ${res}x${res}" + } + done + echo } termux_step_create_debscripts() {