Skip to content

Commit

Permalink
Merge pull request #469 from bryce-carson/master
Browse files Browse the repository at this point in the history
Update SLiM.spec to work with Qt 6 for Fedora and openSUSE
  • Loading branch information
bhaller authored Sep 17, 2024
2 parents 2e1ca52 + f2ec557 commit f872f3d
Showing 1 changed file with 65 additions and 8 deletions.
73 changes: 65 additions & 8 deletions SLiM.spec
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
# Cross-distribution SLiM RPM spec.
# Defines:
%if %{defined suse_version}
%define qt5 libqt5
%if 0%{?suse_version} < 1600
%global qtNameAndVersion libqt5
%else
%define qt5 qt5
%global qtNameAndVersion qt6
%endif
%endif

%if %{defined fedora}
%if 0%{?fedora} >= 39
%global qtNameAndVersion qt6
%else
%global qtNameAndVersion qt5
%endif
%endif

%if %{defined rhel}
%if 0%{?epel} >= 9
# qt6 is only available through EPEL on RHEL 9 and higher
%global qtNameAndVersion qt6
%else
%global qtNameAndVersion qt5
%endif
%endif

Name: SLiM
Expand All @@ -22,21 +40,29 @@ Conflicts: slim
BuildRequires: cmake
# openSUSE Build Requires
%if %{defined suse_version}
%if 0%{?suse_version} >= 1500
BuildRequires: glew-devel
BuildRequires: Mesa-libGL-devel
BuildRequires: gcc-c++
BuildRequires: libqt5-qtbase-devel
BuildRequires: appstream-glib-devel
%if 0%{?suse_version} < 1600
BuildRequires: %{qtNameAndVersion}-qtbase-devel
%else
# only Tumbleweed officially supports Qt6; further, it's "base" not "qtbase" in Tumbleweed. :(
BuildRequires: %{qtNameAndVersion}-base-devel
%endif
%else
BuildRequires: qt5-qtbase-devel
# if not on openSUSE
BuildRequires: %{qtNameAndVersion}-qtbase-devel
BuildRequires: libappstream-glib
%endif
ExclusiveArch: x86_64

# RHEL 8 has the oldest point release of 5.15, and is the oldest RHEL supported.
Requires: %{qt5}-qtbase >= 5.15.1
%if 0%{?rhel} == 8
Requires: qt5-qtbase >= 5.15.1
%else
Requires: %{qtNameAndVersion}-qtbase
%endif

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

%build
%if 0%{?rhel} == 8
%if "%_vpath_builddir" != "%_vpath_srcdir"
echo "current directory: %(pwd)"
echo "source directory: %_vpath_srcdir"
echo "build directory: %_vpath_builddir"
mkdir -p %_vpath_builddir
%else
%{warn "The build directory is the same as the source directory on RHEL 8!"}
%endif

## Tell CMake where the source directory and the build directory are, directly.
%cmake -S %_vpath_srcdir -B %_vpath_builddir -DBUILD_SLIMGUI=ON
cd %_vpath_builddir
%else
# rpmbuild is not running on RHEL 8
%cmake -DBUILD_SLIMGUI=ON
%endif

%cmake_build

%install
%if 0%{?rhel} == 8
cmake --install %_vpath_builddir --prefix %{buildroot}/usr
%else
%cmake_install
%endif

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

%changelog
* Sun Sep 15 2024 Bryce Carson <[email protected]> - 4.3-2
- 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.
- Conditionals and macros are used to decide whether to use Qt 6 or Qt 5.

* Mon Sep 02 2024 Bryce Carson <[email protected]> - 4.3-1
- Changes to the package have occurred. See the following points.
- Further version checks for various distributions are introduced to allow cross-distribution packaging and building against Qt5 or Qt6, appropriate to the platform.
- An attempt to fix issue 440 is made
- See the SLiM release notes on GitHub for information about changes to the packaged software.

* Tue Apr 30 2024 Ben Haller <[email protected]> - 4.2.2-1
- No changes to the package have been made since the last release.
- Ship the fix for the 4.2.1-2 crashing bug as a separate release.
Expand All @@ -85,7 +142,7 @@ visualization of simulation output.
- No changes to the package have been made since the last release.
- Fix for a crashing bug under certain conditions.

* Thu Mar 20 2024 Bryce Carson <[email protected]> - 4.2-1
* Wed Mar 20 2024 Bryce Carson <[email protected]> - 4.2-1
- 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.

* Mon Dec 4 2023 Bryce Carson <[email protected]> - 4.1-1
Expand Down

0 comments on commit f872f3d

Please sign in to comment.