Skip to content

Commit f2ccf65

Browse files
committed
Add rpm package
1 parent 4d211a1 commit f2ccf65

File tree

2 files changed

+108
-0
lines changed

2 files changed

+108
-0
lines changed

.github/workflows/publish-rpm.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Trigger RPM Build
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [released]
7+
8+
env:
9+
NAME_LOWER: gearboy
10+
11+
jobs:
12+
trigger:
13+
name: Trigger RPM Build
14+
runs-on: ubuntu-latest
15+
if: github.repository_owner == 'drhelius'
16+
strategy:
17+
matrix:
18+
fedora_version: ['42', '41', '40']
19+
steps:
20+
- name: Get release version
21+
run: |
22+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
23+
VERSION=$(gh release view --repo "${{ github.repository }}" --json tagName -q '.tagName')
24+
echo "Manual trigger - using latest release: $VERSION"
25+
else
26+
VERSION="${GITHUB_REF#refs/tags/}"
27+
echo "Release trigger - version: $VERSION"
28+
fi
29+
echo "VERSION=$VERSION" >> $GITHUB_ENV
30+
env:
31+
GH_TOKEN: ${{ github.token }}
32+
33+
- name: Trigger RPM workflow
34+
run: |
35+
gh api repos/drhelius/rpm-geardome/dispatches \
36+
--method POST \
37+
--input - <<EOF
38+
{
39+
"event_type": "build-rpm-package",
40+
"client_payload": {
41+
"emulator": "${{ env.NAME_LOWER }}",
42+
"version": "${{ env.VERSION }}",
43+
"fedora_version": "${{ matrix.fedora_version }}"
44+
}
45+
}
46+
EOF
47+
env:
48+
GH_TOKEN: ${{ secrets.RPM_TRIGGER_TOKEN }}

platforms/linux/rpm/gearboy.spec

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
Name: gearboy
2+
Version: %{?version}%{!?version:1.0.0}
3+
Release: 1%{?dist}
4+
Summary: Game Boy / Game Boy Color emulator
5+
6+
License: GPL-3.0-or-later
7+
URL: https://github.com/drhelius/Gearboy
8+
Source0: https://github.com/drhelius/Gearboy/archive/refs/tags/%{version}.tar.gz
9+
10+
BuildRequires: gcc-c++
11+
BuildRequires: gcc
12+
BuildRequires: make
13+
BuildRequires: pkgconf-pkg-config
14+
BuildRequires: mesa-libGL-devel
15+
BuildRequires: SDL3-devel
16+
17+
Requires: mesa-libGL
18+
Requires: SDL3
19+
20+
%description
21+
Gearboy is a cross-platform Game Boy / Game Boy Color emulator
22+
written in C++.
23+
24+
%prep
25+
%autosetup -n Gearboy-%{version}
26+
27+
%build
28+
%make_build -C platforms/linux \
29+
GIT_VERSION="%{version}" \
30+
USE_CLANG=0 \
31+
DEBUG=0
32+
33+
%install
34+
install -Dm755 platforms/linux/%{name} %{buildroot}%{_prefix}/lib/%{name}/%{name}
35+
ln -s %{_prefix}/lib/%{name}/%{name} %{buildroot}%{_bindir}/%{name}
36+
37+
install -Dm644 platforms/shared/gamecontrollerdb.txt %{buildroot}%{_prefix}/lib/%{name}/gamecontrollerdb.txt
38+
39+
install -dm755 %{buildroot}%{_prefix}/lib/%{name}/mcp/resources/hardware
40+
install -Dm644 platforms/shared/desktop/mcp/resources/hardware/toc.json %{buildroot}%{_prefix}/lib/%{name}/mcp/resources/hardware/toc.json
41+
42+
install -Dm644 platforms/linux/debian/%{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop
43+
sed -i 's|/usr/games/gearboy|gearboy|g' %{buildroot}%{_datadir}/applications/%{name}.desktop
44+
45+
install -Dm644 platforms/shared/desktop/mcp/icon.png %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/%{name}.png
46+
47+
install -Dm644 platforms/linux/debian/%{name}.6 %{buildroot}%{_mandir}/man6/%{name}.6
48+
49+
%files
50+
%license LICENSE
51+
%doc README.md
52+
%{_bindir}/%{name}
53+
%{_prefix}/lib/%{name}/
54+
%{_datadir}/applications/%{name}.desktop
55+
%{_datadir}/icons/hicolor/128x128/apps/%{name}.png
56+
%{_mandir}/man6/%{name}.6*
57+
58+
%changelog
59+
* %(date "+%a %b %d %Y") Nacho Sanchez <863613+drhelius@users.noreply.github.com> - %{version}-1
60+
- Release %{version}

0 commit comments

Comments
 (0)