Skip to content

Commit de557b3

Browse files
Merge pull request #379 from Open-Wine-Components/rpm_fixup
[WIP] rpm fixups
2 parents 1a81b3c + 45a79bb commit de557b3

File tree

3 files changed

+114
-47
lines changed

3 files changed

+114
-47
lines changed

.github/workflows/build-umu-fedora-40.yml

+47-15
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ on:
44
workflow_call:
55
inputs:
66
version:
7-
required: true
7+
required: false
88
type: string
99
shasum:
10-
required: true
10+
required: false
1111
type: string
1212

1313
jobs:
@@ -22,30 +22,62 @@ jobs:
2222

2323
- name: Checkout repository
2424
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
2527

2628
- name: Configure Git safe directory
2729
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
2830

2931
- name: Install build dependencies
30-
run: dnf install -y rpm-build meson ninja-build cmake g++ gcc-c++ scdoc git python3-devel python3-build python3-installer python3-hatchling python python3 cargo python3-hatch-vcs python3-wheel libzstd-devel
32+
run: dnf install -y rpm-build meson ninja-build cmake g++ gcc-c++ scdoc git python3-devel python3-build python3-installer python3-hatchling python python3 cargo python3-hatch-vcs python3-wheel libzstd-devel python3-pyzstd python3-xlib wget
33+
34+
- name: Extract Version and SHA
35+
run: |
36+
# Get version from git tags (assuming semantic versioning format)
37+
VERSION=$(git describe --tags --abbrev=0 || echo "unknown")
38+
39+
# Get current commit SHA
40+
COMMIT_SHA=$(git rev-parse HEAD)
41+
42+
# Store values in environment file
43+
echo "VERSION=$VERSION" >> $GITHUB_ENV
44+
echo "COMMIT_SHA=$COMMIT_SHA" >> $GITHUB_ENV
3145
3246
- name: Build the project
47+
env:
48+
VERSION: ${{ env.VERSION }}
3349
run: |
50+
# Use either provided input or extracted value
51+
VERSION=${VERSION}
52+
COMMIT_SHA=${COMMIT_SHA}
53+
54+
echo $VERSION
3455
git submodule update --init --recursive
35-
./configure.sh --prefix=/usr
36-
make
37-
mkdir -p ~/rpmbuild/SOURCES
38-
cp -r . ~/rpmbuild/SOURCES/umu-launcher
39-
sed -re '/^#%global manual_commit/s|^# ?(.*)|\1|' packaging/rpm/umu-launcher.spec \
40-
-e 's|(manual_commit\s+\w+)|manual_commit ${{ inputs.shasum }}|g' \
41-
-i
42-
cat packaging/rpm/umu-launcher.spec | grep manual_commit
56+
sed -i "s|^VERSION := .*$|VERSION := ${VERSION}|g" Makefile.in
57+
58+
cd ..
59+
mkdir -p ~/rpmbuild/SOURCES/
60+
cp -R umu-launcher umu-launcher-$VERSION/
61+
tar -cvzf umu-launcher-$VERSION.tar.gz umu-launcher-$VERSION
62+
mv umu-launcher-$VERSION.tar.gz ~/rpmbuild/SOURCES/
63+
rm -Rf umu-launcher-$VERSION/
64+
wget https://github.com/urllib3/urllib3/releases/download/2.3.0/urllib3-2.3.0.tar.gz
65+
mv urllib3-2.3.0.tar.gz ~/rpmbuild/SOURCES/
66+
cd umu-launcher/
67+
68+
sed -i "s|^%global tag .*|%global tag ${VERSION}|g" packaging/rpm/umu-launcher.spec
69+
cat packaging/rpm/umu-launcher.spec | grep tag
70+
71+
echo $COMMIT_SHA
72+
sed -i "s|^%global commit .*|%global commit ${COMMIT_SHA}|g" packaging/rpm/umu-launcher.spec
73+
cat packaging/rpm/umu-launcher.spec | grep commit
74+
4375
rpmbuild -ba packaging/rpm/umu-launcher.spec
44-
mv ~/rpmbuild/RPMS/x86_64/umu-launcher-${{ inputs.version }}*.rpm \
45-
~/rpmbuild/RPMS/x86_64/umu-launcher-${{ inputs.version }}.fc40.rpm
76+
mv ~/rpmbuild/RPMS/x86_64/umu-launcher-$VERSION*.rpm \
77+
~/rpmbuild/RPMS/x86_64/umu-launcher-$VERSION.fc40.rpm
4678
4779
- name: Fedora-40
4880
uses: actions/upload-artifact@v4
4981
with:
50-
name: umu-launcher-${{ inputs.version }}.fc40.rpm
51-
path: ~/rpmbuild/RPMS/x86_64/umu-launcher-${{ inputs.version }}.fc40.rpm
82+
name: umu-launcher-${{ env.VERSION }}.fc40.rpm
83+
path: ~/rpmbuild/RPMS/x86_64/umu-launcher-${{ env.VERSION }}.fc40.rpm

