Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with distfiles
@ 2022-11-26 17:07 kruceter
  2022-12-03 13:01 ` [PR REVIEW] " paper42
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: kruceter @ 2022-11-26 17:07 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1136 bytes --]

There is a new pull request by kruceter against master on the void-packages repository

https://github.com/kruceter/void-packages stepmania
https://github.com/void-linux/void-packages/pull/40783

stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with distfiles
If ffmpeg with specific version is not present in the work source directory, cmake attempts to clone its repository with git and check out version 2.1.3. This approach presents two issues:

1. It can no longer be cloned using git:// for github (see https://github.com/stepmania/stepmania/pull/2200) which results in connection timeout and build failure as the result.

2. Downloaded tarball is erased after successful build since it is considered to be part of the source code.
Its retrieval and storage for future use should be done by xbps-src.

cc: @the-maldridge as the current maintainer of the package.

#### Testing the changes
- I tested the changes in this PR: **briefly**

#### Local build testing
- I built this PR locally for my native architecture, x86_64

A patch file from https://github.com/void-linux/void-packages/pull/40783.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-stepmania-40783.patch --]
[-- Type: text/x-diff, Size: 6611 bytes --]

From dab82015ffdc2c0cf3a5bdab81a980d7d76d229a Mon Sep 17 00:00:00 2001
From: Krul Ceter <kruceter@proton.me>
Date: Sat, 26 Nov 2022 19:44:10 +0300
Subject: [PATCH] stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with
 distfiles

If ffmpeg with specific version is not present in the work source
directory, cmake attempts to clone its repository with git and
check out version 2.1.3. This approach presents two issues:

1. It can no longer be cloned using git:// for github (see
https://github.com/stepmania/stepmania/pull/2200) which results in
connection timeout and build failure as the result.

2. Downloaded tarball is erased after successful build since it is
considered to be part of the source code.
Its retrieval and storage for future use should be done by xbps-src.
---
 srcpkgs/stepmania/patches/flags.patch  |  4 +-
 srcpkgs/stepmania/patches/newgcc.patch | 79 ++++++++++++++++++++++++--
 srcpkgs/stepmania/template             | 18 ++++--
 3 files changed, 91 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/stepmania/patches/flags.patch b/srcpkgs/stepmania/patches/flags.patch
index c7ded8e0dd28..8f2d8ff226c8 100644
--- a/srcpkgs/stepmania/patches/flags.patch
+++ b/srcpkgs/stepmania/patches/flags.patch
@@ -1,5 +1,5 @@
---- a/CMakeLists.txt	2016-09-15 01:51:53.168404310 -0500
-+++ b/CMakeLists.txt	2016-09-15 16:00:14.326726871 -0500
+--- a/stepmania/CMakeLists.txt	2016-09-15 01:51:53.168404310 -0500
++++ b/stepmania/CMakeLists.txt	2016-09-15 16:00:14.326726871 -0500
 @@ -4,6 +4,11 @@
  
  include (StepmaniaCore.cmake)
diff --git a/srcpkgs/stepmania/patches/newgcc.patch b/srcpkgs/stepmania/patches/newgcc.patch
index 7698a266c9e1..f6b81d0f118a 100644
--- a/srcpkgs/stepmania/patches/newgcc.patch
+++ b/srcpkgs/stepmania/patches/newgcc.patch
@@ -1,7 +1,7 @@
 Upstream: yes
 https://github.com/stepmania/stepmania/commit/3f64564dd7c62a2f3d9557c1bdb8475fd953abea
---- a/src/MessageManager.cpp
-+++ b/src/MessageManager.cpp
+--- a/stepmania/src/MessageManager.cpp
++++ b/stepmania/src/MessageManager.cpp
 @@ -207,8 +207,7 @@ void MessageManager::Unsubscribe( IMessageSubscriber* pSubscriber, MessageID m )
 
  void MessageManager::Broadcast( Message &msg ) const
@@ -12,8 +12,8 @@ https://github.com/stepmania/stepmania/commit/3f64564dd7c62a2f3d9557c1bdb8475fd9
  	{
  		LOG->Trace("MESSAGEMAN:Broadcast: %s", msg.GetName().c_str());
  	}
---- a/src/StepMania.cpp
-+++ b/src/StepMania.cpp
+--- a/stepmania/src/StepMania.cpp
++++ b/stepmania/src/StepMania.cpp
 @@ -1041,8 +1041,10 @@ int sm_main(int argc, char* argv[])
  	// This needs PREFSMAN.
  	Dialog::Init();
@@ -34,3 +34,74 @@ https://github.com/stepmania/stepmania/commit/3f64564dd7c62a2f3d9557c1bdb8475fd9
  	STATSMAN	= new StatsManager;
 
  	// Initialize which courses are ranking courses here.
+
+Backported from
+https://github.com/stepmania/stepmania/commit/8ab7c7fab937acc684392b909b6b30b47d9a8c7b
+
+--- a/stepmania/src/NoteData.h
++++ b/stepmania/src/NoteData.h
+@@ -375,7 +375,13 @@ public:
+ /** @brief Allow a quick way to swap notedata. */
+ namespace std
+ {
+-	template<> inline void swap<NoteData>( NoteData &nd1, NoteData &nd2 ) { nd1.swap( nd2 ); }
++	template<> inline void swap<NoteData>( NoteData &nd1, NoteData &nd2 )
++#if !defined(_MSC_VER)
++	noexcept(is_nothrow_move_constructible<NoteData>::value && is_nothrow_move_assignable<NoteData>::value)
++#endif
++	{
++		nd1.swap( nd2 );
++	}
+ }
+ 
+ #endif
+--- a/stepmania/src/arch/ArchHooks/ArchHooks.h
++++ b/stepmania/src/arch/ArchHooks/ArchHooks.h
+@@ -1,6 +1,8 @@
+ #ifndef ARCH_HOOKS_H
+ #define ARCH_HOOKS_H
+ 
++#include <ctime>
++
+ struct lua_State;
+ class ArchHooks
+ {
+--- a/stepmania/src/archutils/Unix/AssertionHandler.cpp
++++ b/stepmania/src/archutils/Unix/AssertionHandler.cpp
+@@ -46,18 +46,28 @@ extern "C" void __assert_perror_fail( int errnum, const char *file, unsigned int
+ 
+ /* Catch unhandled C++ exceptions.  Note that this works in g++ even with -fno-exceptions, in
+  * which case it'll be called if any exceptions are thrown at all. */
+-#include <cxxabi.h>
+ void UnexpectedExceptionHandler()
+ {
+-	type_info *pException = abi::__cxa_current_exception_type();
+-	char const *pName = pException->name();
+-	int iStatus = -1;
+-	char *pDem = abi::__cxa_demangle( pName, 0, 0, &iStatus );
+-
+-	const RString error = ssprintf("Unhandled exception: %s", iStatus? pName:pDem);
++	std::exception_ptr exptr = std::current_exception();
++	try
++	{
++		std::rethrow_exception(exptr);
++	}
++	catch (std::exception &ex)
++	{
++#if defined(CRASH_HANDLER)
++		const RString error = ssprintf("Unhandled exception: %s", ex.what());
++		sm_crash( error );
++#endif
++	}
++	// TODO: Don't throw anything not subclassing std::exception
++	catch(...)
++	{
+ #if defined(CRASH_HANDLER)
+-	sm_crash( error );
++		const RString error = ssprintf("Unknown exception.");
++		sm_crash( error );
+ #endif
++	}
+ }
+ 
+ void InstallExceptionHandler()
diff --git a/srcpkgs/stepmania/template b/srcpkgs/stepmania/template
index 07afdba93ce6..daee2bee0442 100644
--- a/srcpkgs/stepmania/template
+++ b/srcpkgs/stepmania/template
@@ -2,18 +2,23 @@
 pkgname=stepmania
 version=5.0.12
 revision=3
+# see CMake/SetupFfmpeg.cmake in the source code
+_ffmpeg_ver=2.1.3
+build_wrksrc=${pkgname}
 build_style=cmake
 make_cmd=make
 cmake_builddir="Build"
-hostmakedepends="nasm yasm pkg-config git"
+hostmakedepends="nasm yasm pkg-config"
 makedepends="libmad-devel libvorbis-devel pcre-devel libjpeg-turbo-devel
 alsa-lib-devel libXrandr-devel libva-devel glew-devel"
 short_desc="Advanced rhythm game"
 maintainer="Michael Aldridge <maldridge@voidlinux.org>"
 license="MIT"
 homepage="http://www.stepmania.com/"
-distfiles="https://github.com/stepmania/stepmania/archive/v${version}.tar.gz"
-checksum=df79bcadd69d4ed60cf560d45386ec275181343495ffd744c3ff8f73c83d4755
+distfiles="https://github.com/stepmania/stepmania/archive/v${version}.tar.gz
+https://github.com/FFmpeg/FFmpeg/archive/n${_ffmpeg_ver}.tar.gz"
+checksum="df79bcadd69d4ed60cf560d45386ec275181343495ffd744c3ff8f73c83d4755
+ cfafef9c9fb2581ac234fc11da97c677e5a911db4e16b341ab724b7e6aa03b62"
 
 # Upstream has stated that only x86 hardware can meed the performance
 # constraints and that musl is not supported due to interop issues
@@ -22,8 +27,13 @@ archs="i686 x86_64"
 
 export CMAKE_GENERATOR="Unix Makefiles"
 
+post_extract() {
+	mv ${pkgname}-${version} ${build_wrksrc}
+	mv FFmpeg-n${_ffmpeg_ver} ${build_wrksrc}/extern/ffmpeg-linux-${_ffmpeg_ver}
+}
+
 post_install() {
-	vlicense Docs/Licenses.txt
+	vlicense Docs/Licenses.txt LICENSE
 
 	mkdir -p ${DESTDIR}/usr/bin
 	cd ${DESTDIR}

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PR REVIEW] stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with distfiles
  2022-11-26 17:07 [PR PATCH] stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with distfiles kruceter
                   ` (2 preceding siblings ...)
  2022-12-03 13:01 ` paper42
@ 2022-12-03 13:01 ` paper42
  2022-12-03 13:01 ` paper42
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: paper42 @ 2022-12-03 13:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 205 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/40783#discussion_r1038774133

Comment:
revbump, we are changing at least the location of LICENSE

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PR REVIEW] stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with distfiles
  2022-11-26 17:07 [PR PATCH] stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with distfiles kruceter
  2022-12-03 13:01 ` [PR REVIEW] " paper42
