From 9464bfea0e0511d09a08d8ab0a28b97100a8959b Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Mon, 2 Sep 2024 14:11:13 -0600 Subject: [PATCH 01/28] Update SLiM.spec --- SLiM.spec | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/SLiM.spec b/SLiM.spec index e564ecb4..d068bc1b 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -1,9 +1,14 @@ # Cross-distribution SLiM RPM spec. -# Defines: %if %{defined suse_version} -%define qt5 libqt5 +%if 0%{?suse_version} < 1600 +%define qt libqt5 %else -%define qt5 qt5 +%define qt libqt6 +%endif +%endif + +%if 0%{?fedora} >= 39 +%define qt qt6 %endif Name: SLiM @@ -22,21 +27,28 @@ 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: %qt-qtbase-devel +%endif +%if 0%{?suse_version} > 1600 # only Tumbleweed officially supports Qt6 +BuildRequires: %qt-qtbase-devel %endif %else -BuildRequires: qt5-qtbase-devel +BuildRequires: %qt-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. +%if 0%{?rhel} == 8 Requires: %{qt5}-qtbase >= 5.15.1 +%else +Requries: %qt-qtbase +%endif %description SLiM is an evolutionary simulation framework that combines a powerful engine for @@ -51,6 +63,11 @@ visualization of simulation output. %prep %setup -q +# attempt to sidestep issue 440 +%if 0%{?rhel} == 8 +mkdir outputbins +%define _vpath_builddir outputbins +%endif %build %cmake -DBUILD_SLIMGUI=ON @@ -72,6 +89,12 @@ visualization of simulation output. %{_datadir}/mime/packages/org.messerlab.slimgui-mime.xml %changelog +* Mon Sep 2 2024 Bryce Carson - 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 - 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. From 6bcef4085109ad4858b77801a3486218580c3410 Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Mon, 2 Sep 2024 14:12:06 -0600 Subject: [PATCH 02/28] Update SLiM.spec --- SLiM.spec | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SLiM.spec b/SLiM.spec index d068bc1b..6d4ac518 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -32,22 +32,22 @@ BuildRequires: Mesa-libGL-devel BuildRequires: gcc-c++ BuildRequires: appstream-glib-devel %if 0%{?suse_version} < 1600 -BuildRequires: %qt-qtbase-devel +BuildRequires: %{qt}-qtbase-devel %endif %if 0%{?suse_version} > 1600 # only Tumbleweed officially supports Qt6 -BuildRequires: %qt-qtbase-devel +BuildRequires: %{qt}-qtbase-devel %endif %else -BuildRequires: %qt-qtbase-devel +BuildRequires: %{qt}-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. %if 0%{?rhel} == 8 -Requires: %{qt5}-qtbase >= 5.15.1 +Requires: %{qt}-qtbase >= 5.15.1 %else -Requries: %qt-qtbase +Requries: %{qt}-qtbase %endif %description From 5d32b93ce18c5a94d0924da6d9cb384d15f0e39d Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Wed, 4 Sep 2024 15:35:31 -0600 Subject: [PATCH 03/28] Add files via upload --- SLiM.spec | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/SLiM.spec b/SLiM.spec index 6d4ac518..150003af 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -1,14 +1,14 @@ # Cross-distribution SLiM RPM spec. %if %{defined suse_version} %if 0%{?suse_version} < 1600 -%define qt libqt5 +%global qtNameAndVersion libqt5 %else -%define qt libqt6 +%global qtNameAndVersion qt6 %endif %endif %if 0%{?fedora} >= 39 -%define qt qt6 +%global qtNameAndVersion qt6 %endif Name: SLiM @@ -32,22 +32,23 @@ BuildRequires: Mesa-libGL-devel BuildRequires: gcc-c++ BuildRequires: appstream-glib-devel %if 0%{?suse_version} < 1600 -BuildRequires: %{qt}-qtbase-devel +BuildRequires: %{qtNameAndVersion}-qtbase-devel %endif -%if 0%{?suse_version} > 1600 # only Tumbleweed officially supports Qt6 -BuildRequires: %{qt}-qtbase-devel +%if 0%{?suse_version} > 1600 +# only Tumbleweed officially supports Qt6; further, it's "base" not "qtbase" in Tumbleweed. :( +BuildRequires: %{qtNameAndVersion}-base-devel %endif %else -BuildRequires: %{qt}-qtbase-devel +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. %if 0%{?rhel} == 8 -Requires: %{qt}-qtbase >= 5.15.1 +Requires: %{qtNameAndVersion}-qtbase >= 5.15.1 %else -Requries: %{qt}-qtbase +Requires: %{qtNameAndVersion}-qtbase %endif %description @@ -89,7 +90,7 @@ mkdir outputbins %{_datadir}/mime/packages/org.messerlab.slimgui-mime.xml %changelog -* Mon Sep 2 2024 Bryce Carson - 4.3.-1 +* Mon Sep 02 2024 Bryce Carson - 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 @@ -108,7 +109,7 @@ mkdir outputbins - 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 - 4.2-1 +* Wed Mar 20 2024 Bryce Carson - 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 - 4.1-1 From ebc1ab2827985a356b2bab2676990abbd83b9705 Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Wed, 4 Sep 2024 17:01:10 -0600 Subject: [PATCH 04/28] Update SLiM.spec --- SLiM.spec | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/SLiM.spec b/SLiM.spec index 150003af..16adb528 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -7,8 +7,20 @@ %endif %endif +%if %{defined fedora} %if 0%{?fedora} >= 39 %global qtNameAndVersion qt6 +%else +%global qtNameAndVersion qt5 +%endif +%endif + +%if %{defined rhel} +%if 0%{?rhel} > 8 +%global qtNameAndVersion qt6 +%else +%global qtNameAndVersion qt5 +%endif %endif Name: SLiM From bc869205d0a1cfce5eb87b09bbaaa27a0c103812 Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Wed, 4 Sep 2024 17:10:53 -0600 Subject: [PATCH 05/28] Update SLiM.spec Try to protect RHEL 8 from whatever was happening in its build system to break stuff. --- SLiM.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SLiM.spec b/SLiM.spec index 16adb528..71e0191e 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -83,6 +83,10 @@ mkdir outputbins %endif %build +%if %_vpath_builddir == %_vpath_srcdir +%(mkdir builddir) +%global %_vpath_builddir builddir +%endif %cmake -DBUILD_SLIMGUI=ON %cmake_build From 3d0ef71eb5a240bd2902e646d02de36dfe6442ef Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Wed, 4 Sep 2024 17:13:17 -0600 Subject: [PATCH 06/28] Update SLiM.spec --- SLiM.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SLiM.spec b/SLiM.spec index 71e0191e..3016ca4f 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -30,7 +30,7 @@ Summary: an evolutionary simulation framework License: GPLv3+ URL: https://messerlab.org/slim/ -Source0: https://github.com/MesserLab/SLiM/archive/v%{version}.tar.gz +Source0: https://github.com/bryce-carson/SLiM/archive/v%{version}.tar.gz # Prevent users of the Copr repository from using Simple Login Manager, due to binary file name conflict. Conflicts: slim From 3814e9771b4b35a1e198072bab41acf79eab7722 Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Wed, 4 Sep 2024 17:27:32 -0600 Subject: [PATCH 07/28] Fix bare word issue in RHEL 8 conditional; conditionalize on RHEL 8 --- SLiM.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SLiM.spec b/SLiM.spec index 3016ca4f..830c73fb 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -83,10 +83,13 @@ mkdir outputbins %endif %build -%if %_vpath_builddir == %_vpath_srcdir +%if 0%{?rhel} == 8 +%if "%_vpath_builddir" == "%_vpath_srcdir" %(mkdir builddir) +%{error:"The build directory is the same as the source directory; even though that shouldn't be, it is what it is!"} %global %_vpath_builddir builddir %endif +%endif %cmake -DBUILD_SLIMGUI=ON %cmake_build From 53782ea5a5790b02ac88d799f22f267511d82c7d Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Wed, 4 Sep 2024 18:32:45 -0600 Subject: [PATCH 08/28] Fix BuildRequires conditionals and the global definition of builddir --- SLiM.spec | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/SLiM.spec b/SLiM.spec index 830c73fb..dd7d6e6a 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -16,7 +16,8 @@ %endif %if %{defined rhel} -%if 0%{?rhel} > 8 +%if 0%{?epel} >= 9 +# qt6 is only available through EPEL on RHEL 9 and higher %global qtNameAndVersion qt6 %else %global qtNameAndVersion qt5 @@ -45,12 +46,12 @@ BuildRequires: gcc-c++ BuildRequires: appstream-glib-devel %if 0%{?suse_version} < 1600 BuildRequires: %{qtNameAndVersion}-qtbase-devel -%endif -%if 0%{?suse_version} > 1600 +%else # only Tumbleweed officially supports Qt6; further, it's "base" not "qtbase" in Tumbleweed. :( BuildRequires: %{qtNameAndVersion}-base-devel %endif %else +# if not on openSUSE BuildRequires: %{qtNameAndVersion}-qtbase-devel BuildRequires: libappstream-glib %endif @@ -58,7 +59,7 @@ ExclusiveArch: x86_64 # RHEL 8 has the oldest point release of 5.15, and is the oldest RHEL supported. %if 0%{?rhel} == 8 -Requires: %{qtNameAndVersion}-qtbase >= 5.15.1 +Requires: qt5-qtbase >= 5.15.1 %else Requires: %{qtNameAndVersion}-qtbase %endif @@ -76,18 +77,13 @@ visualization of simulation output. %prep %setup -q -# attempt to sidestep issue 440 -%if 0%{?rhel} == 8 -mkdir outputbins -%define _vpath_builddir outputbins -%endif %build %if 0%{?rhel} == 8 %if "%_vpath_builddir" == "%_vpath_srcdir" %(mkdir builddir) %{error:"The build directory is the same as the source directory; even though that shouldn't be, it is what it is!"} -%global %_vpath_builddir builddir +%global _vpath_builddir builddir %endif %endif %cmake -DBUILD_SLIMGUI=ON From 608268c1ba548d78f7c4527b5e3487683f876d6a Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Thu, 5 Sep 2024 10:20:15 -0600 Subject: [PATCH 09/28] Specify source and build directory manually on RHEL 8 RHEL 8 does not, apparently, specify source and build directories when it calls `cmake` (not `cmake --build`, that's a different step). This causes CMake to set the source and build directories to both be the current directory; apparently this causes the macros `%_vpath_srcdir` and `%_vpath_builddir` to be ignored during `cmake --build`, which may be the ultimate cause of the issues we've encountered recently with the CMake build system on RHEL 8 builders. We'll see how this commit affects the RHEL 8 builders. It shouldn't affect the others, because when the builder is not RHEL 8 the macro `%sourceAndBuilddir` should expand to an empty string. --- SLiM.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SLiM.spec b/SLiM.spec index dd7d6e6a..d080dfc1 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -85,8 +85,9 @@ visualization of simulation output. %{error:"The build directory is the same as the source directory; even though that shouldn't be, it is what it is!"} %global _vpath_builddir builddir %endif +%global sourceAndBuilddir "-S %{_vpath_srcdir} -B %{_vpath_builddir}" %endif -%cmake -DBUILD_SLIMGUI=ON +%cmake %{sourceAndBuilddir} -DBUILD_SLIMGUI=ON %cmake_build %install From bac7b81232c910df33b7945e59807503fd3b6b5b Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Thu, 5 Sep 2024 13:30:23 -0600 Subject: [PATCH 10/28] Fix the conditional expansion --- SLiM.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SLiM.spec b/SLiM.spec index d080dfc1..0d2b53b1 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -85,9 +85,10 @@ visualization of simulation output. %{error:"The build directory is the same as the source directory; even though that shouldn't be, it is what it is!"} %global _vpath_builddir builddir %endif -%global sourceAndBuilddir "-S %{_vpath_srcdir} -B %{_vpath_builddir}" +%define sourceDirectory "-S %{_vpath_srcdir}" +%define buildDirectory "-B %{_vpath_builddir}" %endif -%cmake %{sourceAndBuilddir} -DBUILD_SLIMGUI=ON +%cmake %{?sourceDirectory:%sourceDirectory} %{?buildDirectory:%buildDirectory} -DBUILD_SLIMGUI=ON %cmake_build %install From 4444fa0b37b776bfc92533420aa505bb08838409 Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Thu, 5 Sep 2024 14:14:35 -0600 Subject: [PATCH 11/28] Unquote the conditionally expanded macros --- SLiM.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SLiM.spec b/SLiM.spec index 0d2b53b1..500f1210 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -85,8 +85,8 @@ visualization of simulation output. %{error:"The build directory is the same as the source directory; even though that shouldn't be, it is what it is!"} %global _vpath_builddir builddir %endif -%define sourceDirectory "-S %{_vpath_srcdir}" -%define buildDirectory "-B %{_vpath_builddir}" +%define sourceDirectory -S %{_vpath_srcdir} +%define buildDirectory -B %{_vpath_builddir} %endif %cmake %{?sourceDirectory:%sourceDirectory} %{?buildDirectory:%buildDirectory} -DBUILD_SLIMGUI=ON %cmake_build From 865299c97994815d87bd99f0dccd35a41377d8c7 Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Sat, 7 Sep 2024 00:06:49 -0600 Subject: [PATCH 12/28] I'm losing my religion --- SLiM.spec | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/SLiM.spec b/SLiM.spec index 500f1210..9994f6c8 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -79,16 +79,10 @@ visualization of simulation output. %setup -q %build -%if 0%{?rhel} == 8 -%if "%_vpath_builddir" == "%_vpath_srcdir" -%(mkdir builddir) -%{error:"The build directory is the same as the source directory; even though that shouldn't be, it is what it is!"} -%global _vpath_builddir builddir -%endif -%define sourceDirectory -S %{_vpath_srcdir} -%define buildDirectory -B %{_vpath_builddir} +%if 0%{?rhel} == 8 && "%_vpath_builddir" == "%_vpath_srcdir" +%error The build directory is the same as the source directory; even though that shouldn't be, it is what it is! %endif -%cmake %{?sourceDirectory:%sourceDirectory} %{?buildDirectory:%buildDirectory} -DBUILD_SLIMGUI=ON +%cmake -DBUILD_SLIMGUI=ON %cmake_build %install From e21686aae9fcf209480619e09a9508ae963097c4 Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Sat, 7 Sep 2024 11:18:50 -0600 Subject: [PATCH 13/28] Substitute the build directory in the expanded macro `%cmake_build` This may or may not work. RPM syntax is a little confusing (beyond the basics). --- SLiM.spec | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/SLiM.spec b/SLiM.spec index 9994f6c8..69f07d2d 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -79,11 +79,21 @@ visualization of simulation output. %setup -q %build +%define errmsg The build directory is the same as the source directory; even though that shouldn't be, it is what it is! %if 0%{?rhel} == 8 && "%_vpath_builddir" == "%_vpath_srcdir" -%error The build directory is the same as the source directory; even though that shouldn't be, it is what it is! +%error %errmsg %endif %cmake -DBUILD_SLIMGUI=ON +%if 0%{?rhel} == 8 && "%_vpath_builddir" != "%_vpath_srcdir" +%if "." == "%_vpath_builddir" +%error %errmsg +%endif +cd %_vpath_builddir +%{lua string.gsub(%{macrobody %{cmake_build}}, "--build .", "--build %_vpath_builddir")} +%else +# Not on RHEL 8 %cmake_build +%endif %install %cmake_install From 91240944b3bf84216e87d5cc8654827d64ca29e2 Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Sat, 7 Sep 2024 16:59:44 -0600 Subject: [PATCH 14/28] Conditionally create and change to the build directory While connected to a COPR VM and chrooted into an EPEL 8 environment, it appears that the EPEL 8 build environment has a CMake which: 1. Isn't directed to create an out of source build, for whatever reason (I had troubles determining exactly what was going on) 2. Assumes that the current directory is both the source and build directory (the current directory being the source directory which is changed to by rpmbuild automatically, I think). As far as I can tell, the easiest way around issue #440 to enable #465 and #468 is to make the build directory and change to it before calling cmake --build, but this only works if we manually specify the source and build directory when calling `%cmake`, which shouldn't be too delicate, as long as the definition of `%cmake` doesn't include source and build directories on other distributions. I'm out of practice with rpmbuild and COPR's finer details, or I never was practiced in using these at this level, and I don't know a better way of debugging the build process at this point after investigating through SSH than to just submit a new build. I got stuck trying to create a new SRPM with the edited spec file. It's easier to just edit on GitHub like this and have an automatic build tell me if things are going to work as I expect this might. If it doesn't then I'm calling in reinforcements to investigate the issue for me and offer their support (the Fedora community!). --- SLiM.spec | 81 ++++++++++++++++++++++++++----------------------------- 1 file changed, 38 insertions(+), 43 deletions(-) diff --git a/SLiM.spec b/SLiM.spec index 69f07d2d..c1b6b571 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -1,27 +1,27 @@ # Cross-distribution SLiM RPM spec. %if %{defined suse_version} -%if 0%{?suse_version} < 1600 -%global qtNameAndVersion libqt5 -%else -%global qtNameAndVersion qt6 -%endif + %if 0%{?suse_version} < 1600 + %global qtNameAndVersion libqt5 + %else + %global qtNameAndVersion qt6 + %endif %endif %if %{defined fedora} -%if 0%{?fedora} >= 39 -%global qtNameAndVersion qt6 -%else -%global qtNameAndVersion qt5 -%endif + %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 + %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 @@ -40,28 +40,28 @@ Conflicts: slim BuildRequires: cmake # openSUSE Build Requires %if %{defined suse_version} -BuildRequires: glew-devel -BuildRequires: Mesa-libGL-devel -BuildRequires: gcc-c++ -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 + BuildRequires: glew-devel + BuildRequires: Mesa-libGL-devel + BuildRequires: gcc-c++ + 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 -# if not on openSUSE -BuildRequires: %{qtNameAndVersion}-qtbase-devel -BuildRequires: libappstream-glib + # 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. %if 0%{?rhel} == 8 -Requires: qt5-qtbase >= 5.15.1 + Requires: qt5-qtbase >= 5.15.1 %else -Requires: %{qtNameAndVersion}-qtbase + Requires: %{qtNameAndVersion}-qtbase %endif %description @@ -79,22 +79,17 @@ visualization of simulation output. %setup -q %build -%define errmsg The build directory is the same as the source directory; even though that shouldn't be, it is what it is! -%if 0%{?rhel} == 8 && "%_vpath_builddir" == "%_vpath_srcdir" -%error %errmsg -%endif -%cmake -DBUILD_SLIMGUI=ON +%cmake -S %_vpath_srcdir -B %_vpath_builddir -DBUILD_SLIMGUI=ON + %if 0%{?rhel} == 8 && "%_vpath_builddir" != "%_vpath_srcdir" -%if "." == "%_vpath_builddir" -%error %errmsg -%endif -cd %_vpath_builddir -%{lua string.gsub(%{macrobody %{cmake_build}}, "--build .", "--build %_vpath_builddir")} + mkdir -p %_vpath_builddir + cd %_vpath_builddir %else -# Not on RHEL 8 -%cmake_build + %error The build directory is the same as the source directory; even though that shouldn't be, it is what it is! %endif +%cmake_build + %install %cmake_install From 75fbd156ecef91312690473a3f5fec2fc302914d Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Sat, 7 Sep 2024 17:02:55 -0600 Subject: [PATCH 15/28] The RPM syntax disallows leading whitespace :( Big sad --- SLiM.spec | 68 +++++++++++++++++++++++++++---------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/SLiM.spec b/SLiM.spec index c1b6b571..d70cedb9 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -1,27 +1,27 @@ # Cross-distribution SLiM RPM spec. %if %{defined suse_version} - %if 0%{?suse_version} < 1600 - %global qtNameAndVersion libqt5 - %else - %global qtNameAndVersion qt6 - %endif +%if 0%{?suse_version} < 1600 +%global qtNameAndVersion libqt5 +%else +%global qtNameAndVersion qt6 +%endif %endif %if %{defined fedora} - %if 0%{?fedora} >= 39 - %global qtNameAndVersion qt6 - %else - %global qtNameAndVersion qt5 - %endif +%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 +%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 @@ -40,28 +40,28 @@ Conflicts: slim BuildRequires: cmake # openSUSE Build Requires %if %{defined suse_version} - BuildRequires: glew-devel - BuildRequires: Mesa-libGL-devel - BuildRequires: gcc-c++ - 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 +BuildRequires: glew-devel +BuildRequires: Mesa-libGL-devel +BuildRequires: gcc-c++ +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 - # if not on openSUSE - BuildRequires: %{qtNameAndVersion}-qtbase-devel - BuildRequires: libappstream-glib +# 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. %if 0%{?rhel} == 8 - Requires: qt5-qtbase >= 5.15.1 +Requires: qt5-qtbase >= 5.15.1 %else - Requires: %{qtNameAndVersion}-qtbase +Requires: %{qtNameAndVersion}-qtbase %endif %description @@ -82,10 +82,10 @@ visualization of simulation output. %cmake -S %_vpath_srcdir -B %_vpath_builddir -DBUILD_SLIMGUI=ON %if 0%{?rhel} == 8 && "%_vpath_builddir" != "%_vpath_srcdir" - mkdir -p %_vpath_builddir - cd %_vpath_builddir +mkdir -p %_vpath_builddir +cd %_vpath_builddir %else - %error The build directory is the same as the source directory; even though that shouldn't be, it is what it is! +%error The build directory is the same as the source directory; even though that shouldn't be, it is what it is! %endif %cmake_build From f6956abf2e8e2831052304bcfc0d180d6b0f660a Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Mon, 9 Sep 2024 11:38:15 -0600 Subject: [PATCH 16/28] Surround the error message with quotations, reorder the `%build` seciton --- SLiM.spec | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/SLiM.spec b/SLiM.spec index d70cedb9..7b2481cb 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -79,15 +79,14 @@ visualization of simulation output. %setup -q %build -%cmake -S %_vpath_srcdir -B %_vpath_builddir -DBUILD_SLIMGUI=ON - %if 0%{?rhel} == 8 && "%_vpath_builddir" != "%_vpath_srcdir" mkdir -p %_vpath_builddir cd %_vpath_builddir %else -%error The build directory is the same as the source directory; even though that shouldn't be, it is what it is! +%error "The build directory is the same as the source directory; even though that shouldn't be, it is what it is!" %endif +%cmake -S %_vpath_srcdir -B %_vpath_builddir -DBUILD_SLIMGUI=ON %cmake_build %install From c5796c6751f4dcf0176667cbfbd78de72223f5b9 Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Mon, 9 Sep 2024 11:52:57 -0600 Subject: [PATCH 17/28] Fix usage of `%{error:...}` macro --- SLiM.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SLiM.spec b/SLiM.spec index 7b2481cb..4481ec19 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -83,7 +83,7 @@ visualization of simulation output. mkdir -p %_vpath_builddir cd %_vpath_builddir %else -%error "The build directory is the same as the source directory; even though that shouldn't be, it is what it is!" +%{error "The build directory is the same as the source directory; even though that shouldn't be, it is what it is!"} %endif %cmake -S %_vpath_srcdir -B %_vpath_builddir -DBUILD_SLIMGUI=ON From fbd91cab481b660b23ec9cd910a6485021e05e36 Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Mon, 9 Sep 2024 12:40:00 -0600 Subject: [PATCH 18/28] Remove the usage of the error macro in favour of warn --- SLiM.spec | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/SLiM.spec b/SLiM.spec index 4481ec19..766888b7 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -79,11 +79,26 @@ visualization of simulation output. %setup -q %build -%if 0%{?rhel} == 8 && "%_vpath_builddir" != "%_vpath_srcdir" +%if 0%{?rhel} == 8 +%echo "Enabling trace..." +%trace +%echo "Dumping using the %%dump macro..." +%dump +%echo "Dumping using the rpm commands documented in the RHEL 8 Packaging and Distributing Software documentation..." +# see https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/8/html-single/packaging_and_distributing_software/index#displaying-the-built-in-macros_more-on-macros +rpm --showrc +rpm -ql rpm + +%if "%_vpath_builddir" != "%_vpath_srcdir" +%{echo current directory: %(pwd)} +%{echo source directory: %_vpath_srcdir} +%{echo build directory: %_vpath_builddir} mkdir -p %_vpath_builddir cd %_vpath_builddir %else -%{error "The build directory is the same as the source directory; even though that shouldn't be, it is what it is!"} +%{warn "The build directory is the same as the source directory on RHEL 8!"} +%endif + %endif %cmake -S %_vpath_srcdir -B %_vpath_builddir -DBUILD_SLIMGUI=ON From 71174df9d815e014f58f5a67b876307c558c0791 Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Mon, 9 Sep 2024 13:01:03 -0600 Subject: [PATCH 19/28] Repair non-RHEL builds --- SLiM.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SLiM.spec b/SLiM.spec index 766888b7..ec0ceae5 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -99,9 +99,13 @@ cd %_vpath_builddir %{warn "The build directory is the same as the source directory on RHEL 8!"} %endif +%cmake -S %_vpath_srcdir -B %_vpath_builddir -DBUILD_SLIMGUI=ON + +%else +# rpmbuild is not running on RHEL 8 +%cmake -DBUILD_SLIMGUI=ON %endif -%cmake -S %_vpath_srcdir -B %_vpath_builddir -DBUILD_SLIMGUI=ON %cmake_build %install From 0a06cf77b9d937d4959e61a76a172c6e8e2b6f4a Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Mon, 9 Sep 2024 13:11:34 -0600 Subject: [PATCH 20/28] Possibly fix shell script command not found: trace` issue --- SLiM.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SLiM.spec b/SLiM.spec index ec0ceae5..ba2cd4a1 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -80,14 +80,14 @@ visualization of simulation output. %build %if 0%{?rhel} == 8 -%echo "Enabling trace..." -%trace -%echo "Dumping using the %%dump macro..." -%dump +%echo "========= PRE DUMP =========" +%echo "Enabling %{?trace:%trace}..." +%echo "Dumping using the %dump macro..." %echo "Dumping using the rpm commands documented in the RHEL 8 Packaging and Distributing Software documentation..." # see https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/8/html-single/packaging_and_distributing_software/index#displaying-the-built-in-macros_more-on-macros rpm --showrc rpm -ql rpm +%echo "========= POST DUMP =========" %if "%_vpath_builddir" != "%_vpath_srcdir" %{echo current directory: %(pwd)} From c58217b72bb319c32996a67edc6754d63af8b8ca Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Mon, 9 Sep 2024 13:28:37 -0600 Subject: [PATCH 21/28] Fix echo command not found issues --- SLiM.spec | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/SLiM.spec b/SLiM.spec index ba2cd4a1..48eb5e3a 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -80,25 +80,21 @@ visualization of simulation output. %build %if 0%{?rhel} == 8 -%echo "========= PRE DUMP =========" -%echo "Enabling %{?trace:%trace}..." -%echo "Dumping using the %dump macro..." -%echo "Dumping using the rpm commands documented in the RHEL 8 Packaging and Distributing Software documentation..." -# see https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/8/html-single/packaging_and_distributing_software/index#displaying-the-built-in-macros_more-on-macros +echo "========= PRE DUMP =========" rpm --showrc rpm -ql rpm -%echo "========= POST DUMP =========" +echo "========= POST DUMP =========" %if "%_vpath_builddir" != "%_vpath_srcdir" -%{echo current directory: %(pwd)} -%{echo source directory: %_vpath_srcdir} -%{echo build directory: %_vpath_builddir} +echo "current directory: %(pwd)" +echo "source directory: %_vpath_srcdir" +echo "build directory: %_vpath_builddir" mkdir -p %_vpath_builddir -cd %_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 %else From 7434e198ab2b771f087acfa671a33d73df561120 Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Mon, 9 Sep 2024 14:54:51 -0600 Subject: [PATCH 22/28] Set directories manually and change to build dir --- SLiM.spec | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/SLiM.spec b/SLiM.spec index 48eb5e3a..83bd1df8 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -80,11 +80,6 @@ visualization of simulation output. %build %if 0%{?rhel} == 8 -echo "========= PRE DUMP =========" -rpm --showrc -rpm -ql rpm -echo "========= POST DUMP =========" - %if "%_vpath_builddir" != "%_vpath_srcdir" echo "current directory: %(pwd)" echo "source directory: %_vpath_srcdir" @@ -96,7 +91,7 @@ mkdir -p %_vpath_builddir ## 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 From e93589808fcef4c04d4a4be9a1d3f2fb6d2d95c2 Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Sat, 14 Sep 2024 19:48:26 -0600 Subject: [PATCH 23/28] Specify where to find the installation script on RHEL 8 --- SLiM.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SLiM.spec b/SLiM.spec index 83bd1df8..ecad647a 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -100,7 +100,11 @@ cd %_vpath_builddir %cmake_build %install +%if 0%{?rhel} == 8 +cmake --install %_vpath_builddir +%else %cmake_install +%endif %files %{_bindir}/eidos From e7520e931679896c9b9875234b7a39ea0a2fe4ce Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Sun, 15 Sep 2024 12:49:10 -0600 Subject: [PATCH 24/28] Specify installation prefix for RHEL 8 https://docs.fedoraproject.org/en-US/packaging-guidelines/RPMMacros/#_macros_set_for_the_rpm_and_srpm_build_process --- SLiM.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SLiM.spec b/SLiM.spec index ecad647a..7e904181 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -101,7 +101,7 @@ cd %_vpath_builddir %install %if 0%{?rhel} == 8 -cmake --install %_vpath_builddir +cmake --install %_vpath_builddir --prefix %{buildroot} %else %cmake_install %endif From 9d404a6ebe6fab0a35f135e643f9a3c7b01aa318 Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Sun, 15 Sep 2024 12:53:55 -0600 Subject: [PATCH 25/28] Push SLiM.spec --- SLiM.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/SLiM.spec b/SLiM.spec index 7e904181..58c0540c 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -1,3 +1,4 @@ + # Cross-distribution SLiM RPM spec. %if %{defined suse_version} %if 0%{?suse_version} < 1600 From 675f78ff1eff8ceeab9d229aa1e6169310226674 Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Sun, 15 Sep 2024 13:20:42 -0600 Subject: [PATCH 26/28] Update prefix to include /usr/ --- SLiM.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SLiM.spec b/SLiM.spec index 58c0540c..b3be6949 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -102,7 +102,7 @@ cd %_vpath_builddir %install %if 0%{?rhel} == 8 -cmake --install %_vpath_builddir --prefix %{buildroot} +cmake --install %_vpath_builddir --prefix %{buildroot}/usr %else %cmake_install %endif From 3116d3805ea46290c896cd747292296c761e6c69 Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Sun, 15 Sep 2024 23:20:39 -0600 Subject: [PATCH 27/28] Update SLiM.spec CHANGELOG; increment package version --- SLiM.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SLiM.spec b/SLiM.spec index b3be6949..d8793e97 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -1,4 +1,3 @@ - # Cross-distribution SLiM RPM spec. %if %{defined suse_version} %if 0%{?suse_version} < 1600 @@ -120,7 +119,11 @@ cmake --install %_vpath_builddir --prefix %{buildroot}/usr %{_datadir}/mime/packages/org.messerlab.slimgui-mime.xml %changelog -* Mon Sep 02 2024 Bryce Carson - 4.3.-1 +* Sun Sep 15 2024 Bryce Carson - 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 - 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 From f2ec5573d849f980f25a9c113fac1f906d983a8e Mon Sep 17 00:00:00 2001 From: Bryce <51974245+bryce-carson@users.noreply.github.com> Date: Mon, 16 Sep 2024 21:15:14 -0600 Subject: [PATCH 28/28] Revert source0 to MesserLab GitHub --- SLiM.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SLiM.spec b/SLiM.spec index d8793e97..39747c7a 100644 --- a/SLiM.spec +++ b/SLiM.spec @@ -31,7 +31,7 @@ Summary: an evolutionary simulation framework License: GPLv3+ URL: https://messerlab.org/slim/ -Source0: https://github.com/bryce-carson/SLiM/archive/v%{version}.tar.gz +Source0: https://github.com/MesserLab/SLiM/archive/v%{version}.tar.gz # Prevent users of the Copr repository from using Simple Login Manager, due to binary file name conflict. Conflicts: slim