add: lovely-injector (#5048) (#5068)

* add: lovely-injector

* don't actually check the version because rpm version comp isnt a thing yet

* make injector exclusive for x86_64

* try pushd into lovely-unix only

* fix broken formatting

(cherry picked from commit 1461a2fce3)

Co-authored-by: Pornpipat Popum <cappy@cappuchino.xyz>
This commit is contained in:
Raboneko
2025-05-27 07:17:23 -07:00
committed by GitHub
parent 06c9d72541
commit 76b68427df
3 changed files with 84 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
project pkg {
rpm {
spec = "lovely-injector.spec"
}
# arches = ["x86_64"]
}
@@ -0,0 +1,77 @@
# Generated by rust2rpm 27
%bcond check 1
%bcond rust_nightly 1
%global debug_package %{nil}
%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
# todo: update for 0.8 because dobby-sys is now a submodule
# I'm going to git clone the repo to prepare for 0.8
Name: lovely-injector
Version: 0.7.1
Release: 1%?dist
Summary: A runtime lua injector for games built with LÖVE
License: MIT
# LICENSE.dependencies contains a full license breakdown
URL: https://github.com/ethangreen-dev/lovely-injector
Requires: love
Packager: Cappy Ishihara <cappy@cappuchino.xyz>
BuildRequires: mold anda-srpm-macros cargo-rpm-macros >= 24
%if %{with rust_nightly}
BuildRequires: rustup
%endif
%global _description %{expand:
%{summary}.}
%description %{_description}
%prep
rm -rf *
%git_clone %{url} v%{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_license_online} > LICENSE.dependencies
pushd crates/lovely-unix
%cargo_build
popd
%install
# install library
install -Dm 644 target/rpm/liblovely.so %{buildroot}%{_libdir}/liblovely.so
%if %{with check}
%check
pushd crates/lovely-unix
%cargo_test
popd
%endif
%files
%license LICENSE.md
# Only include dobby-sys license for versions >= 0.8
# Manually uncomment the next line when updating to 0.8 or later
# %license crates/dobby-sys/LICENSE
%license LICENSE.dependencies
%{_libdir}/liblovely.so
%doc README.md
%changelog
* Mon May 26 2025 Cappy Ishihara <cappy@fyralabs.com> - 0.7.1-1
- Initial package
+1
View File
@@ -0,0 +1 @@
rpm.global("ver",gh("ethangreen-dev/lovely-injector"));