Bug#1013420: corsix-th FTBFS with ffmpeg 5.0.1

2022-07-21 Thread Steve Langasek
Package: corsix-th
Followup-For: Bug #1013420
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu kinetic ubuntu-patch
Control: tags -1 patch

Upstream has committed a fix for this issue.  Please find attached a debdiff
that cherry-picks this fix and lets corsix-th build against ffmpeg 5.0.

I have uploaded this change to Ubuntu for the ffmpeg 5.0 transition.

Cheers,
-- 
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
Ubuntu Developer   https://www.debian.org/
slanga...@ubuntu.com vor...@debian.org
diff -Nru corsix-th-0.65.1/debian/control corsix-th-0.65.1/debian/control
--- corsix-th-0.65.1/debian/control 2022-07-19 05:45:58.0 -0700
+++ corsix-th-0.65.1/debian/control 2022-07-21 10:46:54.0 -0700
@@ -1,8 +1,7 @@
 Source: corsix-th
 Section: contrib/games
 Priority: optional
-Maintainer: Ubuntu Developers 
-XSBC-Original-Maintainer: Debian Games Team 

+Maintainer: Debian Games Team 
 Uploaders:
  Alexandre Detiste ,
  Phil Morrell ,
diff -Nru corsix-th-0.65.1/debian/patches/0001-Support-ffmpeg-5.patch 
corsix-th-0.65.1/debian/patches/0001-Support-ffmpeg-5.patch
--- corsix-th-0.65.1/debian/patches/0001-Support-ffmpeg-5.patch 1969-12-31 
16:00:00.0 -0800
+++ corsix-th-0.65.1/debian/patches/0001-Support-ffmpeg-5.patch 2022-07-21 
10:46:36.0 -0700
@@ -0,0 +1,61 @@
+From 95be4c96810818d05b668c373711cd8f38d4e8b4 Mon Sep 17 00:00:00 2001
+From: "Stephen E. Baker" 
+Date: Tue, 1 Mar 2022 06:24:01 -0500
+Subject: [PATCH] Support ffmpeg 5
+
+AVCodec* was made const in lavc 59.0.100 and lavf 59.0.100
+---
+ CorsixTH/Src/th_movie.cpp | 6 +++---
+ CorsixTH/Src/th_movie.h   | 8 +++-
+ 2 files changed, 10 insertions(+), 4 deletions(-)
+
+Index: corsix-th-0.65.1/CorsixTH/Src/th_movie.cpp
+===
+--- corsix-th-0.65.1.orig/CorsixTH/Src/th_movie.cpp
 corsix-th-0.65.1/CorsixTH/Src/th_movie.cpp
