commit 27dd831c78276da5d91f90c6adede876c1b81a2b
Author: Hans de Goede <hdegoede(a)redhat.com>
Date: Fri Mar 11 13:05:15 2022 +0100
Update to 20220222 snapshot
Move to SDL2
The software renderer has regressions in recent version (crashes)
and it only works with SDL1. OpenGL is available on pretty much
every system now, so drop the software renderer
Fix FTBFS
.gitignore | 1 +
d1x-gcc12.patch | 34 ++++++++++++++++++++++++++++++++
d1x-rebirth.sh | 10 +++-------
d1x-window_icon_bitmap.patch | 16 +++++++++++++++
d1x.rpmlintrc | 2 --
d1x.spec | 46 ++++++++++++++++++++++++++++----------------
d2x-rebirth.sh | 10 +++-------
sources | 2 +-
8 files changed, 87 insertions(+), 34 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 8382445..e936a2f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ d1x-rebirth_v0.58.1-src.tar.gz
/stable-0.60.x.zip
/dxx-rebirth-af25483.tar.gz
/dxx-rebirth-1afd0ee.tar.gz
+/dxx-rebirth-7258b7f.tar.gz
diff --git a/d1x-gcc12.patch b/d1x-gcc12.patch
new file mode 100644
index 0000000..4aa43d6
--- /dev/null
+++ b/d1x-gcc12.patch
@@ -0,0 +1,34 @@
+The DXX_CONSTANT_TRUE test in common/include/partial_range.h for some
+reason triggers with gcc12 on the partial_const_range() at line 403 of
+similar/main/piggy.cpp.
+diff -up dxx-rebirth-7258b7fd5966fc38e53f4d8192b0c810829ada02/similar/main/automap.cpp~
dxx-rebirth-7258b7fd5966fc38e53f4d8192b0c810829ada02/similar/main/automap.cpp
+---
dxx-rebirth-7258b7fd5966fc38e53f4d8192b0c810829ada02/similar/main/automap.cpp~ 2022-01-30
05:40:54.000000000 +0100
++++
dxx-rebirth-7258b7fd5966fc38e53f4d8192b0c810829ada02/similar/main/automap.cpp 2022-03-09
18:33:31.539914719 +0100
+@@ -370,7 +370,7 @@ game_marker_index convert_player_marker_
+ return static_cast<game_marker_index>((player_num * MAX_DROP_MULTI_COOP) +
static_cast<unsigned>(player_marker_num));
+ if (game_mode & GM_MULTI)
+ return static_cast<game_marker_index>((player_num * MAX_DROP_MULTI_COMPETITIVE)
+ static_cast<unsigned>(player_marker_num));
+- return game_marker_index{player_marker_num};
++ return
static_cast<game_marker_index>(static_cast<unsigned>(player_marker_num));
+ }
+
+ unsigned d_marker_state::get_markers_per_player(const game_mode_flags game_mode, const
unsigned max_numplayers)
+diff -up
dxx-rebirth-7258b7fd5966fc38e53f4d8192b0c810829ada02/common/include/partial_range.h~
dxx-rebirth-7258b7fd5966fc38e53f4d8192b0c810829ada02/common/include/partial_range.h
+---
dxx-rebirth-7258b7fd5966fc38e53f4d8192b0c810829ada02/common/include/partial_range.h~ 2022-01-30
05:40:54.000000000 +0100
++++
dxx-rebirth-7258b7fd5966fc38e53f4d8192b0c810829ada02/common/include/partial_range.h 2022-03-09
19:22:42.791659611 +0100
+@@ -309,15 +309,6 @@ inline partial_range_t<iterator_type, in
+ #endif
+ iterator_type range_begin, const std::size_t index_begin, const std::size_t index_end)
+ {
+-#ifdef DXX_CONSTANT_TRUE
+- /* Compile-time only check. Runtime handles (index_begin >
+- * index_end) correctly, and it can happen in a correct program. If
+- * it is guaranteed to happen, then the range is always empty, which
+- * likely indicates a bug.
+- */
+- if (DXX_CONSTANT_TRUE(!(index_begin < index_end)))
+- DXX_ALWAYS_ERROR_FUNCTION(partial_range_is_always_empty, "offset never less than
length");
+-#endif
+ #ifdef DXX_HAVE_BUILTIN_OBJECT_SIZE
+ /* Avoid iterator dereference if range is empty */
+ if (index_end)
diff --git a/d1x-rebirth.sh b/d1x-rebirth.sh
index 7cbd346..a546305 100644
--- a/d1x-rebirth.sh
+++ b/d1x-rebirth.sh
@@ -2,17 +2,13 @@
. /usr/share/opengl-games-utils/opengl-game-functions.sh
-if hasDri; then
- D1X=/usr/bin/d1x-rebirth-gl
-else
- D1X=/usr/bin/d1x-rebirth-sdl
-fi
+checkDriOK d1x-rebirth
if [ '(' -f /usr/share/d1x/full/descent.hog -a \
-f /usr/share/d1x/full/descent.pig ')' -o \
'(' -f $HOME/.d1x-rebirth/descent.hog -a \
-f $HOME/.d1x-rebirth/descent.pig ')' ]; then
- exec $D1X "$@"
+ exec /usr/libexec/d1x-rebirth "$@"
else
- exec $D1X -hogdir /usr/share/d1x/d1shar/ "$@"
+ exec /usr/libexec/d1x-rebirth -hogdir /usr/share/d1x/d1shar/ "$@"
fi
diff --git a/d1x-window_icon_bitmap.patch b/d1x-window_icon_bitmap.patch
new file mode 100644
index 0000000..e7c366f
--- /dev/null
+++ b/d1x-window_icon_bitmap.patch
@@ -0,0 +1,16 @@
+diff -up dxx-rebirth-7258b7fd5966fc38e53f4d8192b0c810829ada02/common/include/fwd-gr.h~
dxx-rebirth-7258b7fd5966fc38e53f4d8192b0c810829ada02/common/include/fwd-gr.h
+---
dxx-rebirth-7258b7fd5966fc38e53f4d8192b0c810829ada02/common/include/fwd-gr.h~ 2022-01-30
05:40:54.000000000 +0100
++++
dxx-rebirth-7258b7fd5966fc38e53f4d8192b0c810829ada02/common/include/fwd-gr.h 2022-03-10
22:41:27.636936934 +0100
+@@ -277,10 +277,10 @@ namespace dsx {
+
+ #if defined(DXX_BUILD_DESCENT_I)
+ #define DXX_SDL_WINDOW_CAPTION "Descent"
+-#define DXX_SDL_WINDOW_ICON_BITMAP "d1x-rebirth.bmp"
++#define DXX_SDL_WINDOW_ICON_BITMAP "/usr/share/d1x/d1x-rebirth.bmp"
+ #elif defined(DXX_BUILD_DESCENT_II)
+ #define DXX_SDL_WINDOW_CAPTION "Descent II"
+-#define DXX_SDL_WINDOW_ICON_BITMAP "d2x-rebirth.bmp"
++#define DXX_SDL_WINDOW_ICON_BITMAP "/usr/share/d2x/d2x-rebirth.bmp"
+ void gr_copy_palette(palette_array_t &gr_palette, const palette_array_t &pal);
+ #endif
+
diff --git a/d1x.rpmlintrc b/d1x.rpmlintrc
index 56fa2cb..29c89a4 100644
--- a/d1x.rpmlintrc
+++ b/d1x.rpmlintrc
@@ -1,5 +1,3 @@
-# /usr/dxx/full and hog file names are not a spelling errors
-addFilter("spelling-error %description .*")
# This is why this is in rpmfusion nonfree
addFilter("W: invalid-license non-commercial")
# We don't have manpages for d1x
diff --git a/d1x.spec b/d1x.spec
index a461a26..d0cba8a 100644
--- a/d1x.spec
+++ b/d1x.spec
@@ -1,12 +1,12 @@
# Upstream does not do releases, they rely on weekly git snapshot builds
-%global snapshotdate 20210126
-%global commit 1afd0eeae2819e641ecae6a974f74e41982ca13d
+%global snapshotdate 20220222
+%global commit 7258b7fd5966fc38e53f4d8192b0c810829ada02
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Summary: Descent 1 game and shareware data files (d1x-rebirth version)
Name: d1x
Version: 1.43
-Release: 30.rebirth.%{snapshotdate}git%{shortcommit}%{?dist}
+Release: 31.rebirth.%{snapshotdate}git%{shortcommit}%{?dist}
License: non-commercial
Source0:
https://github.com/dxx-rebirth/dxx-rebirth/archive/%{commit}/dxx-rebirth-...
Source1: d1x-rebirth.sh
@@ -16,9 +16,12 @@ Source4:
https://www.icculus.org/d2x/data/d2shar10.tar.gz
Source5: d1x-rebirth.appdata.xml
Source6: d2x-rebirth.appdata.xml
Patch0: d1x-gcc10.patch
+Patch1: d1x-gcc12.patch
+Patch2: d1x-window_icon_bitmap.patch
URL:
https://www.dxx-rebirth.com/
BuildRequires: gcc gcc-c++ libpng-devel
-BuildRequires: SDL-devel SDL_mixer-devel SDL_image-devel mesa-libGL-devel
mesa-libGLU-devel
+BuildRequires: SDL2-devel SDL2_mixer-devel SDL_image-devel
+BuildRequires: mesa-libGL-devel mesa-libGLU-devel
BuildRequires: physfs-devel scons desktop-file-utils dos2unix
BuildRequires: ImageMagick libappstream-glib
Requires: opengl-games-utils >= 0.2
@@ -64,6 +67,8 @@ robots-h.mvl files to the dir.
%prep
%setup -q -n dxx-rebirth-%{commit} -a 3 -a 4
%patch0 -p1
+%patch1 -p1
+%patch2 -p1
# Fixup encoding and CTRL+Z at the end of the orderfrm.txt files
iconv -f CP850 -t UTF-8 d1shar/ORDERFRM.TXT | head -n-3 > ORDERFRM.TXT
touch -r d1shar/ORDERFRM.TXT ORDERFRM.TXT
@@ -82,26 +87,20 @@ convert d2x-rebirth/d2x-rebirth.xpm d2x-rebirth.png
%build
-COMMON_FLAGS="prefix=/usr d1x_sharepath=%{_datadir}/d1x/full
d2x_sharepath=%{_datadir}/d2x/full ipv6=1 verbosebuild=1"
export CXXFLAGS="$RPM_OPT_FLAGS"
-scons $COMMON_FLAGS opengl=0
-mv d1x-rebirth/d1x-rebirth d1x-rebirth-sdl
-mv d2x-rebirth/d2x-rebirth d2x-rebirth-sdl
-scons $COMMON_FLAGS opengl=1
-mv d1x-rebirth/d1x-rebirth d1x-rebirth-gl
-mv d2x-rebirth/d2x-rebirth d2x-rebirth-gl
+scons prefix=/usr d1x_sharepath=%{_datadir}/d1x/full d2x_sharepath=%{_datadir}/d2x/full
\
+ ipv6=1 verbosebuild=1 opengl=1 sdl2=1
%install
mkdir -p $RPM_BUILD_ROOT%{_bindir}
+mkdir -p $RPM_BUILD_ROOT%{_libexecdir}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/d1x/full
mkdir -p $RPM_BUILD_ROOT%{_datadir}/d1x/d1shar
mkdir -p $RPM_BUILD_ROOT%{_datadir}/d2x/full
mkdir -p $RPM_BUILD_ROOT%{_datadir}/d2x/d2shar
-install -m 755 d1x-rebirth-sdl $RPM_BUILD_ROOT%{_bindir}
-install -m 755 d1x-rebirth-gl $RPM_BUILD_ROOT%{_bindir}
-install -m 755 d2x-rebirth-sdl $RPM_BUILD_ROOT%{_bindir}
-install -m 755 d2x-rebirth-gl $RPM_BUILD_ROOT%{_bindir}
+install -m 755 build/d1x-rebirth/d1x-rebirth $RPM_BUILD_ROOT%{_libexecdir}/d1x-rebirth
+install -m 755 build/d2x-rebirth/d2x-rebirth $RPM_BUILD_ROOT%{_libexecdir}/d2x-rebirth
install -p -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/d1x-rebirth
install -p -m 755 %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/d2x-rebirth
# Install descent 1 shareware files
@@ -109,6 +108,9 @@ install -p -m 644 d1shar/descent.*
$RPM_BUILD_ROOT%{_datadir}/d1x/d1shar
# Install descent 2 shareware files
install -p -m 644 d2shar10/d2demo.{pig,hog,ham} \
$RPM_BUILD_ROOT%{_datadir}/d2x/d2shar
+# For SDL_LoadBMP() calls
+install -p -m 644 d1x-rebirth/d1x-rebirth.bmp $RPM_BUILD_ROOT%{_datadir}/d1x
+install -p -m 644 d2x-rebirth/d2x-rebirth.bmp $RPM_BUILD_ROOT%{_datadir}/d2x
# below is the desktop file and icon stuff.
mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
@@ -134,7 +136,8 @@ appstream-util validate-relax --nonet \
%files
%doc README.md d1x-rebirth/RELEASE-NOTES.txt
%license COPYING.txt GPL-3.txt descent1-shareware-readmes
-%{_bindir}/d1x-rebirth*
+%{_bindir}/d1x-rebirth
+%{_libexecdir}/d1x-rebirth
%{_datadir}/d1x
%{_datadir}/appdata/d1x-rebirth.appdata.xml
%{_datadir}/applications/d1x-rebirth.desktop
@@ -143,7 +146,8 @@ appstream-util validate-relax --nonet \
%files -n d2x
%doc README.md d2x-rebirth/RELEASE-NOTES.txt
%license COPYING.txt GPL-3.txt descent2-shareware-readmes
-%{_bindir}/d2x-rebirth*
+%{_bindir}/d2x-rebirth
+%{_libexecdir}/d2x-rebirth
%{_datadir}/d2x
%{_datadir}/appdata/d2x-rebirth.appdata.xml
%{_datadir}/applications/d2x-rebirth.desktop
@@ -151,6 +155,14 @@ appstream-util validate-relax --nonet \
%changelog
+* Thu Mar 10 2022 Hans de Goede <j.w.r.degoede(a)gmail.com> -
1.43-31.rebirth.20220222git7258b7f
+- Update to 20220222 snapshot
+- Move to SDL2
+- The software renderer has regressions in recent version (crashes)
+ and it only works with SDL1. OpenGL is available on pretty much
+ every system now, so drop the software renderer
+- Fix FTBFS
+
* Thu Feb 10 2022 RPM Fusion Release Engineering <sergiomb(a)rpmfusion.org> -
1.43-30.rebirth.20210126git1afd0ee
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
diff --git a/d2x-rebirth.sh b/d2x-rebirth.sh
index 0f95c7d..f85ab1e 100644
--- a/d2x-rebirth.sh
+++ b/d2x-rebirth.sh
@@ -2,11 +2,7 @@
. /usr/share/opengl-games-utils/opengl-game-functions.sh
-if hasDri; then
- D2X=/usr/bin/d2x-rebirth-gl
-else
- D2X=/usr/bin/d2x-rebirth-sdl
-fi
+checkDriOK d2x-rebirth
if [ '(' -f /usr/share/d2x/full/descent2.hog -a \
-f /usr/share/d2x/full/descent2.ham -a \
@@ -28,7 +24,7 @@ if [ '(' -f /usr/share/d2x/full/descent2.hog -a \
-f $HOME/.d2x-rebirth/groupa.pig -a \
-f $HOME/.d2x-rebirth/ice.pig -a \
-f $HOME/.d2x-rebirth/water.pig ')' ]; then
- exec $D2X "$@"
+ exec /usr/libexec/d2x-rebirth "$@"
else
- exec $D2X -hogdir /usr/share/d2x/d2shar/ "$@"
+ exec /usr/libexec/d2x-rebirth -hogdir /usr/share/d2x/d2shar/ "$@"
fi
diff --git a/sources b/sources
index b2cd9f5..add7ca3 100644
--- a/sources
+++ b/sources
@@ -1,3 +1,3 @@
-SHA512 (dxx-rebirth-1afd0ee.tar.gz) =
c12eae520fb4e29aaf1a2a2df1e500be048b150451cc164531f45a6800743d33b8a6a7ba72437d1177d20d1182b66e04dfc85943a4ebdf8eba104323601cfad8
+SHA512 (dxx-rebirth-7258b7f.tar.gz) =
ece8a72fbb34f59b72b2a138be0e8deebe0079e56de168e7743d91bc25f26960a38fa9554053faf32d74a322e76c60612b363d999868b172615343641a16165f
SHA512 (d1swdf.tar.gz) =
fa494be02e629e6772d87851a9ebdd36a64b38f5706f8290abd354919bc1b498d5162b1d7e4720948c1698c343ef17c694ddfafa926e8dc28582a7d429b4360e
SHA512 (d2shar10.tar.gz) =
8aeb7dbc5d98ae98caa22b0741309c7451d662f569a889dfaaca5c0333895144d962cbde6276a121103266f40ca73485872f9dbc2bd11405d71f2af58f553e9a