commit 76f31a6882e361387c04e8882b01422bfe496aeb
Author: Leigh Scott <leigh123linux(a)gmail.com>
Date: Wed Jan 19 12:18:18 2022 +0000
Fix build with libcaca > 0.99beta20
Fix_build_with_libcaca.patch | 118 +++++++++++++++++++++++++++++++++++++++++++
xine-lib.spec | 3 ++
2 files changed, 121 insertions(+)
---
diff --git a/Fix_build_with_libcaca.patch b/Fix_build_with_libcaca.patch
new file mode 100644
index 0000000..e79cc4f
--- /dev/null
+++ b/Fix_build_with_libcaca.patch
@@ -0,0 +1,118 @@
+diff -r aae538a10133 -r 3f383e140270 m4/video_out.m4
+--- a/m4/video_out.m4 Wed Oct 06 18:03:30 2021 +0200
++++ b/m4/video_out.m4 Fri Oct 29 18:25:20 2021 +0200
+@@ -103,6 +103,7 @@
+ if test x"$have_caca$have_cucul" = x"yesyes"; then
+ HAVE_CUCUL=1
+ AC_SUBST([HAVE_CUCUL])
++ AC_DEFINE([HAVE_CUCUL], [], [Define this if you have the legacy libcaca with
separate libcucul.])
+ fi
+
+
+diff -r aae538a10133 -r 3f383e140270 src/video_out/video_out_caca.c
+--- a/src/video_out/video_out_caca.c Wed Oct 06 18:03:30 2021 +0200
++++ b/src/video_out/video_out_caca.c Fri Oct 29 18:25:20 2021 +0200
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (C) 2003-2019 the xine project
++ * Copyright (C) 2003-2021 the xine project
+ *
+ * This file is part of xine, a free video player.
+ *
+@@ -35,13 +35,21 @@
+ #include <sys/stat.h>
+ #include <sys/mman.h>
+ #include <sys/time.h>
++
+ #ifdef HAVE_CUCUL
+-#include <cucul.h>
++# include <cucul.h>
++# define caca_canvas_t cucul_canvas_t
++# define caca_create_canvas cucul_create_canvas
++# define caca_get_canvas_width cucul_get_canvas_width
++# define caca_get_canvas_height cucul_get_canvas_height
++# define caca_free_canvas cucul_free_canvas
++# define caca_dither_t cucul_dither_t
++# define caca_create_dither define cucul_create_dither
++# define caca_dither_bitmap cucul_dither_bitmap
++# define caca_free_dither cucul_free_dither
+ #endif
+ #include <caca.h>
+
+-
+-
+ #include "xine.h"
+ #include <xine/video_out.h>
+ #include <xine/xine_internal.h>
+@@ -56,7 +64,7 @@
+
+ vo_frame_t vo_frame;
+
+- cucul_dither_t *pixmap_s; /* pixmap info structure */
++ caca_dither_t *pixmap_s; /* pixmap info structure */
+ uint8_t *pixmap_d; /* pixmap data */
+ unsigned int width, height;
+
+@@ -74,7 +82,7 @@
+
+ yuv2rgb_factory_t *yuv2rgb_factory;
+
+- cucul_canvas_t *cv;
++ caca_canvas_t *cv;
+ caca_display_t *dp;
+
+ } caca_driver_t;
+@@ -104,7 +112,7 @@
+
+ free (frame->pixmap_d);
+ if (frame->pixmap_s)
+- cucul_free_dither (frame->pixmap_s);
++ caca_free_dither (frame->pixmap_s);
+
+ frame->yuv2rgb->dispose (frame->yuv2rgb);
+
+@@ -163,7 +171,7 @@
+ _x_freep (&frame->pixmap_d);
+
+ if (frame->pixmap_s) {
+- cucul_free_dither (frame->pixmap_s);
++ caca_free_dither (frame->pixmap_s);
+ frame->pixmap_s = NULL;
+ }
+
+@@ -172,7 +180,7 @@
+ frame->format = format;
+
+ frame->pixmap_d = (uint8_t *) calloc (height, width * 4);
+- frame->pixmap_s = cucul_create_dither (32, width, height, width * 4,
++ frame->pixmap_s = caca_create_dither (32, width, height, width * 4,
+ 0xff0000, 0xff00, 0xff, 0);
+
+ if (format == XINE_IMGFMT_YV12) {
+@@ -214,7 +222,7 @@
+
+ frame->vo_frame.free (&frame->vo_frame);
+
+- cucul_dither_bitmap(this->cv, 0, 0, cucul_get_canvas_width(this->cv)-1,
cucul_get_canvas_height(this->cv)-1,
++ caca_dither_bitmap(this->cv, 0, 0, caca_get_canvas_width(this->cv)-1,
caca_get_canvas_height(this->cv)-1,
+ frame->pixmap_s, frame->pixmap_d);
+ caca_refresh_display (this->dp);
+ }
+@@ -262,7 +270,7 @@
+ caca_driver_t *this = (caca_driver_t*) this_gen;
+ this->yuv2rgb_factory->dispose (this->yuv2rgb_factory);
+ caca_free_display(this->dp);
+- cucul_free_canvas(this->cv);
++ caca_free_canvas(this->cv);
+
+ free(this);
+ }
+@@ -309,7 +317,7 @@
+ this->cv = caca_get_canvas(dp);
+ this->dp = dp;
+ } else {
+- this->cv = cucul_create_canvas(0, 0);
++ this->cv = caca_create_canvas(0, 0);
+ this->dp = caca_create_display(this->cv);
+ }
+
diff --git a/xine-lib.spec b/xine-lib.spec
index ddfb6cb..41ace96 100644
--- a/xine-lib.spec
+++ b/xine-lib.spec
@@ -35,6 +35,8 @@ Source0: xine-lib-%{version}-%{date}hg%{revision}.tar.xz
# Script to make a snapshot
Source1: make_xinelib_snapshot.sh
+Patch0: Fix_build_with_libcaca.patch
+
Provides: xine-lib(plugin-abi) = %{plugin_abi}
%{?_isa:Provides: xine-lib(plugin-abi)%{?_isa} = %{plugin_abi}}
@@ -129,6 +131,7 @@ This package contains extra plugins for %{name}:
%else
%setup -q -n %{name}-%{version}-%{date}hg%{revision}
%endif
+%patch0 -p1
autoreconf -ivf