From 9e7c7d35e12d6122be0078a9f3abbf2136d2e691 Mon Sep 17 00:00:00 2001 From: Raboneko <119771935+raboneko@users.noreply.github.com> Date: Fri, 18 Jul 2025 09:34:10 -0700 Subject: [PATCH] add: neovim-default-editor (#5880) (#5890) (cherry picked from commit f48acbf5933c49052428b1bdc79491293395fc53) Co-authored-by: Gilver --- anda/tools/neovim-default-editor/anda.hcl | 9 ++++ .../neovim-default-editor.spec | 44 +++++++++++++++++++ anda/tools/neovim-default-editor/update.rhai | 8 ++++ 3 files changed, 61 insertions(+) create mode 100644 anda/tools/neovim-default-editor/anda.hcl create mode 100644 anda/tools/neovim-default-editor/neovim-default-editor.spec create mode 100644 anda/tools/neovim-default-editor/update.rhai diff --git a/anda/tools/neovim-default-editor/anda.hcl b/anda/tools/neovim-default-editor/anda.hcl new file mode 100644 index 0000000000..005dd8abb5 --- /dev/null +++ b/anda/tools/neovim-default-editor/anda.hcl @@ -0,0 +1,9 @@ +project pkg { + arches = ["x86_64"] + rpm { + spec = "neovim-default-editor.spec" + } + labels { + updbranch = 1 + } +} diff --git a/anda/tools/neovim-default-editor/neovim-default-editor.spec b/anda/tools/neovim-default-editor/neovim-default-editor.spec new file mode 100644 index 0000000000..6cbf026825 --- /dev/null +++ b/anda/tools/neovim-default-editor/neovim-default-editor.spec @@ -0,0 +1,44 @@ +%global commit abde842fa612fccf0f665462b4bd0b721f6b8f0e + +Name: neovim-default-editor +# Version, release, and epoch are inherited from the editor package just like other default editors +Version: 0.11.3 +Release: 1%?dist +Epoch: 0 +# Inherited from Neovim itself +License: Apache-2.0 AND Vim AND MIT +Summary: Sets Neovim as the default editor +URL: https://neovim.io +Source0: https://raw.githubusercontent.com/terrapkg/pkg-neovim-default-editor/%{commit}/neovim-default-editor.csh +Source1: https://raw.githubusercontent.com/terrapkg/pkg-neovim-default-editor/%{commit}/neovim-default-editor.sh +Source2: https://raw.githubusercontent.com/terrapkg/pkg-neovim-default-editor/%{commit}/neovim-default-editor.fish +# For EVR macro +BuildRequires: anda-srpm-macros +Requires: default-editor +Requires: neovim +# All default editor packages MUST provide this +Provides: system-default-editor +BuildArch: noarch +Packager: Gilver E. + +%description +This package ensures the EDITOR shell variable +is set in common shells to Neovim. + +%build +# Nothing + +%install +install -Dpm644 %{SOURCE0} -t %{buildroot}%{_sysconfdir}/profile.d/ +install -Dpm644 %{SOURCE1} -t %{buildroot}%{_sysconfdir}/profile.d/ +install -Dpm644 %{SOURCE2} -t %{buildroot}%{_datadir}/fish/vendor_conf.d/ + +%files +%dir %{_sysconfdir}/profile.d +%config(noreplace) %{_sysconfdir}/profile.d/neovim-default-editor.* +%dir %{_datadir}/fish/vendor_conf.d +%{_datadir}/fish/vendor_conf.d/neovim-default-editor.fish + +%changelog +* Fri Jul 18 2025 Gilver E. - 0.11.3-1 +- Initial package diff --git a/anda/tools/neovim-default-editor/update.rhai b/anda/tools/neovim-default-editor/update.rhai new file mode 100644 index 0000000000..3619e2656c --- /dev/null +++ b/anda/tools/neovim-default-editor/update.rhai @@ -0,0 +1,8 @@ +import "andax/bump_extras.rhai" as bump; + +let v = bump::bodhi_vr("neovim", bump::as_bodhi_ver(labels.branch)); +let e = sh("dnf rq --qf='%{epoch}' neovim --repo=fedora,updates", #{"stdout": "piped"}).ctx.stdout; + +rpm.version(v[1]); +rpm.release(v[2]); +rpm.f = sub(`^Epoch: (.+?)$`, "Epoch: " + e, rpm.f);