From 8db719332612e93b38533582ac491169d80bbb01 Mon Sep 17 00:00:00 2001 From: Raboneko <119771935+raboneko@users.noreply.github.com> Date: Tue, 8 Oct 2024 09:27:04 -0700 Subject: [PATCH] add: fontviewer (#2205) (#2206) * Create specfile Signed-off-by: sadlerm4 * Add patch for meson.build Signed-off-by: sadlerm4 * Create anda.hcl and update.rhai Signed-off-by: sadlerm4 * Update version and add packager directive --------- Signed-off-by: sadlerm4 (cherry picked from commit 1a5d36887aecba6f855816850ec919ad99fd08c4) Co-authored-by: sadlerm4 --- anda/apps/fontviewer/anda.hcl | 5 +++ anda/apps/fontviewer/fontviewer-meson.patch | 12 ++++++ anda/apps/fontviewer/fontviewer.spec | 47 +++++++++++++++++++++ anda/apps/fontviewer/update.rhai | 5 +++ 4 files changed, 69 insertions(+) create mode 100644 anda/apps/fontviewer/anda.hcl create mode 100644 anda/apps/fontviewer/fontviewer-meson.patch create mode 100644 anda/apps/fontviewer/fontviewer.spec create mode 100644 anda/apps/fontviewer/update.rhai diff --git a/anda/apps/fontviewer/anda.hcl b/anda/apps/fontviewer/anda.hcl new file mode 100644 index 0000000000..e7b86e5d58 --- /dev/null +++ b/anda/apps/fontviewer/anda.hcl @@ -0,0 +1,5 @@ +project pkg { + rpm { + spec = "fontviewer.spec" + } +} diff --git a/anda/apps/fontviewer/fontviewer-meson.patch b/anda/apps/fontviewer/fontviewer-meson.patch new file mode 100644 index 0000000000..3a3ffd9271 --- /dev/null +++ b/anda/apps/fontviewer/fontviewer-meson.patch @@ -0,0 +1,12 @@ +diff --git a/meson.build b/meson.build +index 4784ac2..2348b13 100644 +--- a/meson.build ++++ b/meson.build +@@ -13,4 +13,5 @@ executable( + dependency('cairomm-1.0'), + dependency('freetype2'), + ], +-) +\ No newline at end of file ++ install: true ++) diff --git a/anda/apps/fontviewer/fontviewer.spec b/anda/apps/fontviewer/fontviewer.spec new file mode 100644 index 0000000000..a904ffd029 --- /dev/null +++ b/anda/apps/fontviewer/fontviewer.spec @@ -0,0 +1,47 @@ +%global commit dc5cd1490235f8c19424b3345a89727199c86df3 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) +%global commit_date 20241003 + +Name: fontviewer +Version: %{commit_date}.git~%{shortcommit} +Release: 1%{?dist} +Summary: View and install fonts + +License: GPL-2.0 +URL: https://github.com/chocolateimage/%{name} +Source0: %{url}/archive/%{commit}.tar.gz +Patch0: fontviewer-meson.patch + +BuildRequires: gcc-c++ +BuildRequires: meson +BuildRequires: pkgconfig(cairomm-1.0) +BuildRequires: pkgconfig(fontconfig) +BuildRequires: pkgconfig(freetype2) +BuildRequires: pkgconfig(gtk+-3.0) +BuildRequires: pkgconfig(gtkmm-3.0) + +Requires: gtk3 fontconfig + +Packager: sadlerm + +%description +A platform-agnostic GTK+ 3 alternative to GNOME's Font Viewer + +%prep +%autosetup -n %{name}-%{commit} -p1 + +%build +%meson +%meson_build + +%install +%meson_install + +install -m 0755 -vd %{buildroot}%{_datadir}/applications +install -m 0755 -vp data/%{name}.desktop %{buildroot}%{_datadir}/applications/ + +%files +%license LICENSE +%doc README.md +%{_bindir}/%{name} +%{_datadir}/applications/%{name}.desktop diff --git a/anda/apps/fontviewer/update.rhai b/anda/apps/fontviewer/update.rhai new file mode 100644 index 0000000000..f71e0e4f15 --- /dev/null +++ b/anda/apps/fontviewer/update.rhai @@ -0,0 +1,5 @@ +rpm.global("commit", gh_commit("chocolateimage/fontviewer")); +if rpm.changed() { + rpm.release(); + rpm.global("commit_date", date()); +}