@ 2022-12-03 13:01 ` paper42
  2022-12-03 13:01 ` paper42
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: paper42 @ 2022-12-03 13:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 238 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/40783#discussion_r1038774123

Comment:
these changes are not necessary if you set `patch_args="-Np1 --directory=${build_wrksrc}"`

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PR REVIEW] stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with distfiles
  2022-11-26 17:07 [PR PATCH] stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with distfiles kruceter
                   ` (4 preceding siblings ...)
  2022-12-03 13:01 ` paper42
@ 2022-12-03 13:01 ` paper42
  2022-12-03 14:15 ` [PR PATCH] [Updated] " kruceter
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: paper42 @ 2022-12-03 13:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 200 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/40783#discussion_r1038774444

Comment:
no need for this with patch_args I mentioned before.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PR REVIEW] stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with distfiles
  2022-11-26 17:07 [PR PATCH] stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with distfiles kruceter
  2022-12-03 13:01 ` [PR REVIEW] " paper42
  2022-12-03 13:01 ` paper42
@ 2022-12-03 13:01 ` paper42
  2022-12-03 13:01 ` paper42
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: paper42 @ 2022-12-03 13:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 294 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/40783#discussion_r1038774254

Comment:
continuations like this one should be indented by one space
```suggestion
 https://github.com/FFmpeg/FFmpeg/archive/n${_ffmpeg_ver}.tar.gz"
```

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PR REVIEW] stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with distfiles
  2022-11-26 17:07 [PR PATCH] stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with distfiles kruceter
                   ` (3 preceding siblings ...)
  2022-12-03 13:01 ` paper42
