Skip to content

Commit 56c24e5

Browse files
don't get VERSION from git in makefile, sometimes we build from tarball only. sed the version into makefile during workflow
1 parent 094f214 commit 56c24e5

File tree

3 files changed

+34
-26
lines changed

3 files changed

+34
-26
lines changed

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

+10-9
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,14 @@ jobs:
4747
env:
4848
VERSION: ${{ env.VERSION }}
4949
run: |
50+
# Use either provided input or extracted value
51+
VERSION=${VERSION}
52+
COMMIT_SHA=${COMMIT_SHA}
53+
54+
echo $VERSION
5055
git submodule update --init --recursive
56+
sed -i "s|^VERSION := .*$|VERSION := ${VERSION}|g" Makefile.in
57+
5158
cd ..
5259
mkdir -p ~/rpmbuild/SOURCES/
5360
cp -R umu-launcher umu-launcher-$VERSION/
@@ -56,18 +63,12 @@ jobs:
5663
rm -Rf umu-launcher-$VERSION/
5764
cd umu-launcher/
5865
59-
# Use either provided input or extracted value
60-
VERSION=${VERSION}
61-
COMMIT_SHA=${COMMIT_SHA}
62-
63-
echo $VERSION
64-
sed -i 's/%global tag/%global tag '"$VERSION"'/' packaging/rpm/umu-launcher.spec
66+
sed -i "s|^%global tag .*|%global tag ${VERSION}|g" packaging/rpm/umu-launcher.spec
6567
cat packaging/rpm/umu-launcher.spec | grep tag
6668
6769
echo $COMMIT_SHA
68-
sed -re '/^#%global manual_commit/s|^# ?(.*)|\1|' packaging/rpm/umu-launcher.spec -i
69-
sed -i 's/%global manual_commit/%global manual_commit '"$COMMIT_SHA"'/' packaging/rpm/umu-launcher.spec
70-
cat packaging/rpm/umu-launcher.spec | grep manual_commit
70+
sed -i "s|^%global commit .*|%global commit ${COMMIT_SHA}|g" packaging/rpm/umu-launcher.spec
71+
cat packaging/rpm/umu-launcher.spec | grep commit
7172
7273
rpmbuild -ba packaging/rpm/umu-launcher.spec
7374
mv ~/rpmbuild/RPMS/x86_64/umu-launcher-$VERSION*.rpm \

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

+10-9
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,14 @@ jobs:
4747
env:
4848
VERSION: ${{ env.VERSION }}
4949
run: |
50+
# Use either provided input or extracted value
51+
VERSION=${VERSION}
52+
COMMIT_SHA=${COMMIT_SHA}
53+
54+
echo $VERSION
5055
git submodule update --init --recursive
56+
sed -i "s|^VERSION := .*$|VERSION := ${VERSION}|g" Makefile.in
57+
5158
cd ..
5259
mkdir -p ~/rpmbuild/SOURCES/
5360
cp -R umu-launcher umu-launcher-$VERSION/
@@ -56,18 +63,12 @@ jobs:
5663
rm -Rf umu-launcher-$VERSION/
5764
cd umu-launcher/
5865
59-
# Use either provided input or extracted value
60-
VERSION=${VERSION}
61-
COMMIT_SHA=${COMMIT_SHA}
62-
63-
echo $VERSION
64-
sed -i 's/%global tag/%global tag '"$VERSION"'/' packaging/rpm/umu-launcher.spec
66+
sed -i "s|^%global tag .*|%global tag ${VERSION}|g" packaging/rpm/umu-launcher.spec
6567
cat packaging/rpm/umu-launcher.spec | grep tag
6668
6769
echo $COMMIT_SHA
68-
sed -re '/^#%global manual_commit/s|^# ?(.*)|\1|' packaging/rpm/umu-launcher.spec -i
69-
sed -i 's/%global manual_commit/%global manual_commit '"$COMMIT_SHA"'/' packaging/rpm/umu-launcher.spec
70-
cat packaging/rpm/umu-launcher.spec | grep manual_commit
70+
sed -i "s|^%global commit .*|%global commit ${COMMIT_SHA}|g" packaging/rpm/umu-launcher.spec
71+
cat packaging/rpm/umu-launcher.spec | grep commit
7172
7273
rpmbuild -ba packaging/rpm/umu-launcher.spec
7374
mv ~/rpmbuild/RPMS/x86_64/umu-launcher-$VERSION*.rpm \

packaging/rpm/umu-launcher.spec

+14-8
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,26 @@
22
%global tag 1.2.3
33

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

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

129
%global build_timestamp %(date +"%Y%m%d")
1310

1411
%global rel_build 1.%{build_timestamp}.%{shortcommit}%{?dist}
1512

13+
# F41 doesn't ship urllib3 >= 2.0 needed
14+
%global urllib3 2.3.0
15+
1616
Name: umu-launcher
1717
Version: %{tag}
1818
Release: %{rel_build}
1919
Summary: A tool for launching non-steam games with proton
2020

2121
License: GPLv3
2222
URL: https://github.com/Open-Wine-Components/umu-launcher
23-
Source0: umu-launcher-%{tag}.tar.gz
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
2425

2526
BuildArch: x86_64
2627
BuildRequires: meson >= 0.54.0
@@ -40,20 +41,21 @@ BuildRequires: python3-pip
4041
BuildRequires: libzstd-devel
4142
BuildRequires: python3-hatch-vcs
4243
BuildRequires: python3-wheel
44+
BuildRequires: python3-xlib
45+
BuildRequires: python3-pyzstd
4346
BuildRequires: cargo
4447

4548
# Can't use these yet, F41 doesn't ship urllib3 >= 2.0 needed
4649
#BuildRequires: python3-urllib3
47-
#BuildRequires: python3-pyzstd
4850

4951
Requires: python
5052
Requires: python3
5153
Requires: python3-xlib
5254
Requires: python3-filelock
55+
Requires: python3-pyzstd
5356

5457
# Can't use these yet, F41 doesn't ship urllib3 >= 2.0 needed
5558
#Requires: python3-urllib3
56-
#Requires: python3-pyzstd
5759

5860
Recommends: python3-cbor2
5961
Recommends: python3-xxhash
@@ -69,11 +71,15 @@ AutoReqProv: no
6971

7072
%prep
7173
%autosetup -p 1
74+
mv %{SOURCE1} .
75+
tar -xf urllib3-%{urllib3}.tar.gz
76+
rm *.tar.gz
77+
mv urllib3-%{urllib3}/* subprojects/urllib3/
7278

7379
%build
7480
# Update this when fedora ships urllib3 >= 2.0
7581
#./configure.sh --prefix=/usr --use-system-pyzstd --use-system-urllib
76-
./configure.sh --prefix=/usr
82+
./configure.sh --prefix=/usr --use-system-pyzstd
7783
make
7884

7985
%install

0 commit comments

Comments
 (0)