[WIP]: Add `termux_step_install_icons` to generate and install application icons.
This PR adds a new build step which runs immediately after termux_step_post_make_install which generates application icons using imagemagick and termux-proot-run.
The termux_step_install_icons uses the following three new control variables:
TERMUX_PKG_ICONS- a comma separated list of icon filesTERMUX_PKG_ICON_NAMES- a comma separated list of icon names (optional)TERMUX_PKG_ICON_SIZES- sizes to generate icons in (defaults to "16, 24, 32, 48, 64, 128, 256")
Additionally aosp-libs and imagemagick will be implicitly added to the build dependencies for a package if it specifies TERMUX_PKG_ICONS.
This is done mostly for ease of use and convenience, since they are required for running imagemagick via termux-proot-run.
- This PR builds on the work done in #24676 for adding icons to the
yazipackage. As a proof of concept I have attached commits adapting the build scripts foryazi,mpvandmpv-xto these changes. I will be adding more packages to this PR later but wanted to put it up for comment and review now.
The wiki pages for; https://github.com/termux/termux-packages/wiki/Building-packages#build-steps and https://github.com/termux/termux-packages/wiki/Creating-new-package#package-build-script-variables will need to be updated with the new build steps and control variable when this PR is merged.
It is an interesting idea, but unfortunately, at least the way this PR currently is, it would break the TERMUX_ON_DEVICE_BUILD=true mode of mpv.
Generating icons for mpv:/data/data/com.termux/files/home/.termux-build/_cache/proot-bin-aarch64/proot: 1: Syntax error: "(" unexpected
Wouldn't it be possible to just make termux_step_install_icons() download and run an official GNU/Linux AppImage release of ImageMagick from here https://github.com/ImageMagick/ImageMagick/releases, and only pull in the Termux imagemagick package when TERMUX_ON_DEVICE_BUILD=true mode is detected?
It is an interesting idea, but unfortunately, at least the way this PR currently is, it would break the
TERMUX_ON_DEVICE_BUILD=truemode ofmpv.Generating icons for mpv:/data/data/com.termux/files/home/.termux-build/_cache/proot-bin-aarch64/proot: 1: Syntax error: "(" unexpectedWouldn't it be possible to just make
termux_step_install_icons()download and run an official GNU/Linux AppImage release of ImageMagick from here https://github.com/ImageMagick/ImageMagick/releases, and only pull in the Termuximagemagickpackage whenTERMUX_ON_DEVICE_BUILD=truemode is detected?
I hadn't considered the on-device codepath yet.
But yes that should be taken into account.
Can't we just run it without termux-proot-run for on-device builds?
Seems simpler than setting up the AppImage.
@robertkirkman could you please verify that this is working as intended for on-device builds now when you have the time?
It does now, sorry I didn't mention that earlier. I thought there might be more changes coming here.
I was waiting for feedback before adding additional packages with icons to this PR.
I'm looking through packages that have/should have icons to package. I'll mark these off once I've determined if they need any more work.
- [ ]
qbittorrent, already install icons as part of its build. - [ ]
inkscape, it's complicated. - [ ] XFCE Apps, seem to package their icons as part of the build.
- [ ] MATE Apps, seem to package their icons as part of the build (Though not quite the standard resolutions set in the build step)
- [ ]
firefox, should be shipping icons, currently doesn't will need to investigate. - [ ]
chromium, full standard raster range, noscalable - [ ]
htop, ships only thescalableicon currently - [ ]
foot, only ships thescalableand48x48icon currently - [ ]
alacritty, doesn't currently ship any icon - [ ]
kdenlive, ships a full set of icons - [ ]
handbrake, only shipsscalableicon currently - [ ]
keepassxc, onlyscalableicons and two256x256ones. - [ ]
vlc/vlc-qt, noscalableand incomplete rasterized icons. - [ ]
vim, completely missing. - [ ]
vim-gtk, only (16x16,32x32locolor) and (48x48hicolor). - [ ]
neovim, only128x128. - [ ]
emacs, completely missing. - [ ]
emacs-x,scalable(2 including one.icowhich is a raster image),16,24,32,48,128. - [ ]
helix, completely missing. - [ ]
kakoune, completely missing (unsure if there are office icons for it, Arch doesn't package any either) - [ ]
codeblocks, ships two mimetype icons (48x48) but no app icons. - [ ]
audacity,scalable,16,22,24,32,48 - [ ]
cups, completely missing. - [ ]
fcitx5, full set except64x64, additionally22x22 - [ ]
git/git-gui, completely missing. - [x]
gimp, full set plus some extra resolutions. - [ ]
synaptic,16for all,24only forsystem-upgrade,256andscalableonly for app icon. - [ ]
syncthing, completely missing. - [ ]
texstudio, onlyscalable. - [ ]
thunderbird, not where they should be. - [ ]
wireshark-qt, only mimetypes.
I've definitely missed some packages but this should be a good starting list to look into.