+@@ -414,8 +414,8 @@
+ 
+ bool movie_player::load(const char* szFilepath) {
+   int iError = 0;
+-  AVCodec* m_pVideoCodec;
+-  AVCodec* m_pAudioCodec;
++  av_codec_ptr m_pVideoCodec;
++  av_codec_ptr m_pAudioCodec;
+ 
+   unload();  // Unload any currently loaded video to free memory
+   aborting = false;
+@@ -457,7 +457,7 @@
+ }
+ 
+ AVCodecContext* movie_player::get_codec_context_for_stream(
+-AVCodec* codec, AVStream* stream) const {
++av_codec_ptr codec, AVStream* stream) const {
+ #if (defined(CORSIX_TH_USE_LIBAV) && \
+  LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 14, 0)) || \
+ (defined(CORSIX_TH_USE_FFMPEG) &&\
+Index: corsix-th-0.65.1/CorsixTH/Src/th_movie.h
+===
+--- corsix-th-0.65.1.orig/CorsixTH/Src/th_movie.h
 corsix-th-0.65.1/CorsixTH/Src/th_movie.h
+@@ -68,6 +68,12 @@
+ #define CORSIX_TH_MOVIE_USE_SEND_PACKET_API
+ #endif
+ 
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59, 0, 100)
++using av_codec_ptr = AVCodec*;
++#else
++using av_codec_ptr = const AVCodec*;
++#endif
++
+ //! \brief Drop in replacement for AVPacketList
+ //!
+ //! AVPacketList which was deprecated with FFMpeg 4.4.
+@@ -330,7 +336,7 @@
+   1024;  ///< Buffer for audio playback
+ 
+   //! Get the AVCodecContext associated with a given stream
+-  AVCodecContext* get_codec_context_for_stream(AVCodec* codec,
++  AVCodecContext* get_codec_context_for_stream(av_codec_ptr codec,
+AVStream* stream) const;
+ 
+   //! Get the time the given frame should be played (from the start of the
diff -Nru corsix-th-0.65.1/debian/patches/series 
corsix-th-0.65.1/debian/patches/series
--- corsix-th-0.65.1/debian/patches/series  2021-08-29 18:48:58.0 
-0700
+++ corsix-th-0.65.1/debian/patches/series  2022-07-21 10:43:46.0 
-0700
@@ -1,2 +1,3 @@
 default_config.patch
 build-Remove-FindSDL2-find-module-use-sdl2-config.cmake-i.patch
+0001-Support-ffmpeg-5.patch


Bug#1013420: corsix-th FTBFS with ffmpeg 5.0.1

2022-07-16 Thread Alexandre Detiste
lua-lpeg is orphaned ... someone has to take care of it first;
I might even adopt it.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=995514

I created a Merge Request:

https://salsa.debian.org/lua-team/lua-lpeg/-/merge_requests/1

Le sam. 16 juil. 2022 à 20:09, Alexandre Detiste
 a écrit :
>
> Hi,
>
> I imported and packaged corsix-th 0.66.
>
> This fix this one build time bug but not the run-time one.
>
> >Welcome to CorsixTH v0.66!
> >
> >An error has occurred in CorsixTH:
> >/usr/share/games/corsix-th/Lua/strict.lua:66: module 'lpeg' not found:
> >no field package.preload['lpeg']
> >no file './lpeg.lua'
> >no file './lpeg/init.lua'
> >[C]: in ?
> >/usr/share/games/corsix-th/Lua/audio.lua:662: attempt to index a nil >value 
> >(field 'ui')
>
> Greetings
>
> Alexandre Detiste



Bug#1013420: corsix-th FTBFS with ffmpeg 5.0.1

2022-07-16 Thread Alexandre Detiste
Hi,

I imported and packaged corsix-th 0.66.

This fix this one build time bug but not the run-time one.

>Welcome to CorsixTH v0.66!
>
>An error has occurred in CorsixTH:
>/usr/share/games/corsix-th/Lua/strict.lua:66: module 'lpeg' not found:
>no field package.preload['lpeg']
>no file './lpeg.lua'
>no file './lpeg/init.lua'
>[C]: in ?
>/usr/share/games/corsix-th/Lua/audio.lua:662: attempt to index a nil >value 
>(field 'ui')

Greetings

Alexandre Detiste



Bug#1013420: corsix-th FTBFS with ffmpeg 5.0.1

2022-06-25 Thread Phil Morrell
The next release is due imminently, which adds support for ffmpeg 5, so
this will be closed via that upload.


signature.asc
Description: PGP signature


Bug#1013420: corsix-th FTBFS with ffmpeg 5.0.1

2022-06-23 Thread Adrian Bunk
Source: corsix-th
Version: 0.65.1-1
Severity: serious
Tags: ftbfs

https://buildd.debian.org/status/logs.php?pkg=corsix-th&ver=0.65.1-1%2Bb1

...
/<>/CorsixTH/Src/th_movie.cpp: In member function ‘bool 
movie_player::load(const char*)’:
/<>/CorsixTH/Src/th_movie.cpp:438:52: error: invalid conversion 
from ‘AVCodec**’ to ‘const AVCodec**’ [-fpermissive]
  438 |-1, -1, &m_pVideoCodec, 0);
  |^~
  ||
  |AVCodec**
In file included from /<>/CorsixTH/Src/th_movie.h:46,
 from /<>/CorsixTH/Src/th_movie.cpp:23:
/usr/include/x86_64-linux-gnu/libavformat/avformat.h:2161:41: note:   
initializing argument 5 of ‘int av_find_best_stream(AVFormatContext*, 
AVMediaType, int, int, const AVCodec**, int)’
 2161 | const AVCodec **decoder_ret,
  | ^~~
/<>/CorsixTH/Src/th_movie.cpp:449:52: error: invalid conversion 
from ‘AVCodec**’ to ‘const AVCodec**’ [-fpermissive]
  449 |-1, -1, &m_pAudioCodec, 0);
  |^~
  ||
  |AVCodec**
In file included from /<>/CorsixTH/Src/th_movie.h:46,
 from /<>/CorsixTH/Src/th_movie.cpp:23:
/usr/include/x86_64-linux-gnu/libavformat/avformat.h:2161:41: note:   
initializing argument 5 of ‘int av_find_best_stream(AVFormatContext*, 
AVMediaType, int, int, const AVCodec**, int)’
 2161 | const AVCodec **decoder_ret,
  | ^~~
make[3]: *** [CorsixTH/CMakeFiles/CorsixTH_lib.dir/build.make:429: 
CorsixTH/CMakeFiles/CorsixTH_lib.dir/Src/th_movie.cpp.o] Error 1