@ 2022-12-03 13:01 ` paper42
  2022-12-03 13:01 ` paper42
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: paper42 @ 2022-12-03 13:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 236 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/40783#discussion_r1038774020

Comment:
this is not true anymore, you added a new part, could you move that to a separate patch?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PR REVIEW] stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with distfiles
  2022-11-26 17:07 [PR PATCH] stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with distfiles kruceter
@ 2022-12-03 13:01 ` paper42
  2022-12-03 13:01 ` paper42
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: paper42 @ 2022-12-03 13:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 252 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/40783#discussion_r1038774481

Comment:
```suggestion
build_wrksrc="${pkgname}-${wrksrc}"
```
+ the patch_args modification mentioned earlier

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PR PATCH] [Updated] stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with distfiles
  2022-11-26 17:07 [PR PATCH] stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with distfiles kruceter
                   ` (5 preceding siblings ...)
  2022-12-03 13:01 ` paper42
@ 2022-12-03 14:15 ` kruceter
  2022-12-03 14:21 ` kruceter
  2022-12-03 19:03 ` [PR PATCH] [Merged]: " paper42
  8 siblings, 0 replies; 10+ messages in thread
From: kruceter @ 2022-12-03 14:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1141 bytes --]

There is an updated pull request by kruceter against master on the void-packages repository

https://github.com/kruceter/void-packages stepmania
https://github.com/void-linux/void-packages/pull/40783

stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with distfiles
If ffmpeg with specific version is not present in the work source directory, cmake attempts to clone its repository with git and check out version 2.1.3. This approach presents two issues:

1. It can no longer be cloned using git:// for github (see https://github.com/stepmania/stepmania/pull/2200) which results in connection timeout and build failure as the result.

2. Downloaded tarball is erased after successful build since it is considered to be part of the source code.
Its retrieval and storage for future use should be done by xbps-src.

cc: @the-maldridge as the current maintainer of the package.

#### Testing the changes
- I tested the changes in this PR: **briefly**

#### Local build testing
- I built this PR locally for my native architecture, x86_64

A patch file from https://github.com/void-linux/void-packages/pull/40783.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-stepmania-40783.patch --]
[-- Type: text/x-diff, Size: 10479 bytes --]

From 665d49a364a0d04b5e0887d8713b7bcbc9a2df1c Mon Sep 17 00:00:00 2001
From: Krul Ceter <kruceter@proton.me>
Date: Sat, 26 Nov 2022 19:44:10 +0300
Subject: [PATCH] stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with
 distfiles

If ffmpeg with specific version is not present in the work source
directory, cmake attempts to clone its repository with git and
check out version 2.1.3. This approach presents two issues:

1. It can no longer be cloned using git:// for github (see
https://github.com/stepmania/stepmania/pull/2200) which results in
connection timeout and build failure as the result.

2. Downloaded tarball is erased after successful build since it is
considered to be part of the source code.
Its retrieval and storage for future use should be done by xbps-src.
---
 srcpkgs/stepmania/patches/gcc-12.patch     |  70 ++++++++++++++
 srcpkgs/stepmania/patches/messageman.patch | 107 +++++++++++++++++++++
 srcpkgs/stepmania/patches/newgcc.patch     |  36 -------
 srcpkgs/stepmania/template                 |  20 +++-
 4 files changed, 192 insertions(+), 41 deletions(-)
 create mode 100644 srcpkgs/stepmania/patches/gcc-12.patch
 create mode 100644 srcpkgs/stepmania/patches/messageman.patch
 delete mode 100644 srcpkgs/stepmania/patches/newgcc.patch

diff --git a/srcpkgs/stepmania/patches/gcc-12.patch b/srcpkgs/stepmania/patches/gcc-12.patch
new file mode 100644
index 000000000000..788504fb9397
--- /dev/null
+++ b/srcpkgs/stepmania/patches/gcc-12.patch
@@ -0,0 +1,70 @@
+Backported from
+https://github.com/stepmania/stepmania/commit/8ab7c7fab937acc684392b909b6b30b47d9a8c7b
+
+--- a/src/NoteData.h
++++ b/src/NoteData.h
+@@ -375,7 +375,13 @@ public:
+ /** @brief Allow a quick way to swap notedata. */
+ namespace std
+ {
+-	template<> inline void swap<NoteData>( NoteData &nd1, NoteData &nd2 ) { nd1.swap( nd2 ); }
++	template<> inline void swap<NoteData>( NoteData &nd1, NoteData &nd2 )
++#if !defined(_MSC_VER)
++	noexcept(is_nothrow_move_constructible<NoteData>::value && is_nothrow_move_assignable<NoteData>::value)
++#endif
++	{
++		nd1.swap( nd2 );
++	}
+ }
+ 
+ #endif
+--- a/src/arch/ArchHooks/ArchHooks.h
++++ b/src/arch/ArchHooks/ArchHooks.h
+@@ -1,6 +1,8 @@
+ #ifndef ARCH_HOOKS_H
+ #define ARCH_HOOKS_H
+ 
++#include <ctime>
++
+ struct lua_State;
+ class ArchHooks
+ {
+--- a/src/archutils/Unix/AssertionHandler.cpp
++++ b/src/archutils/Unix/AssertionHandler.cpp
+@@ -46,18 +46,28 @@ extern "C" void __assert_perror_fail( int errnum, const char *file, unsigned int
+ 
+ /* Catch unhandled C++ exceptions.  Note that this works in g++ even with -fno-exceptions, in
+  * which case it'll be called if any exceptions are thrown at all. */
+-#include <cxxabi.h>
+ void UnexpectedExceptionHandler()
+ {
+-	type_info *pException = abi::__cxa_current_exception_type();
+-	char const *pName = pException->name();
+-	int iStatus = -1;
+-	char *pDem = abi::__cxa_demangle( pName, 0, 0, &iStatus );
+-
+-	const RString error = ssprintf("Unhandled exception: %s", iStatus? pName:pDem);
++	std::exception_ptr exptr = std::current_exception();
++	try
++	{
++		std::rethrow_exception(exptr);
++	}
++	catch (std::exception &ex)
++	{
++#if defined(CRASH_HANDLER)
++		const RString error = ssprintf("Unhandled exception: %s", ex.what());
++		sm_crash( error );
++#endif
++	}
++	// TODO: Don't throw anything not subclassing std::exception
++	catch(...)
++	{
+ #if defined(CRASH_HANDLER)
+-	sm_crash( error );
++		const RString error = ssprintf("Unknown exception.");
++		sm_crash( error );
+ #endif
++	}
+ }
+ 
+ void InstallExceptionHandler()
diff --git a/srcpkgs/stepmania/patches/messageman.patch b/srcpkgs/stepmania/patches/messageman.patch
new file mode 100644
index 000000000000..5cebc003e0d7
--- /dev/null
+++ b/srcpkgs/stepmania/patches/messageman.patch
@@ -0,0 +1,107 @@
+Upstream: yes
+https://github.com/stepmania/stepmania/commit/3f64564dd7c62a2f3d9557c1bdb8475fd953abea
+--- a/src/MessageManager.cpp
++++ b/src/MessageManager.cpp
+@@ -207,8 +207,7 @@ void MessageManager::Unsubscribe( IMessageSubscriber* pSubscriber, MessageID m )
+
+ void MessageManager::Broadcast( Message &msg ) const
+ {
+-	// GAMESTATE is created before MESSAGEMAN, and has several BroadcastOnChangePtr members, so they all broadcast when they're initialized.
+-	if(this != NULL && m_Logging)
++	if(m_Logging)
+ 	{
+ 		LOG->Trace("MESSAGEMAN:Broadcast: %s", msg.GetName().c_str());
+ 	}
+--- a/src/StepMania.cpp
++++ b/src/StepMania.cpp
+@@ -1041,8 +1041,10 @@ int sm_main(int argc, char* argv[])
+ 	// This needs PREFSMAN.
+ 	Dialog::Init();
+
+-	// Create game objects
++	// Set up the messaging system early to have well defined code.
++	MESSAGEMAN	= new MessageManager;
+
++	// Create game objects
+ 	GAMESTATE	= new GameState;
+
+ 	// This requires PREFSMAN, for PREFSMAN->m_bShowLoadingWindow.
+@@ -1162,7 +1164,6 @@ int sm_main(int argc, char* argv[])
+ 	SONGMAN->UpdatePopular();
+ 	SONGMAN->UpdatePreferredSort();
+ 	NSMAN 		= new NetworkSyncManager( pLoadingWindow );
+-	MESSAGEMAN	= new MessageManager;
+ 	STATSMAN	= new StatsManager;
+
+ 	// Initialize which courses are ranking courses here.
+
+Backported from
+https://github.com/stepmania/stepmania/commit/8ab7c7fab937acc684392b909b6b30b47d9a8c7b
+
+--- a/src/NoteData.h
++++ b/src/NoteData.h
+@@ -375,7 +375,13 @@ public:
+ /** @brief Allow a quick way to swap notedata. */
+ namespace std
+ {
+-	template<> inline void swap<NoteData>( NoteData &nd1, NoteData &nd2 ) { nd1.swap( nd2 ); }
++	template<> inline void swap<NoteData>( NoteData &nd1, NoteData &nd2 )
++#if !defined(_MSC_VER)
++	noexcept(is_nothrow_move_constructible<NoteData>::value && is_nothrow_move_assignable<NoteData>::value)
++#endif
++	{
++		nd1.swap( nd2 );
++	}
+ }
+ 
+ #endif
+--- a/src/arch/ArchHooks/ArchHooks.h
++++ b/src/arch/ArchHooks/ArchHooks.h
+@@ -1,6 +1,8 @@
+ #ifndef ARCH_HOOKS_H
+ #define ARCH_HOOKS_H
+ 
++#include <ctime>
++
+ struct lua_State;
+ class ArchHooks
+ {
+--- a/src/archutils/Unix/AssertionHandler.cpp
++++ b/src/archutils/Unix/AssertionHandler.cpp
+@@ -46,18 +46,28 @@ extern "C" void __assert_perror_fail( int errnum, const char *file, unsigned int
+ 
+ /* Catch unhandled C++ exceptions.  Note that this works in g++ even with -fno-exceptions, in
+  * which case it'll be called if any exceptions are thrown at all. */
+-#include <cxxabi.h>
+ void UnexpectedExceptionHandler()
+ {
+-	type_info *pException = abi::__cxa_current_exception_type();
+-	char const *pName = pException->name();
+-	int iStatus = -1;
+-	char *pDem = abi::__cxa_demangle( pName, 0, 0, &iStatus );
+-
+-	const RString error = ssprintf("Unhandled exception: %s", iStatus? pName:pDem);
++	std::exception_ptr exptr = std::current_exception();
++	try
++	{
++		std::rethrow_exception(exptr);
++	}
++	catch (std::exception &ex)
++	{
++#if defined(CRASH_HANDLER)
++		const RString error = ssprintf("Unhandled exception: %s", ex.what());
++		sm_crash( error );
++#endif
++	}
++	// TODO: Don't throw anything not subclassing std::exception
++	catch(...)
++	{
+ #if defined(CRASH_HANDLER)
+-	sm_crash( error );
++		const RString error = ssprintf("Unknown exception.");
++		sm_crash( error );
+ #endif
++	}
+ }
+ 
+ void InstallExceptionHandler()
diff --git a/srcpkgs/stepmania/patches/newgcc.patch b/srcpkgs/stepmania/patches/newgcc.patch
deleted file mode 100644
index 7698a266c9e1..000000000000
--- a/srcpkgs/stepmania/patches/newgcc.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-Upstream: yes
-https://github.com/stepmania/stepmania/commit/3f64564dd7c62a2f3d9557c1bdb8475fd953abea
---- a/src/MessageManager.cpp
-+++ b/src/MessageManager.cpp
-@@ -207,8 +207,7 @@ void MessageManager::Unsubscribe( IMessageSubscriber* pSubscriber, MessageID m )
-
- void MessageManager::Broadcast( Message &msg ) const
- {
--	// GAMESTATE is created before MESSAGEMAN, and has several BroadcastOnChangePtr members, so they all broadcast when they're initialized.
--	if(this != NULL && m_Logging)
-+	if(m_Logging)
- 	{
- 		LOG->Trace("MESSAGEMAN:Broadcast: %s", msg.GetName().c_str());
- 	}
---- a/src/StepMania.cpp
-+++ b/src/StepMania.cpp
-@@ -1041,8 +1041,10 @@ int sm_main(int argc, char* argv[])
- 	// This needs PREFSMAN.
- 	Dialog::Init();
-
--	// Create game objects
-+	// Set up the messaging system early to have well defined code.
-+	MESSAGEMAN	= new MessageManager;
-
-+	// Create game objects
- 	GAMESTATE	= new GameState;
-
- 	// This requires PREFSMAN, for PREFSMAN->m_bShowLoadingWindow.
-@@ -1162,7 +1164,6 @@ int sm_main(int argc, char* argv[])
- 	SONGMAN->UpdatePopular();
- 	SONGMAN->UpdatePreferredSort();
- 	NSMAN 		= new NetworkSyncManager( pLoadingWindow );
--	MESSAGEMAN	= new MessageManager;
- 	STATSMAN	= new StatsManager;
-
- 	// Initialize which courses are ranking courses here.
diff --git a/srcpkgs/stepmania/template b/srcpkgs/stepmania/template
index 07afdba93ce6..3f36cb799075 100644
--- a/srcpkgs/stepmania/template
+++ b/srcpkgs/stepmania/template
@@ -1,19 +1,25 @@
 # Template file for 'stepmania'
 pkgname=stepmania
 version=5.0.12
-revision=3
+revision=4
+# see CMake/SetupFfmpeg.cmake in the source code
+_ffmpeg_ver=2.1.3
+build_wrksrc="${pkgname}-${version}"
 build_style=cmake
 make_cmd=make
 cmake_builddir="Build"
-hostmakedepends="nasm yasm pkg-config git"
+hostmakedepends="nasm yasm pkg-config"
 makedepends="libmad-devel libvorbis-devel pcre-devel libjpeg-turbo-devel
 alsa-lib-devel libXrandr-devel libva-devel glew-devel"
 short_desc="Advanced rhythm game"
 maintainer="Michael Aldridge <maldridge@voidlinux.org>"
 license="MIT"
 homepage="http://www.stepmania.com/"
-distfiles="https://github.com/stepmania/stepmania/archive/v${version}.tar.gz"
-checksum=df79bcadd69d4ed60cf560d45386ec275181343495ffd744c3ff8f73c83d4755
+distfiles="https://github.com/stepmania/stepmania/archive/v${version}.tar.gz
+ https://github.com/FFmpeg/FFmpeg/archive/n${_ffmpeg_ver}.tar.gz"
+checksum="df79bcadd69d4ed60cf560d45386ec275181343495ffd744c3ff8f73c83d4755
+ cfafef9c9fb2581ac234fc11da97c677e5a911db4e16b341ab724b7e6aa03b62"
+patch_args="-Np1 --directory=${build_wrksrc}"
 
 # Upstream has stated that only x86 hardware can meed the performance
 # constraints and that musl is not supported due to interop issues
@@ -22,8 +28,12 @@ archs="i686 x86_64"
 
 export CMAKE_GENERATOR="Unix Makefiles"
 
+post_extract() {
+	mv FFmpeg-n${_ffmpeg_ver} ${build_wrksrc}/extern/ffmpeg-linux-${_ffmpeg_ver}
+}
+
 post_install() {
-	vlicense Docs/Licenses.txt
+	vlicense Docs/Licenses.txt LICENSE
 
 	mkdir -p ${DESTDIR}/usr/bin
 	cd ${DESTDIR}

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PR PATCH] [Updated] stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with distfiles
  2022-11-26 17:07 [PR PATCH] stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with distfiles kruceter
                   ` (6 preceding siblings ...)
  2022-12-03 14:15 ` [PR PATCH] [Updated] " kruceter
@ 2022-12-03 14:21 ` kruceter
  2022-12-03 19:03 ` [PR PATCH] [Merged]: " paper42
  8 siblings, 0 replies; 10+ messages in thread
From: kruceter @ 2022-12-03 14:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1141 bytes --]

There is an updated pull request by kruceter against master on the void-packages repository

https://github.com/kruceter/void-packages stepmania
https://github.com/void-linux/void-packages/pull/40783

stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with distfiles
If ffmpeg with specific version is not present in the work source directory, cmake attempts to clone its repository with git and check out version 2.1.3. This approach presents two issues:

1. It can no longer be cloned using git:// for github (see https://github.com/stepmania/stepmania/pull/2200) which results in connection timeout and build failure as the result.

2. Downloaded tarball is erased after successful build since it is considered to be part of the source code.
Its retrieval and storage for future use should be done by xbps-src.

cc: @the-maldridge as the current maintainer of the package.

#### Testing the changes
- I tested the changes in this PR: **briefly**

#### Local build testing
- I built this PR locally for my native architecture, x86_64

A patch file from https://github.com/void-linux/void-packages/pull/40783.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-stepmania-40783.patch --]
[-- Type: text/x-diff, Size: 5429 bytes --]

From 0460cb67aff321af497b15bee838eec13a8fb945 Mon Sep 17 00:00:00 2001
From: Krul Ceter <kruceter@proton.me>
Date: Sat, 26 Nov 2022 19:44:10 +0300
Subject: [PATCH] stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with
 distfiles

If ffmpeg with specific version is not present in the work source
directory, cmake attempts to clone its repository with git and
check out version 2.1.3. This approach presents two issues:

1. It can no longer be cloned using git:// for github (see
https://github.com/stepmania/stepmania/pull/2200) which results in
connection timeout and build failure as the result.

2. Downloaded tarball is erased after successful build since it is
considered to be part of the source code.
Its retrieval and storage for future use should be done by xbps-src.
---
 srcpkgs/stepmania/patches/gcc-12.patch        | 70 +++++++++++++++++++
 .../{newgcc.patch => messageman.patch}        |  0
 srcpkgs/stepmania/template                    | 20 ++++--
 3 files changed, 85 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/stepmania/patches/gcc-12.patch
 rename srcpkgs/stepmania/patches/{newgcc.patch => messageman.patch} (100%)

diff --git a/srcpkgs/stepmania/patches/gcc-12.patch b/srcpkgs/stepmania/patches/gcc-12.patch
new file mode 100644
index 000000000000..788504fb9397
--- /dev/null
+++ b/srcpkgs/stepmania/patches/gcc-12.patch
@@ -0,0 +1,70 @@
+Backported from
+https://github.com/stepmania/stepmania/commit/8ab7c7fab937acc684392b909b6b30b47d9a8c7b
+
+--- a/src/NoteData.h
++++ b/src/NoteData.h
+@@ -375,7 +375,13 @@ public:
+ /** @brief Allow a quick way to swap notedata. */
+ namespace std
+ {
+-	template<> inline void swap<NoteData>( NoteData &nd1, NoteData &nd2 ) { nd1.swap( nd2 ); }
++	template<> inline void swap<NoteData>( NoteData &nd1, NoteData &nd2 )
++#if !defined(_MSC_VER)
++	noexcept(is_nothrow_move_constructible<NoteData>::value && is_nothrow_move_assignable<NoteData>::value)
++#endif
++	{
++		nd1.swap( nd2 );
++	}
+ }
+ 
+ #endif
+--- a/src/arch/ArchHooks/ArchHooks.h
++++ b/src/arch/ArchHooks/ArchHooks.h
+@@ -1,6 +1,8 @@
+ #ifndef ARCH_HOOKS_H
+ #define ARCH_HOOKS_H
+ 
++#include <ctime>
++
+ struct lua_State;
+ class ArchHooks
+ {
+--- a/src/archutils/Unix/AssertionHandler.cpp
++++ b/src/archutils/Unix/AssertionHandler.cpp
+@@ -46,18 +46,28 @@ extern "C" void __assert_perror_fail( int errnum, const char *file, unsigned int
+ 
+ /* Catch unhandled C++ exceptions.  Note that this works in g++ even with -fno-exceptions, in
+  * which case it'll be called if any exceptions are thrown at all. */
+-#include <cxxabi.h>
+ void UnexpectedExceptionHandler()
+ {
+-	type_info *pException = abi::__cxa_current_exception_type();
+-	char const *pName = pException->name();
+-	int iStatus = -1;
+-	char *pDem = abi::__cxa_demangle( pName, 0, 0, &iStatus );
+-
+-	const RString error = ssprintf("Unhandled exception: %s", iStatus? pName:pDem);
++	std::exception_ptr exptr = std::current_exception();
++	try
++	{
++		std::rethrow_exception(exptr);
++	}
++	catch (std::exception &ex)
++	{
++#if defined(CRASH_HANDLER)
++		const RString error = ssprintf("Unhandled exception: %s", ex.what());
++		sm_crash( error );
++#endif
++	}
++	// TODO: Don't throw anything not subclassing std::exception
++	catch(...)
++	{
+ #if defined(CRASH_HANDLER)
+-	sm_crash( error );
++		const RString error = ssprintf("Unknown exception.");
++		sm_crash( error );
+ #endif
++	}
+ }
+ 
+ void InstallExceptionHandler()
diff --git a/srcpkgs/stepmania/patches/newgcc.patch b/srcpkgs/stepmania/patches/messageman.patch
similarity index 100%
rename from srcpkgs/stepmania/patches/newgcc.patch
rename to srcpkgs/stepmania/patches/messageman.patch
diff --git a/srcpkgs/stepmania/template b/srcpkgs/stepmania/template
index 07afdba93ce6..3f36cb799075 100644
--- a/srcpkgs/stepmania/template
+++ b/srcpkgs/stepmania/template
@@ -1,19 +1,25 @@
 # Template file for 'stepmania'
 pkgname=stepmania
 version=5.0.12
-revision=3
+revision=4
+# see CMake/SetupFfmpeg.cmake in the source code
+_ffmpeg_ver=2.1.3
+build_wrksrc="${pkgname}-${version}"
 build_style=cmake
 make_cmd=make
 cmake_builddir="Build"
-hostmakedepends="nasm yasm pkg-config git"
+hostmakedepends="nasm yasm pkg-config"
 makedepends="libmad-devel libvorbis-devel pcre-devel libjpeg-turbo-devel
 alsa-lib-devel libXrandr-devel libva-devel glew-devel"
 short_desc="Advanced rhythm game"
 maintainer="Michael Aldridge <maldridge@voidlinux.org>"
 license="MIT"
 homepage="http://www.stepmania.com/"
-distfiles="https://github.com/stepmania/stepmania/archive/v${version}.tar.gz"
-checksum=df79bcadd69d4ed60cf560d45386ec275181343495ffd744c3ff8f73c83d4755
+distfiles="https://github.com/stepmania/stepmania/archive/v${version}.tar.gz
+ https://github.com/FFmpeg/FFmpeg/archive/n${_ffmpeg_ver}.tar.gz"
+checksum="df79bcadd69d4ed60cf560d45386ec275181343495ffd744c3ff8f73c83d4755
+ cfafef9c9fb2581ac234fc11da97c677e5a911db4e16b341ab724b7e6aa03b62"
+patch_args="-Np1 --directory=${build_wrksrc}"
 
 # Upstream has stated that only x86 hardware can meed the performance
 # constraints and that musl is not supported due to interop issues
@@ -22,8 +28,12 @@ archs="i686 x86_64"
 
 export CMAKE_GENERATOR="Unix Makefiles"
 
+post_extract() {
+	mv FFmpeg-n${_ffmpeg_ver} ${build_wrksrc}/extern/ffmpeg-linux-${_ffmpeg_ver}
+}
+
 post_install() {
-	vlicense Docs/Licenses.txt
+	vlicense Docs/Licenses.txt LICENSE
 
 	mkdir -p ${DESTDIR}/usr/bin
 	cd ${DESTDIR}

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PR PATCH] [Merged]: stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with distfiles
  2022-11-26 17:07 [PR PATCH] stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with distfiles kruceter
                   ` (7 preceding siblings ...)
  2022-12-03 14:21 ` kruceter
@ 2022-12-03 19:03 ` paper42
  8 siblings, 0 replies; 10+ messages in thread
From: paper42 @ 2022-12-03 19:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 981 bytes --]

There's a merged pull request on the void-packages repository

stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with distfiles
https://github.com/void-linux/void-packages/pull/40783

Description:
If ffmpeg with specific version is not present in the work source directory, cmake attempts to clone its repository with git and check out version 2.1.3. This approach presents two issues:

1. It can no longer be cloned using git:// for github (see https://github.com/stepmania/stepmania/pull/2200) which results in connection timeout and build failure as the result.

2. Downloaded tarball is erased after successful build since it is considered to be part of the source code.
Its retrieval and storage for future use should be done by xbps-src.

cc: @the-maldridge as the current maintainer of the package.

#### Testing the changes
- I tested the changes in this PR: **briefly**

#### Local build testing
- I built this PR locally for my native architecture, x86_64

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-12-03 19:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-26 17:07 [PR PATCH] stepmania: fix build with gcc 12, ship ffmpeg 2.1.3 with distfiles kruceter
2022-12-03 13:01 ` [PR REVIEW] " paper42
2022-12-03 13:01 ` paper42
2022-12-03 13:01 ` paper42
2022-12-03 13:01 ` paper42
2022-12-03 13:01 ` paper42
2022-12-03 13:01 ` paper42
2022-12-03 14:15 ` [PR PATCH] [Updated] " kruceter
2022-12-03 14:21 ` kruceter
2022-12-03 19:03 ` [PR PATCH] [Merged]: " paper42

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).