From 6897efdd6cd7d2db502ea3573260e19461a544fd Mon Sep 17 00:00:00 2001 From: Raboneko <119771935+raboneko@users.noreply.github.com> Date: Mon, 26 May 2025 02:58:05 -0700 Subject: [PATCH] add: Edit (#4969) (#5037) * add: Edit * Million dollar question: Is cargo_install broken or is it the project? * It is the project... * ? * Update edit.spec * fix?: Nightly * fix: Fedora's stupid init thing * Aaaaaa * -_- * ? * WHERE is this getting set aaaa * ? * Update edit.spec * Update edit.spec * Oops * Update edit.spec * Update edit.spec * Update edit.spec * Update edit.spec * Update edit.spec * Update edit.spec * Update edit.spec --------- (cherry picked from commit 4f7e6eaca91643be60841bc010b5319909ed6bf2) Signed-off-by: Gilver Co-authored-by: Gilver --- anda/devs/edit/anda.hcl | 5 ++++ anda/devs/edit/edit.spec | 57 ++++++++++++++++++++++++++++++++++++++ anda/devs/edit/update.rhai | 1 + 3 files changed, 63 insertions(+) create mode 100644 anda/devs/edit/anda.hcl create mode 100644 anda/devs/edit/edit.spec create mode 100644 anda/devs/edit/update.rhai diff --git a/anda/devs/edit/anda.hcl b/anda/devs/edit/anda.hcl new file mode 100644 index 0000000000..ce214676b7 --- /dev/null +++ b/anda/devs/edit/anda.hcl @@ -0,0 +1,5 @@ +project pkg { + rpm { + spec = "edit.spec" + } +} diff --git a/anda/devs/edit/edit.spec b/anda/devs/edit/edit.spec new file mode 100644 index 0000000000..99bd9d84b6 --- /dev/null +++ b/anda/devs/edit/edit.spec @@ -0,0 +1,57 @@ +%global _description %{expand: +An editor that pays homage to the classic MS-DOS Editor, but with a modern interface and input controls similar to VS Code.} +%global crate edit +%bcond rust_nightly 1 +%if %{with rust_nightly} +%define __cargo /usr/bin/env CARGO_HOME=.cargo RUSTC_BOOTSTRAP=1 RUSTFLAGS='%{build_rustflags}' $HOME/.cargo/bin/cargo +%define __rustc $HOME/.cargo/bin/rustc +%define __rustdoc $HOME/.cargo/bin/rustdoc +%endif + +Name: %{crate} +Version: 1.0.0 +Release: 1%{?dist} +Summary: A simple editor for simple needs. +SourceLicense: MIT +License: MIT AND (MIT OR Apache-2.0) +URL: https://github.com/microsoft/edit +Source0: %{url}/archive/refs/tags/v%{version}.tar.gz +BuildRequires: anda-srpm-macros +BuildRequires: cargo-rpm-macros +%if %{with rust_nightly} +BuildRequires: rustup +%endif +BuildRequires: mold +Packager: Gilver E. + +%description %_description + +%prep +%autosetup -n %{name}-%{version} +%if %{with rust_nightly} +rustup-init -y +. "$HOME/.cargo/env" +rustup toolchain install nightly +rustup override set nightly +%endif +%cargo_prep_online + +%build +%cargo_build + +%install +%crate_install_bin +%{cargo_license_online} > LICENSE.dependencies + +%files +%doc CODE_OF_CONDUCT.md +%doc README.md +%doc SECURITY.md +%license LICENSE +%license LICENSE.dependencies +%{_bindir}/%{name} + +%changelog +* Thu May 22 2025 Gilver E. - 1.0.0-1 +- Initial package + diff --git a/anda/devs/edit/update.rhai b/anda/devs/edit/update.rhai new file mode 100644 index 0000000000..f2c7849103 --- /dev/null +++ b/anda/devs/edit/update.rhai @@ -0,0 +1 @@ +rpm.version(gh("microsoft/edit"));