Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SLiM.spec to work with Qt 6 for Fedora and openSUSE #469

Merged
merged 28 commits into from
Sep 17, 2024
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9464bfe
Update SLiM.spec
bryce-carson Sep 2, 2024
6bcef40
Update SLiM.spec
bryce-carson Sep 2, 2024
5d32b93
Add files via upload
bryce-carson Sep 4, 2024
ebc1ab2
Update SLiM.spec
bryce-carson Sep 4, 2024
bc86920
Update SLiM.spec
bryce-carson Sep 4, 2024
3d0ef71
Update SLiM.spec
bryce-carson Sep 4, 2024
3814e97
Fix bare word issue in RHEL 8 conditional; conditionalize on RHEL 8
bryce-carson Sep 4, 2024
53782ea
Fix BuildRequires conditionals and the global definition of builddir
bryce-carson Sep 5, 2024
608268c
Specify source and build directory manually on RHEL 8
bryce-carson Sep 5, 2024
bac7b81
Fix the conditional expansion
bryce-carson Sep 5, 2024
4444fa0
Unquote the conditionally expanded macros
bryce-carson Sep 5, 2024
865299c
I'm losing my religion
bryce-carson Sep 7, 2024
e21686a
Substitute the build directory in the expanded macro `%cmake_build`
bryce-carson Sep 7, 2024
9124094
Conditionally create and change to the build directory
bryce-carson Sep 7, 2024
75fbd15
The RPM syntax disallows leading whitespace :(
bryce-carson Sep 7, 2024
f6956ab
Surround the error message with quotations, reorder the `%build` seciton
bryce-carson Sep 9, 2024
c5796c6
Fix usage of `%{error:...}` macro
bryce-carson Sep 9, 2024
fbd91ca
Remove the usage of the error macro in favour of warn
bryce-carson Sep 9, 2024
71174df
Repair non-RHEL builds
bryce-carson Sep 9, 2024
0a06cf7
Possibly fix shell script command not found: trace` issue
bryce-carson Sep 9, 2024
c58217b
Fix echo command not found issues
bryce-carson Sep 9, 2024
7434e19
Set directories manually and change to build dir
bryce-carson Sep 9, 2024
e935898
Specify where to find the installation script on RHEL 8
bryce-carson Sep 15, 2024
e7520e9
Specify installation prefix for RHEL 8
bryce-carson Sep 15, 2024
9d404a6
Push SLiM.spec
bryce-carson Sep 15, 2024
675f78f
Update prefix to include /usr/
bryce-carson Sep 15, 2024
3116d38
Update SLiM.spec CHANGELOG; increment package version
bryce-carson Sep 16, 2024
f2ec557
Revert source0 to MesserLab GitHub
bryce-carson Sep 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading