# ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # File: neovide.spec # Copyright 🄯 2025 Van de Bugger. # SPDX-License-Identifier: FSFAP # ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― Source1000: vdb.lua %include %{S:1000} %bcond_with check Name: neovide Version: 0.14.1 Release: 0.vdb.1%{dist} Summary: A simple graphical user interface for Neovim License: MIT URL: https://%{name}.dev Source0: %{crates_source} %global appid dev.%{name} %{rem: Reversed URL w/o protocol.} BuildRequires: cargo-rpm-macros >= 24 BuildRequires: cargo BuildRequires: rust BuildRequires: %{__perl} BuildRequires: ImageMagick BuildRequires: desktop-file-utils BuildRequires: freetype-devel BuildRequires: fontconfig-devel BuildRequires: libstdc++-devel Requires(post): desktop-file-utils Requires(postun): desktop-file-utils %description %{text -- \ Neovide is a simple graphical user interface for Neovim (an aggressively refactored and updated Vim editor). Where possible there are some graphical improvements, but functionally it should act like the terminal UI. } %prep %autosetup -n %{name}-%{version} -p1 # Extract images from .ico file. It contains several icons: %{__mkdir} assets/icons magick assets/%{name}.ico -set 'filename:area' '%%wx%%h' 'assets/icons/%%[filename:area].png' # Fix desktop file. Use id instead of name for the icon: # %{__perl} -p \ # -e 'BEGIN { $/ = undef; }; ' \ # -e 's{^(Icon=).*$}{$1%{appid}}m;' \ # assets/%{name}.desktop > assets/%{appid}.desktop %{__cp} assets/%{name}.desktop assets/%{appid}.desktop %cargo_prep %{__mv} .cargo/config.toml .cargo/config.toml.orig %{__perl} -p \ -e 'BEGIN { $/ = undef; }; ' \ -e 's{^(\[net\]\noffline\h*=\h*)true(\n)}{$1false$2}m;' \ -e 's{^\[source\.crates-io\]\nregistry\h*=\h*"https://crates\.io"\h*\nreplace-with\h*=\h*"local-registry"\n}{}m; ' \ .cargo/config.toml.orig > .cargo/config.toml %{__cargo} fetch %build %cargo_build %{cargo_license_summary} %{cargo_license} > LICENSE.dependencies %install %cargo_install for icon in assets/icons/*.png; do size=$(basename "$icon" .png) %{_install_D} -m u=rw,go=r "$icon" "%{buildroot}/%{_iconsdir}/hicolor/$size/apps/%{appid}.png" done desktop-file-install --set-icon=%{appid} assets/%{appid}.desktop %if %{with check} %check %cargo_test -a desktop-file-validate assets/%{appid}.desktop %endif %files %license LICENSE %{_bindir}/%{name} %{_iconsdir}/hicolor/*/apps/%{appid}.png %{_datadir}/applications/%{appid}.desktop %post if [[ $1 == 1 ]]; then # Install, not upgrade. %{_bindir}/update-desktop-database || : %{_bindir}/touch --no-create %{_iconsdir}/hicolor || : if [[ -x %{_bindir}/gtk-update-icon-cache ]]; then %{_bindir}/gtk-update-icon-cache --quiet %{_iconsdir}/hicolor || : fi fi %postun # Uninstall or upgrade. %{_bindir}/update-desktop-database || : %{_bindir}/touch --no-create %{_iconsdir}/hicolor || : if [[ -x %{_bindir}/gtk-update-icon-cache ]]; then %{_bindir}/gtk-update-icon-cache --quiet %{_iconsdir}/hicolor || : fi %changelog * Tue Mar 18 2025 Van de Bugger - 0.14.1-0.vdb.1 - Initial release