.github/workflows/build-umu-fedora-41.yml

+47-15
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ on:
44
workflow_call:
55
inputs:
66
version:
7-
required: true
7+
required: false
88
type: string
99
shasum:
10-
required: true
10+
required: false
1111
type: string
1212

1313
jobs:
@@ -22,30 +22,62 @@ jobs:
2222

2323
- name: Checkout repository
2424
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
2527

2628
- name: Configure Git safe directory
2729
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
2830

2931
- name: Install build dependencies
30-
run: dnf install -y rpm-build meson ninja-build cmake g++ gcc-c++ scdoc git python3-devel python3-build python3-installer python3-hatchling python python3 cargo python3-hatch-vcs python3-wheel libzstd-devel
32+
run: dnf install -y rpm-build meson ninja-build cmake g++ gcc-c++ scdoc git python3-devel python3-build python3-installer python3-hatchling python python3 cargo python3-hatch-vcs python3-wheel libzstd-devel python3-pyzstd python3-xlib wget
33+
34+
- name: Extract Version and SHA
35+
run: |
36+
# Get version from git tags (assuming semantic versioning format)
37+
VERSION=$(git describe --tags --abbrev=0 || echo "unknown")
38+
39+
# Get current commit SHA
40+
COMMIT_SHA=$(git rev-parse HEAD)
41+
42+
# Store values in environment file
43+
echo "VERSION=$VERSION" >> $GITHUB_ENV
44+
echo "COMMIT_SHA=$COMMIT_SHA" >> $GITHUB_ENV
3145
3246
- name: Build the project
47+
env:
48+
VERSION: ${{ env.VERSION }}
3349
run: |
50+
# Use either provided input or extracted value
51+
VERSION=${VERSION}
52+
COMMIT_SHA=${COMMIT_SHA}
53+
54+
echo $VERSION
3455
git submodule update --init --recursive
35-
./configure.sh --prefix=/usr
36-
make
37-
mkdir -p ~/rpmbuild/SOURCES
38-
cp -r . ~/rpmbuild/SOURCES/umu-launcher
39-
sed -re '/^#%global manual_commit/s|^# ?(.*)|\1|' packaging/rpm/umu-launcher.spec \
40-
-e 's|(manual_commit\s+\w+)|manual_commit ${{ inputs.shasum }}|g' \
41-
-i
42-
cat packaging/rpm/umu-launcher.spec | grep manual_commit
56+
sed -i "s|^VERSION := .*$|VERSION := ${VERSION}|g" Makefile.in
57+
58+
cd ..
59+
mkdir -p ~/rpmbuild/SOURCES/
60+
cp -R umu-launcher umu-launcher-$VERSION/
61+
tar -cvzf umu-launcher-$VERSION.tar.gz umu-launcher-$VERSION
62+
mv umu-launcher-$VERSION.tar.gz ~/rpmbuild/SOURCES/
63+
rm -Rf umu-launcher-$VERSION/
64+
wget https://github.com/urllib3/urllib3/releases/download/2.3.0/urllib3-2.3.0.tar.gz
65+
mv urllib3-2.3.0.tar.gz ~/rpmbuild/SOURCES/
66+
cd umu-launcher/
67+
68+
sed -i "s|^%global tag .*|%global tag ${VERSION}|g" packaging/rpm/umu-launcher.spec
69+
cat packaging/rpm/umu-launcher.spec | grep tag
70+
71+
echo $COMMIT_SHA
72+
sed -i "s|^%global commit .*|%global commit ${COMMIT_SHA}|g" packaging/rpm/umu-launcher.spec
73+
cat packaging/rpm/umu-launcher.spec | grep commit
74+
4375
rpmbuild -ba packaging/rpm/umu-launcher.spec
44-
mv ~/rpmbuild/RPMS/x86_64/umu-launcher-${{ inputs.version }}*.rpm \
45-
~/rpmbuild/RPMS/x86_64/umu-launcher-${{ inputs.version }}.fc41.rpm
76+
mv ~/rpmbuild/RPMS/x86_64/umu-launcher-$VERSION*.rpm \
77+
~/rpmbuild/RPMS/x86_64/umu-launcher-$VERSION.fc41.rpm
4678
4779
- name: Fedora-41
4880
uses: actions/upload-artifact@v4
4981
with:
50-
name: umu-launcher-${{ inputs.version }}.fc41.rpm
51-
path: ~/rpmbuild/RPMS/x86_64/umu-launcher-${{ inputs.version }}.fc41.rpm
82+
name: umu-launcher-${{ env.VERSION }}.fc41.rpm
83+
path: ~/rpmbuild/RPMS/x86_64/umu-launcher-${{ env.VERSION }}.fc41.rpm

