alarm/kodi-c1 fixes

This commit is contained in:
Kevin Mihelich 2015-01-23 00:46:22 +00:00
parent 25eced2b25
commit 37281794c2
2 changed files with 84 additions and 2 deletions

View file

@ -0,0 +1,78 @@
From 7c4de312553d2da770be015b645bcdc841f1886e Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Thu, 22 Jan 2015 16:17:02 -0700
Subject: [PATCH] Fixes for using giflib 5 in GifHelper.cpp
---
.../native/TexturePacker/src/decoder/GifHelper.cpp | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/tools/depends/native/TexturePacker/src/decoder/GifHelper.cpp b/tools/depends/native/TexturePacker/src/decoder/GifHelper.cpp
index 8b65cf6..f52ec8a 100644
--- a/tools/depends/native/TexturePacker/src/decoder/GifHelper.cpp
+++ b/tools/depends/native/TexturePacker/src/decoder/GifHelper.cpp
@@ -82,7 +82,12 @@ GifHelper::GifHelper() :
GifHelper::~GifHelper()
{
- int err = DGifCloseFile(m_gif);
+ int err;
+#if GIFLIB_MAJOR >= 5
+ DGifCloseFile(m_gif, &err);
+#else
+ err = DGifCloseFile(m_gif);
+#endif
if (err == D_GIF_ERR_CLOSE_FAILED)
{
fprintf(stderr, "Gif::~Gif(): D_GIF_ERR_CLOSE_FAILED\n");
@@ -119,7 +124,7 @@ bool GifHelper::LoadGifMetaData(GifFileType* file)
if (DGifSlurp(m_gif) == GIF_ERROR)
{
#if GIFLIB_MAJOR >= 5
- char* error = GifErrorString(m_gif->Error);
+ const char* error = GifErrorString(m_gif->Error);
if (error)
fprintf(stderr, "Gif::LoadGif(): Could not read file %s - %s\n", m_filename.c_str(), error);
#else
@@ -190,7 +195,7 @@ bool GifHelper::LoadGifMetaData(const char* file)
if (!m_gif)
{
#if GIFLIB_MAJOR >= 5
- char* error = GifErrorString(err);
+ const char* error = GifErrorString(err);
if (error)
fprintf(stderr, "Gif::LoadGif(): Could not open file %s - %s\n", m_filename.c_str(), error);
#else
@@ -248,7 +253,11 @@ bool GifHelper::IsAnimated(const char* file)
{
if (DGifSlurp(gif) && gif->ImageCount > 1)
m_isAnimated = 1;
+#if GIFLIB_MAJOR >= 5
+ DGifCloseFile(gif, NULL);
+#else
DGifCloseFile(gif);
+#endif
fclose(gifFile);
}
}
@@ -290,7 +299,7 @@ bool GifHelper::gcbToFrame(GifFrame &frame, unsigned int imgIdx)
GraphicsControlBlock gcb;
if (!DGifSavedExtensionToGCB(m_gif, imgIdx, &gcb))
{
- char* error = GifErrorString(m_gif->Error);
+ const char* error = GifErrorString(m_gif->Error);
if (error)
fprintf(stderr, "Gif::ExtractFrames(): Could not read GraphicsControlBlock of frame %d - %s\n", imgIdx, error);
else
@@ -495,7 +504,7 @@ bool GifHelper::LoadImageFromMemory(unsigned char* buffer, unsigned int bufSize,
if (!m_gif)
{
#if GIFLIB_MAJOR >= 5
- char* error = GifErrorString(err);
+ const char* error = GifErrorString(err);
if (error)
fprintf(stderr, "Gif::LoadImageFromMemory(): Could not open gif from memory - %s\n", error);
#else
--
2.2.2

View file

@ -30,12 +30,16 @@ makedepends=(
'python2-pybluez' 'python2-simplejson' 'rtmpdump' 'sdl2' 'sdl_image'
'shairplay' 'smbclient' 'swig' 'taglib' 'tinyxml' 'unzip' 'upower' 'yajl' 'zip'
)
source=("https://github.com/mdrjr/xbmc/archive/${_commit}.tar.gz")
sha256sums=('b644aa417593aa6a2aacee61b856e3419a7bef20a93f5adb0c4b2102c3f5e31d')
source=("https://github.com/mdrjr/xbmc/archive/${_commit}.tar.gz"
'0001-Fixes-for-using-giflib-5-in-GifHelper.cpp.patch')
sha256sums=('b644aa417593aa6a2aacee61b856e3419a7bef20a93f5adb0c4b2102c3f5e31d'
'47ed17dd5d5a6127a88c2c0076760c6a7a5bb0cb33d50cf1ee55978cec26ad94')
prepare() {
cd xbmc-${_commit}
patch -p1 -i ../0001-Fixes-for-using-giflib-5-in-GifHelper.cpp.patch
find -type f -name *.py -exec sed 's|^#!.*python$|#!/usr/bin/python2|' -i "{}" +
sed 's|^#!.*python$|#!/usr/bin/python2|' -i tools/depends/native/rpl-native/rpl
sed 's/python/python2/' -i tools/Linux/kodi.sh.in