Skip to content

Commit f872f3d

Browse files
authored
Merge pull request #469 from bryce-carson/master
Update SLiM.spec to work with Qt 6 for Fedora and openSUSE
2 parents 2e1ca52 + f2ec557 commit f872f3d

File tree

1 file changed

+65
-8
lines changed

1 file changed

+65
-8
lines changed

SLiM.spec

Lines changed: 65 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,27 @@
11
# Cross-distribution SLiM RPM spec.
2-
# Defines:
32
%if %{defined suse_version}
4-
%define qt5 libqt5
3+
%if 0%{?suse_version} < 1600
4+
%global qtNameAndVersion libqt5
55
%else
6-
%define qt5 qt5
6+
%global qtNameAndVersion qt6
7+
%endif
8+
%endif
9+
10+
%if %{defined fedora}
11+
%if 0%{?fedora} >= 39
12+
%global qtNameAndVersion qt6
13+
%else
14+
%global qtNameAndVersion qt5
15+
%endif
16+
%endif
17+
18+
%if %{defined rhel}
19+
%if 0%{?epel} >= 9
20+
# qt6 is only available through EPEL on RHEL 9 and higher
21+
%global qtNameAndVersion qt6
22+
%else
23+
%global qtNameAndVersion qt5
24+
%endif
725
%endif
826

927
Name: SLiM
@@ -22,21 +40,29 @@ Conflicts: slim
2240
BuildRequires: cmake
2341
# openSUSE Build Requires
2442
%if %{defined suse_version}
25-
%if 0%{?suse_version} >= 1500
2643
BuildRequires: glew-devel
2744
BuildRequires: Mesa-libGL-devel
2845
BuildRequires: gcc-c++
29-
BuildRequires: libqt5-qtbase-devel
3046
BuildRequires: appstream-glib-devel
47+
%if 0%{?suse_version} < 1600
48+
BuildRequires: %{qtNameAndVersion}-qtbase-devel
49+
%else
50+
# only Tumbleweed officially supports Qt6; further, it's "base" not "qtbase" in Tumbleweed. :(
51+
BuildRequires: %{qtNameAndVersion}-base-devel
3152
%endif
3253
%else
33-
BuildRequires: qt5-qtbase-devel
54+
# if not on openSUSE
55+
BuildRequires: %{qtNameAndVersion}-qtbase-devel
3456
BuildRequires: libappstream-glib
3557
%endif
3658
ExclusiveArch: x86_64
3759

3860
# RHEL 8 has the oldest point release of 5.15, and is the oldest RHEL supported.
39-
Requires: %{qt5}-qtbase >= 5.15.1
61+
%if 0%{?rhel} == 8
62+
Requires: qt5-qtbase >= 5.15.1
63+
%else
64+
Requires: %{qtNameAndVersion}-qtbase
65+
%endif
4066

4167
%description
4268
SLiM is an evolutionary simulation framework that combines a powerful engine for
@@ -53,11 +79,32 @@ visualization of simulation output.
5379
%setup -q
5480

5581
%build
82+
%if 0%{?rhel} == 8
83+
%if "%_vpath_builddir" != "%_vpath_srcdir"
84+
echo "current directory: %(pwd)"
85+
echo "source directory: %_vpath_srcdir"
86+
echo "build directory: %_vpath_builddir"
87+
mkdir -p %_vpath_builddir
88+
%else
89+
%{warn "The build directory is the same as the source directory on RHEL 8!"}
90+
%endif
91+
92+
## Tell CMake where the source directory and the build directory are, directly.
93+
%cmake -S %_vpath_srcdir -B %_vpath_builddir -DBUILD_SLIMGUI=ON
94+
cd %_vpath_builddir
95+
%else
96+
# rpmbuild is not running on RHEL 8
5697
%cmake -DBUILD_SLIMGUI=ON
98+
%endif
99+
57100
%cmake_build
58101

59102
%install
103+
%if 0%{?rhel} == 8
104+
cmake --install %_vpath_builddir --prefix %{buildroot}/usr
105+
%else
60106
%cmake_install
107+
%endif
61108

62109
%files
63110
%{_bindir}/eidos
@@ -72,6 +119,16 @@ visualization of simulation output.
72119
%{_datadir}/mime/packages/org.messerlab.slimgui-mime.xml
73120

74121
%changelog
122+
* Sun Sep 15 2024 Bryce Carson <bryce.a.carson@gmail.com> - 4.3-2
123+
- Significant work has been invested into debugging the build of RHEL 8 on COPR. For whatever reason, since 4.0.1-1, we were unable to build on RHEL 8 (or perhaps it was EPEL 8?). Regardless, the ability to build on RHEL 8 and EPEL 8 has been achieved or restored, using conditionals which check what distribution the build is occuring on. These conditionals check the distribution using the defined RPM macros, a reliable system that the operating systems try not to step on each others toes; it'd be nicer if CentOS didn't call itself RHEL, though, but CentOS purposefully tries to be "bug-compatible" (if I recall) with RHEL, yet be slightly upstream of it with RHEL. The buildroot (which is the installation prefix within the CHROOT) and the source and build directories must be manually specified when building on RHEL 8 or EPEL 8 systems (which is RHEL 8 + EPEL [the extra packages for enterprise linux repository] for RHEL 8). I don't know what changed amongst the macros, if anything ever did change, but with 4.0.1-1 we were able to build for EPEL 8 two years ago, and then we weren't when I tried however long ago that issue four-hundred and forty cropped up. This has been resolved with the use of conditionals in the RPM preprocessor (do recall that "if" is not actually a macro) and RPM macros.
124+
- Conditionals and macros are used to decide whether to use Qt 6 or Qt 5.
125+
126+
* Mon Sep 02 2024 Bryce Carson <bryce.a.carson@gmail.com> - 4.3-1
127+
- Changes to the package have occurred. See the following points.
128+
- Further version checks for various distributions are introduced to allow cross-distribution packaging and building against Qt5 or Qt6, appropriate to the platform.
129+
- An attempt to fix issue 440 is made
130+
- See the SLiM release notes on GitHub for information about changes to the packaged software.
131+
75132
* Tue Apr 30 2024 Ben Haller <bhaller@mac.com> - 4.2.2-1
76133
- No changes to the package have been made since the last release.
77134
- Ship the fix for the 4.2.1-2 crashing bug as a separate release.
@@ -85,7 +142,7 @@ visualization of simulation output.
85142
- No changes to the package have been made since the last release.
86143
- Fix for a crashing bug under certain conditions.
87144

88-
* Thu Mar 20 2024 Bryce Carson <bryce.a.carson@gmail.com> - 4.2-1
145+
* Wed Mar 20 2024 Bryce Carson <bryce.a.carson@gmail.com> - 4.2-1
89146
- No changes to the package have been made since the last release. See the SLiM release notes on GitHub for information about changes to the packaged software.
90147

91148
* Mon Dec 4 2023 Bryce Carson <bryce.a.carson@gmail.com> - 4.1-1

0 commit comments

Comments
 (0)