packaging/rpm/umu-launcher.spec

+20-17
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
1-
%global tag %(git describe --abbrev=0 --tags)
1+
# Tag is auto-inserted by workflow
2+
%global tag 1.2.3
23

34
# Manual commit is auto-inserted by workflow
4-
#%global manual_commit
5-
6-
%{!?manual_commit: %global commit %(git rev-list -n 1 %{tag} 2>/dev/null)}
7-
%{?manual_commit: %global commit %{manual_commit}}
5+
%global commit e8c6b737f54b24d1ea61ff82f78aa326c3df10b6
86

97
%global shortcommit %(c=%{commit}; echo ${c:0:7})
108

119
%global build_timestamp %(date +"%Y%m%d")
1210

1311
%global rel_build 1.%{build_timestamp}.%{shortcommit}%{?dist}
1412

13+
# F41 doesn't ship urllib3 >= 2.0 needed
14+
%global urllib3 2.3.0
15+
1516
Name: umu-launcher
1617
Version: %{tag}
1718
Release: %{rel_build}
1819
Summary: A tool for launching non-steam games with proton
1920

2021
License: GPLv3
2122
URL: https://github.com/Open-Wine-Components/umu-launcher
23+
Source0: %{url}/archive/refs/tags/%{tag}.tar.gz#/%{name}-%{tag}.tar.gz
24+
Source1: https://github.com/urllib3/urllib3/releases/download/%{urllib3}/urllib3-%{urllib3}.tar.gz
2225

2326
BuildArch: x86_64
2427
BuildRequires: meson >= 0.54.0
@@ -38,20 +41,21 @@ BuildRequires: python3-pip
3841
BuildRequires: libzstd-devel
3942
BuildRequires: python3-hatch-vcs
4043
BuildRequires: python3-wheel
44+
BuildRequires: python3-xlib
45+
BuildRequires: python3-pyzstd
4146
BuildRequires: cargo
4247

4348
# Can't use these yet, F41 doesn't ship urllib3 >= 2.0 needed
4449
#BuildRequires: python3-urllib3
45-
#BuildRequires: python3-pyzstd
4650

4751
Requires: python
4852
Requires: python3
4953
Requires: python3-xlib
5054
Requires: python3-filelock
55+
Requires: python3-pyzstd
5156

5257
# Can't use these yet, F41 doesn't ship urllib3 >= 2.0 needed
5358
#Requires: python3-urllib3
54-
#Requires: python3-pyzstd
5559

5660
Recommends: python3-cbor2
5761
Recommends: python3-xxhash
@@ -66,23 +70,22 @@ AutoReqProv: no
6670
%{name} A tool for launching non-steam games with proton
6771

6872
%prep
69-
git clone https://github.com/Open-Wine-Components/umu-launcher.git
70-
cd umu-launcher
71-
# Check if tag exists and is valid
72-
git checkout %{commit}
73-
74-
75-
git submodule update --init --recursive
73+
%autosetup -p 1
74+
if ! find subprojects/urllib3/ -mindepth 1 -maxdepth 1 | read; then
75+
# Directory is empty, perform action
76+
mv %{SOURCE1} .
77+
tar -xf urllib3-%{urllib3}.tar.gz
78+
rm *.tar.gz
79+
mv urllib3-%{urllib3}/* subprojects/urllib3/
80+
fi
7681

7782
%build
78-
cd umu-launcher
7983
# Update this when fedora ships urllib3 >= 2.0
8084
#./configure.sh --prefix=/usr --use-system-pyzstd --use-system-urllib
81-
./configure.sh --prefix=/usr
85+
./configure.sh --prefix=/usr --use-system-pyzstd
8286
make
8387

8488
%install
85-
cd umu-launcher
8689
make DESTDIR=%{buildroot} PYTHONDIR=%{python3_sitelib} install
8790

8891
%files

0 commit comments

Comments
 (0)