diff options
author | Timo Teräs <timo.teras@iki.fi> | 2014-04-15 10:38:26 +0000 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2014-04-15 10:39:28 +0000 |
commit | 3ef61caf02705593434b656b0ad7c65fee0d72c1 (patch) | |
tree | 5b0e2c95eb3eec9d2a4eff16464ea5211d007b47 | |
parent | 450ffea21f019cfa559c6ee22a2315dc8c3bc8ac (diff) | |
download | alpine_aports-3ef61caf02705593434b656b0ad7c65fee0d72c1.tar.bz2 alpine_aports-3ef61caf02705593434b656b0ad7c65fee0d72c1.tar.xz alpine_aports-3ef61caf02705593434b656b0ad7c65fee0d72c1.zip |
main/xbmc: fix musl build, build against openjdk7
-rw-r--r-- | main/xbmc/APKBUILD | 22 | ||||
-rw-r--r-- | main/xbmc/fix-fileemu.patch | 449 | ||||
-rw-r--r-- | main/xbmc/fix-musl.patch | 93 | ||||
-rw-r--r-- | main/xbmc/fix-rsxs.patch | 24 | ||||
-rw-r--r-- | main/xbmc/xbmc-uclibc.patch | 57 |
5 files changed, 582 insertions, 63 deletions
diff --git a/main/xbmc/APKBUILD b/main/xbmc/APKBUILD index 3038c9682a..c4d56bbafc 100644 --- a/main/xbmc/APKBUILD +++ b/main/xbmc/APKBUILD | |||
@@ -2,7 +2,7 @@ | |||
2 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> | 2 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> |
3 | pkgname=xbmc | 3 | pkgname=xbmc |
4 | pkgver=12.3 | 4 | pkgver=12.3 |
5 | pkgrel=1 | 5 | pkgrel=2 |
6 | pkgdesc="A software media player and entertainment hub for digital media" | 6 | pkgdesc="A software media player and entertainment hub for digital media" |
7 | url="http://xbmc.org" | 7 | url="http://xbmc.org" |
8 | arch="x86 x86_64" | 8 | arch="x86 x86_64" |
@@ -17,7 +17,7 @@ depends_dev="gettext-dev boost-dev mesa-dev glew-dev glu-dev mysql-dev libass-de | |||
17 | yasm-dev libmpeg2-dev libmad-dev libsamplerate-dev rtmpdump-dev | 17 | yasm-dev libmpeg2-dev libmad-dev libsamplerate-dev rtmpdump-dev |
18 | libjpeg-turbo-dev libcrystalhd-dev udev-dev libcap-dev udisks-dev faac-dev | 18 | libjpeg-turbo-dev libcrystalhd-dev udev-dev libcap-dev udisks-dev faac-dev |
19 | libshairport-dev ffmpeg1-dev afpfs-ng-dev libcec-dev" | 19 | libshairport-dev ffmpeg1-dev afpfs-ng-dev libcec-dev" |
20 | makedepends="$depends_dev automake autoconf m4 libtool swig findutils openjdk6-jre-base | 20 | makedepends="$depends_dev automake autoconf m4 libtool swig findutils openjdk7-jre-base |
21 | boost-thread zip gperf cmake coreutils nasm" | 21 | boost-thread zip gperf cmake coreutils nasm" |
22 | subpackages="$pkgname-dev $pkgname-doc" | 22 | subpackages="$pkgname-dev $pkgname-doc" |
23 | install="" | 23 | install="" |
@@ -25,7 +25,10 @@ options="ldpath-recursive" | |||
25 | source="http://mirrors.xbmc.org/releases/source/$pkgname-$pkgver.tar.gz | 25 | source="http://mirrors.xbmc.org/releases/source/$pkgname-$pkgver.tar.gz |
26 | no-snesapu.patch | 26 | no-snesapu.patch |
27 | samba4.patch | 27 | samba4.patch |
28 | xbmc-uclibc.patch" | 28 | fix-musl.patch |
29 | fix-fileemu.patch | ||
30 | fix-rsxs.patch | ||
31 | " | ||
29 | 32 | ||
30 | _builddir="$srcdir/$pkgname-$pkgver-Frodo" | 33 | _builddir="$srcdir/$pkgname-$pkgver-Frodo" |
31 | 34 | ||
@@ -53,6 +56,7 @@ build() { | |||
53 | --mandir=/usr/share/man \ | 56 | --mandir=/usr/share/man \ |
54 | --infodir=/usr/share/info \ | 57 | --infodir=/usr/share/info \ |
55 | --localstatedir=/var \ | 58 | --localstatedir=/var \ |
59 | --disable-non-free \ | ||
56 | --disable-debug \ | 60 | --disable-debug \ |
57 | --disable-ccache \ | 61 | --disable-ccache \ |
58 | --enable-crystalhd \ | 62 | --enable-crystalhd \ |
@@ -77,12 +81,18 @@ package() { | |||
77 | md5sums="7ae385ebf8e5cfcb917393235e6efbdb xbmc-12.3.tar.gz | 81 | md5sums="7ae385ebf8e5cfcb917393235e6efbdb xbmc-12.3.tar.gz |
78 | 5ad388f29ab8f4ca6bc9e2b73bf946ef no-snesapu.patch | 82 | 5ad388f29ab8f4ca6bc9e2b73bf946ef no-snesapu.patch |
79 | 32d11612e948622b195950b93371027c samba4.patch | 83 | 32d11612e948622b195950b93371027c samba4.patch |
80 | 31ab49159268b20ecec0b73eeefbe15b xbmc-uclibc.patch" | 84 | eef7181657647bb95452a85b1ff34331 fix-musl.patch |
85 | d94b78880011d0e26c544ffcb9a3f6bf fix-fileemu.patch | ||
86 | 1c8cc1618f29613fe3521db3e4a99db5 fix-rsxs.patch" | ||
81 | sha256sums="3e15c960d034efdea5f92a7b74716cb48094842d077b076025fd8640754ede73 xbmc-12.3.tar.gz | 87 | sha256sums="3e15c960d034efdea5f92a7b74716cb48094842d077b076025fd8640754ede73 xbmc-12.3.tar.gz |
82 | 3c04c2cd6909cfb587b194e6c5a3025f1a3f03a0c5178ad70541ff7e69915935 no-snesapu.patch | 88 | 3c04c2cd6909cfb587b194e6c5a3025f1a3f03a0c5178ad70541ff7e69915935 no-snesapu.patch |
83 | de0c56f7ff84bc891d758dba6b3a68d20443e34357cd5dc89e0d4675bfee312c samba4.patch | 89 | de0c56f7ff84bc891d758dba6b3a68d20443e34357cd5dc89e0d4675bfee312c samba4.patch |
84 | 1af5b669f901108a48a007b6e657820ebe7375f7876bf63a9a29229e9e67b423 xbmc-uclibc.patch" | 90 | 7f390049dee084a6900f51763b686fd3ecdba3c336143d063712a537eb13ad70 fix-musl.patch |
91 | c88e17ab49d9bbb66da7cc30dfccd108d824fb6b2c00dfec9e723a3a13b40554 fix-fileemu.patch | ||
92 | e5de7cf5e781de9288f362c9d1c88d226297ba4aae3f75e5980f0a7cfc2258f0 fix-rsxs.patch" | ||
85 | sha512sums="abe5333f940460a2d40b04a4821f932b44c7605e0d4954e48781317aa25ee04e102b051165842094c5804024c637ca30506773dc3319aba7ab6dbfbe1973ccaa xbmc-12.3.tar.gz | 93 | sha512sums="abe5333f940460a2d40b04a4821f932b44c7605e0d4954e48781317aa25ee04e102b051165842094c5804024c637ca30506773dc3319aba7ab6dbfbe1973ccaa xbmc-12.3.tar.gz |
86 | 8b2b3159b536719bad7c00f2eb51c4778f8e6c049cfe07e2555a530ad8587ca7b83623e1b5f40220d2e490e38442f893f87496620aa94da27d37a8bddc72f434 no-snesapu.patch | 94 | 8b2b3159b536719bad7c00f2eb51c4778f8e6c049cfe07e2555a530ad8587ca7b83623e1b5f40220d2e490e38442f893f87496620aa94da27d37a8bddc72f434 no-snesapu.patch |
87 | c84cefc90450bc55710ff2f5d12e13b9cdfaf6342647db9acb4c285b63f9d5712956a34c4725f36f39751f2f17c2561f8b5f7c409cd53358567e5915f7bef6bd samba4.patch | 95 | c84cefc90450bc55710ff2f5d12e13b9cdfaf6342647db9acb4c285b63f9d5712956a34c4725f36f39751f2f17c2561f8b5f7c409cd53358567e5915f7bef6bd samba4.patch |
88 | cba529e5c5f4395fa3858a24259df0688d1a94dbfd5dc4ee5603b72b9e039611cd8a5bf2ccc5f7a4e78dbfb3e557f5fbc6c93e9630c69186e94044e755f39310 xbmc-uclibc.patch" | 96 | 5577264078ce2c649ad0f1dbcfe245571ca525c66f52e05da2d758d0c20236476023912099b3baa40efce2a785dc1684381eb41704b1b420126fbca19a52b0db fix-musl.patch |
97 | 6c470003a03f034f012f9cd97ed479d6bb2d0286d1cf515ff0196d32d62ba6b1a0cf5fea900de04ddda5ce6340afd2593b6d222ea5ebe7c09e654f89eca1d16d fix-fileemu.patch | ||
98 | e1ed2e2e53c20b59f2ea926e9097e99438fdaed9b9d4c0133567bd1c8dc26b003961ad045ce4aaba62e9825e1a2d9651e72bd21bdb09dcc840c8e14d9602d109 fix-rsxs.patch" | ||
diff --git a/main/xbmc/fix-fileemu.patch b/main/xbmc/fix-fileemu.patch new file mode 100644 index 0000000000..f853168c63 --- /dev/null +++ b/main/xbmc/fix-fileemu.patch | |||
@@ -0,0 +1,449 @@ | |||
1 | diff -ru xbmc-12.3-Frodo.orig/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp xbmc-12.3-Frodo/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp | ||
2 | --- xbmc-12.3-Frodo.orig/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp 2013-12-12 21:47:49.000000000 +0000 | ||
3 | +++ xbmc-12.3-Frodo/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp 2014-04-15 07:51:22.843024856 +0000 | ||
4 | @@ -49,6 +49,7 @@ | ||
5 | #include <fcntl.h> | ||
6 | #include <time.h> | ||
7 | #include <signal.h> | ||
8 | +#include <paths.h> | ||
9 | #ifdef _LINUX | ||
10 | #include "PlatformDefs.h" // for __stat64 | ||
11 | #endif | ||
12 | @@ -479,13 +480,10 @@ | ||
13 | EmuFileObject* o = g_emuFileWrapper.GetFileObjectByDescriptor(fd); | ||
14 | if (o) | ||
15 | { | ||
16 | - if(!o->used) | ||
17 | - return NULL; | ||
18 | - | ||
19 | int nmode = convert_fmode(mode); | ||
20 | if( (o->mode & nmode) != nmode) | ||
21 | CLog::Log(LOGWARNING, "dll_fdopen - mode 0x%x differs from fd mode 0x%x", nmode, o->mode); | ||
22 | - return &o->file_emu; | ||
23 | + return g_emuFileWrapper.GetStreamByFileObject(o); | ||
24 | } | ||
25 | else if (!IS_STD_DESCRIPTOR(fd)) | ||
26 | { | ||
27 | @@ -548,7 +546,7 @@ | ||
28 | return -1; | ||
29 | } | ||
30 | object->mode = iMode; | ||
31 | - return g_emuFileWrapper.GetDescriptorByStream(&object->file_emu); | ||
32 | + return g_emuFileWrapper.GetDescriptorByFileObject(object); | ||
33 | } | ||
34 | delete pFile; | ||
35 | return -1; | ||
36 | @@ -1194,8 +1192,8 @@ | ||
37 | { | ||
38 | FILE* file = NULL; | ||
39 | #if defined(_LINUX) && !defined(TARGET_DARWIN) && !defined(__FreeBSD__) && !defined(__ANDROID__) | ||
40 | - if (strcmp(filename, MOUNTED) == 0 | ||
41 | - || strcmp(filename, MNTTAB) == 0) | ||
42 | + if (strcmp(filename, _PATH_MOUNTED) == 0 | ||
43 | + || strcmp(filename, _PATH_MNTTAB) == 0) | ||
44 | { | ||
45 | CLog::Log(LOGINFO, "%s - something opened the mount file, let's hope it knows what it's doing", __FUNCTION__); | ||
46 | return fopen(filename, mode); | ||
47 | @@ -1586,7 +1584,7 @@ | ||
48 | int ret; | ||
49 | |||
50 | ret = dll_fgetpos64(stream, &tmpPos); | ||
51 | -#if !defined(_LINUX) || defined(TARGET_DARWIN) || defined(__FreeBSD__) || defined(__ANDROID__) | ||
52 | +#if !defined(GLIBC) || defined(TARGET_DARWIN) || defined(__FreeBSD__) || defined(__ANDROID__) | ||
53 | *pos = (fpos_t)tmpPos; | ||
54 | #else | ||
55 | pos->__pos = (off_t)tmpPos.__pos; | ||
56 | @@ -1599,8 +1597,9 @@ | ||
57 | CFile* pFile = g_emuFileWrapper.GetFileXbmcByStream(stream); | ||
58 | if (pFile != NULL) | ||
59 | { | ||
60 | -#if !defined(_LINUX) || defined(TARGET_DARWIN) || defined(__FreeBSD__) || defined(__ANDROID__) | ||
61 | - *pos = pFile->GetPosition(); | ||
62 | +#if !defined(GLIBC) || defined(TARGET_DARWIN) || defined(__FreeBSD__) || defined(__ANDROID__) | ||
63 | + uint64_t *ppos = (uint64_t *) pos; | ||
64 | + *ppos = pFile->GetPosition(); | ||
65 | #else | ||
66 | pos->__pos = pFile->GetPosition(); | ||
67 | #endif | ||
68 | @@ -1621,8 +1620,9 @@ | ||
69 | int fd = g_emuFileWrapper.GetDescriptorByStream(stream); | ||
70 | if (fd >= 0) | ||
71 | { | ||
72 | -#if !defined(_LINUX) || defined(TARGET_DARWIN) || defined(__FreeBSD__) || defined(__ANDROID__) | ||
73 | - if (dll_lseeki64(fd, *pos, SEEK_SET) >= 0) | ||
74 | +#if !defined(GLIBC) || defined(TARGET_DARWIN) || defined(__FreeBSD__) || defined(__ANDROID__) | ||
75 | + const uint64_t *ppos = (const uint64_t *) pos; | ||
76 | + if (dll_lseeki64(fd, *ppos, SEEK_SET) >= 0) | ||
77 | #else | ||
78 | if (dll_lseeki64(fd, (__off64_t)pos->__pos, SEEK_SET) >= 0) | ||
79 | #endif | ||
80 | @@ -1654,7 +1654,7 @@ | ||
81 | if (fd >= 0) | ||
82 | { | ||
83 | fpos64_t tmpPos; | ||
84 | -#if !defined(_LINUX) || defined(TARGET_DARWIN) || defined(__FreeBSD__) || defined(__ANDROID__) | ||
85 | +#if !defined(GLIBC) || defined(TARGET_DARWIN) || defined(__FreeBSD__) || defined(__ANDROID__) | ||
86 | tmpPos= *pos; | ||
87 | #else | ||
88 | tmpPos.__pos = (off64_t)(pos->__pos); | ||
89 | diff -ru xbmc-12.3-Frodo.orig/xbmc/cores/DllLoader/exports/emu_msvcrt.h xbmc-12.3-Frodo/xbmc/cores/DllLoader/exports/emu_msvcrt.h | ||
90 | --- xbmc-12.3-Frodo.orig/xbmc/cores/DllLoader/exports/emu_msvcrt.h 2014-04-15 05:52:42.214313750 +0000 | ||
91 | +++ xbmc-12.3-Frodo/xbmc/cores/DllLoader/exports/emu_msvcrt.h 2014-04-15 05:55:24.897232874 +0000 | ||
92 | @@ -26,7 +26,7 @@ | ||
93 | #define _onexit_t void* | ||
94 | #endif | ||
95 | |||
96 | -#if defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) | ||
97 | +#if defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || !defined(GLIBC) | ||
98 | typedef off_t __off_t; | ||
99 | typedef int64_t off64_t; | ||
100 | typedef off64_t __off64_t; | ||
101 | @@ -46,9 +46,9 @@ | ||
102 | |||
103 | typedef void ( *PFV)(void); | ||
104 | |||
105 | -#define __IS_STDIN_STREAM(stream) (stream == stdin || stream->_file == stdin->_file || stream->_file == 0) | ||
106 | -#define __IS_STDOUT_STREAM(stream) (stream == stdout || stream->_file == stdout->_file || stream->_file == 1) | ||
107 | -#define __IS_STDERR_STREAM(stream) (stream == stderr || stream->_file == stderr->_file || stream->_file == 2) | ||
108 | +#define __IS_STDIN_STREAM(stream) (stream == stdin || fileno(stream) == fileno(stdin) || fileno(stream) == 0) | ||
109 | +#define __IS_STDOUT_STREAM(stream) (stream == stdout || fileno(stream) == fileno(stdout) || fileno(stream) == 1) | ||
110 | +#define __IS_STDERR_STREAM(stream) (stream == stderr || fileno(stream) == fileno(stderr) || fileno(stream) == 2) | ||
111 | #define IS_STDIN_STREAM(stream) (stream != NULL && __IS_STDIN_STREAM(stream)) | ||
112 | #define IS_STDOUT_STREAM(stream) (stream != NULL && __IS_STDOUT_STREAM(stream)) | ||
113 | #define IS_STDERR_STREAM(stream) (stream != NULL && __IS_STDERR_STREAM(stream)) | ||
114 | diff -ru xbmc-12.3-Frodo.orig/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.cpp xbmc-12.3-Frodo/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.cpp | ||
115 | --- xbmc-12.3-Frodo.orig/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.cpp 2013-12-12 21:47:49.000000000 +0000 | ||
116 | +++ xbmc-12.3-Frodo/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.cpp 2014-04-15 09:48:39.551659175 +0000 | ||
117 | @@ -27,12 +27,7 @@ | ||
118 | CEmuFileWrapper::CEmuFileWrapper() | ||
119 | { | ||
120 | // since we always use dlls we might just initialize it directly | ||
121 | - for (int i = 0; i < MAX_EMULATED_FILES; i++) | ||
122 | - { | ||
123 | - memset(&m_files[i], 0, sizeof(EmuFileObject)); | ||
124 | - m_files[i].used = false; | ||
125 | - m_files[i].file_emu._file = -1; | ||
126 | - } | ||
127 | + memset(m_files, 0, sizeof(m_files)); | ||
128 | } | ||
129 | |||
130 | CEmuFileWrapper::~CEmuFileWrapper() | ||
131 | @@ -43,22 +38,7 @@ | ||
132 | { | ||
133 | CSingleLock lock(m_criticalSection); | ||
134 | for (int i = 0; i < MAX_EMULATED_FILES; i++) | ||
135 | - { | ||
136 | - if (m_files[i].used) | ||
137 | - { | ||
138 | - m_files[i].file_xbmc->Close(); | ||
139 | - delete m_files[i].file_xbmc; | ||
140 | - | ||
141 | - if (m_files[i].file_lock) | ||
142 | - { | ||
143 | - delete m_files[i].file_lock; | ||
144 | - m_files[i].file_lock = NULL; | ||
145 | - } | ||
146 | - memset(&m_files[i], 0, sizeof(EmuFileObject)); | ||
147 | - m_files[i].used = false; | ||
148 | - m_files[i].file_emu._file = -1; | ||
149 | - } | ||
150 | - } | ||
151 | + UnRegisterFileObject(&m_files[i], true); | ||
152 | } | ||
153 | |||
154 | EmuFileObject* CEmuFileWrapper::RegisterFileObject(XFILE::CFile* pFile) | ||
155 | @@ -69,13 +49,11 @@ | ||
156 | |||
157 | for (int i = 0; i < MAX_EMULATED_FILES; i++) | ||
158 | { | ||
159 | - if (!m_files[i].used) | ||
160 | + if (!m_files[i].file_xbmc) | ||
161 | { | ||
162 | // found a free location | ||
163 | object = &m_files[i]; | ||
164 | - object->used = true; | ||
165 | object->file_xbmc = pFile; | ||
166 | - object->file_emu._file = (i + FILE_WRAPPER_OFFSET); | ||
167 | object->file_lock = new CCriticalSection(); | ||
168 | break; | ||
169 | } | ||
170 | @@ -84,82 +62,71 @@ | ||
171 | return object; | ||
172 | } | ||
173 | |||
174 | -void CEmuFileWrapper::UnRegisterFileObjectByDescriptor(int fd) | ||
175 | +void CEmuFileWrapper::UnRegisterFileObject(EmuFileObject *object, bool free_file) | ||
176 | { | ||
177 | - int i = fd - FILE_WRAPPER_OFFSET; | ||
178 | - if (i >= 0 && i < MAX_EMULATED_FILES) | ||
179 | + if (object && object->file_xbmc) | ||
180 | { | ||
181 | - if (m_files[i].used) | ||
182 | + if (object->file_xbmc && free_file) | ||
183 | { | ||
184 | - CSingleLock lock(m_criticalSection); | ||
185 | - | ||
186 | - // we assume the emulated function alreay deleted the CFile object | ||
187 | - if (m_files[i].used) | ||
188 | - { | ||
189 | - if (m_files[i].file_lock) | ||
190 | - { | ||
191 | - delete m_files[i].file_lock; | ||
192 | - m_files[i].file_lock = NULL; | ||
193 | - } | ||
194 | - memset(&m_files[i], 0, sizeof(EmuFileObject)); | ||
195 | - m_files[i].used = false; | ||
196 | - m_files[i].file_emu._file = -1; | ||
197 | - } | ||
198 | + object->file_xbmc->Close(); | ||
199 | + delete object->file_xbmc; | ||
200 | } | ||
201 | + if (object->file_lock) | ||
202 | + { | ||
203 | + delete object->file_lock; | ||
204 | + } | ||
205 | + | ||
206 | + memset(object, 0, sizeof(*object)); | ||
207 | } | ||
208 | } | ||
209 | |||
210 | +void CEmuFileWrapper::UnRegisterFileObjectByDescriptor(int fd) | ||
211 | +{ | ||
212 | + CSingleLock lock(m_criticalSection); | ||
213 | + UnRegisterFileObject(GetFileObjectByDescriptor(fd), false); | ||
214 | +} | ||
215 | + | ||
216 | void CEmuFileWrapper::UnRegisterFileObjectByStream(FILE* stream) | ||
217 | { | ||
218 | - if (stream != NULL) | ||
219 | - { | ||
220 | - return UnRegisterFileObjectByDescriptor(stream->_file); | ||
221 | - } | ||
222 | + CSingleLock lock(m_criticalSection); | ||
223 | + UnRegisterFileObject(GetFileObjectByStream(stream), false); | ||
224 | } | ||
225 | |||
226 | void CEmuFileWrapper::LockFileObjectByDescriptor(int fd) | ||
227 | { | ||
228 | - int i = fd - FILE_WRAPPER_OFFSET; | ||
229 | - if (i >= 0 && i < MAX_EMULATED_FILES) | ||
230 | + EmuFileObject* object = GetFileObjectByDescriptor(fd); | ||
231 | + if (object && object->file_xbmc) | ||
232 | { | ||
233 | - if (m_files[i].used) | ||
234 | - { | ||
235 | - m_files[i].file_lock->lock(); | ||
236 | - } | ||
237 | + object->file_lock->lock(); | ||
238 | } | ||
239 | } | ||
240 | |||
241 | bool CEmuFileWrapper::TryLockFileObjectByDescriptor(int fd) | ||
242 | -{ | ||
243 | - int i = fd - FILE_WRAPPER_OFFSET; | ||
244 | - if (i >= 0 && i < MAX_EMULATED_FILES) | ||
245 | - { | ||
246 | - if (m_files[i].used) | ||
247 | - { | ||
248 | - return m_files[i].file_lock->try_lock(); | ||
249 | - } | ||
250 | +{ | ||
251 | + EmuFileObject* object = GetFileObjectByDescriptor(fd); | ||
252 | + if (object && object->file_xbmc) | ||
253 | + { | ||
254 | + return object->file_lock->try_lock(); | ||
255 | } | ||
256 | + | ||
257 | return false; | ||
258 | } | ||
259 | |||
260 | void CEmuFileWrapper::UnlockFileObjectByDescriptor(int fd) | ||
261 | -{ | ||
262 | - int i = fd - FILE_WRAPPER_OFFSET; | ||
263 | - if (i >= 0 && i < MAX_EMULATED_FILES) | ||
264 | - { | ||
265 | - if (m_files[i].used) | ||
266 | - { | ||
267 | - m_files[i].file_lock->unlock(); | ||
268 | - } | ||
269 | +{ | ||
270 | + EmuFileObject* object = GetFileObjectByDescriptor(fd); | ||
271 | + if (object && object->file_xbmc) | ||
272 | + { | ||
273 | + object->file_lock->unlock(); | ||
274 | } | ||
275 | } | ||
276 | |||
277 | EmuFileObject* CEmuFileWrapper::GetFileObjectByDescriptor(int fd) | ||
278 | { | ||
279 | - int i = fd - FILE_WRAPPER_OFFSET; | ||
280 | + int i = fd - 0x7000000; | ||
281 | if (i >= 0 && i < MAX_EMULATED_FILES) | ||
282 | { | ||
283 | - if (m_files[i].used) | ||
284 | + if (m_files[i].file_xbmc) | ||
285 | { | ||
286 | return &m_files[i]; | ||
287 | } | ||
288 | @@ -167,20 +134,38 @@ | ||
289 | return NULL; | ||
290 | } | ||
291 | |||
292 | -EmuFileObject* CEmuFileWrapper::GetFileObjectByStream(FILE* stream) | ||
293 | +int CEmuFileWrapper::GetDescriptorByFileObject(EmuFileObject *object) | ||
294 | { | ||
295 | - if (stream != NULL) | ||
296 | + int i = object - m_files; | ||
297 | + if (i >= 0 && i < MAX_EMULATED_FILES) | ||
298 | { | ||
299 | - return GetFileObjectByDescriptor(stream->_file); | ||
300 | + return 0x7000000 + i; | ||
301 | } | ||
302 | + return -1; | ||
303 | +} | ||
304 | |||
305 | +EmuFileObject* CEmuFileWrapper::GetFileObjectByStream(FILE* stream) | ||
306 | +{ | ||
307 | + EmuFileObject *object = (EmuFileObject*) stream; | ||
308 | + if (object >= &m_files[0] || object < &m_files[MAX_EMULATED_FILES]) | ||
309 | + { | ||
310 | + if (object->file_xbmc) | ||
311 | + { | ||
312 | + return object; | ||
313 | + } | ||
314 | + } | ||
315 | return NULL; | ||
316 | } | ||
317 | |||
318 | +FILE* CEmuFileWrapper::GetStreamByFileObject(EmuFileObject *object) | ||
319 | +{ | ||
320 | + return (FILE*) object; | ||
321 | +} | ||
322 | + | ||
323 | XFILE::CFile* CEmuFileWrapper::GetFileXbmcByDescriptor(int fd) | ||
324 | { | ||
325 | EmuFileObject* object = GetFileObjectByDescriptor(fd); | ||
326 | - if (object != NULL && object->used) | ||
327 | + if (object != NULL) | ||
328 | { | ||
329 | return object->file_xbmc; | ||
330 | } | ||
331 | @@ -191,8 +176,8 @@ | ||
332 | { | ||
333 | if (stream != NULL) | ||
334 | { | ||
335 | - EmuFileObject* object = GetFileObjectByDescriptor(stream->_file); | ||
336 | - if (object != NULL && object->used) | ||
337 | + EmuFileObject* object = GetFileObjectByStream(stream); | ||
338 | + if (object != NULL) | ||
339 | { | ||
340 | return object->file_xbmc; | ||
341 | } | ||
342 | @@ -202,42 +187,20 @@ | ||
343 | |||
344 | int CEmuFileWrapper::GetDescriptorByStream(FILE* stream) | ||
345 | { | ||
346 | - if (stream != NULL) | ||
347 | - { | ||
348 | - int i = stream->_file - FILE_WRAPPER_OFFSET; | ||
349 | - if (i >= 0 && i < MAX_EMULATED_FILES) | ||
350 | - { | ||
351 | - return stream->_file; | ||
352 | - } | ||
353 | - } | ||
354 | - return -1; | ||
355 | + return GetDescriptorByFileObject(GetFileObjectByStream(stream)); | ||
356 | } | ||
357 | |||
358 | FILE* CEmuFileWrapper::GetStreamByDescriptor(int fd) | ||
359 | { | ||
360 | - EmuFileObject* object = GetFileObjectByDescriptor(fd); | ||
361 | - if (object != NULL && object->used) | ||
362 | - { | ||
363 | - return &object->file_emu; | ||
364 | - } | ||
365 | - return NULL; | ||
366 | + return GetStreamByFileObject(GetFileObjectByDescriptor(fd)); | ||
367 | } | ||
368 | |||
369 | bool CEmuFileWrapper::DescriptorIsEmulatedFile(int fd) | ||
370 | { | ||
371 | - int i = fd - FILE_WRAPPER_OFFSET; | ||
372 | - if (i >= 0 && i < MAX_EMULATED_FILES) | ||
373 | - { | ||
374 | - return true; | ||
375 | - } | ||
376 | - return false; | ||
377 | + return GetFileObjectByDescriptor(fd) != NULL; | ||
378 | } | ||
379 | |||
380 | bool CEmuFileWrapper::StreamIsEmulatedFile(FILE* stream) | ||
381 | { | ||
382 | - if (stream != NULL) | ||
383 | - { | ||
384 | - return DescriptorIsEmulatedFile(stream->_file); | ||
385 | - } | ||
386 | - return false; | ||
387 | + return GetFileObjectByStream(stream) != NULL; | ||
388 | } | ||
389 | diff -ru xbmc-12.3-Frodo.orig/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.h xbmc-12.3-Frodo/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.h | ||
390 | --- xbmc-12.3-Frodo.orig/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.h 2014-04-15 05:52:42.214313750 +0000 | ||
391 | +++ xbmc-12.3-Frodo/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.h 2014-04-15 08:00:04.209129880 +0000 | ||
392 | @@ -27,12 +27,7 @@ | ||
393 | #include "system.h" | ||
394 | #include "threads/CriticalSection.h" | ||
395 | |||
396 | -#if defined(_LINUX) && !defined(TARGET_DARWIN) && !defined(__FreeBSD__) && !defined(__ANDROID__) | ||
397 | -#define _file _fileno | ||
398 | -#endif | ||
399 | - | ||
400 | #define MAX_EMULATED_FILES 50 | ||
401 | -#define FILE_WRAPPER_OFFSET 0x00000100 | ||
402 | |||
403 | namespace XFILE | ||
404 | { | ||
405 | @@ -41,11 +36,9 @@ | ||
406 | |||
407 | typedef struct stEmuFileObject | ||
408 | { | ||
409 | - bool used; | ||
410 | - FILE file_emu; | ||
411 | - XFILE::CFile* file_xbmc; | ||
412 | + XFILE::CFile* file_xbmc; | ||
413 | CCriticalSection *file_lock; | ||
414 | - int mode; | ||
415 | + int mode; | ||
416 | } EmuFileObject; | ||
417 | |||
418 | class CEmuFileWrapper | ||
419 | @@ -60,13 +53,16 @@ | ||
420 | void CleanUp(); | ||
421 | |||
422 | EmuFileObject* RegisterFileObject(XFILE::CFile* pFile); | ||
423 | + void UnRegisterFileObject(EmuFileObject*, bool free_file); | ||
424 | void UnRegisterFileObjectByDescriptor(int fd); | ||
425 | void UnRegisterFileObjectByStream(FILE* stream); | ||
426 | void LockFileObjectByDescriptor(int fd); | ||
427 | bool TryLockFileObjectByDescriptor(int fd); | ||
428 | void UnlockFileObjectByDescriptor(int fd); | ||
429 | - EmuFileObject* GetFileObjectByDescriptor(int fd); | ||
430 | - EmuFileObject* GetFileObjectByStream(FILE* stream); | ||
431 | + EmuFileObject* GetFileObjectByDescriptor(int fd); | ||
432 | + int GetDescriptorByFileObject(EmuFileObject*); | ||
433 | + EmuFileObject* GetFileObjectByStream(FILE* stream); | ||
434 | + FILE* GetStreamByFileObject(EmuFileObject*); | ||
435 | XFILE::CFile* GetFileXbmcByDescriptor(int fd); | ||
436 | XFILE::CFile* GetFileXbmcByStream(FILE* stream); | ||
437 | int GetDescriptorByStream(FILE* stream); | ||
438 | diff -ru xbmc-12.3-Frodo.orig/xbmc/cores/DllLoader/exports/wrapper.c xbmc-12.3-Frodo/xbmc/cores/DllLoader/exports/wrapper.c | ||
439 | --- xbmc-12.3-Frodo.orig/xbmc/cores/DllLoader/exports/wrapper.c 2013-12-12 21:47:49.000000000 +0000 | ||
440 | +++ xbmc-12.3-Frodo/xbmc/cores/DllLoader/exports/wrapper.c 2014-04-15 07:51:55.146945331 +0000 | ||
441 | @@ -39,7 +39,7 @@ | ||
442 | #endif | ||
443 | #include <dlfcn.h> | ||
444 | |||
445 | -#if defined(TARGET_DARWIN) || defined(__FreeBSD__) || defined(__ANDROID__) | ||
446 | +#if defined(TARGET_DARWIN) || defined(__FreeBSD__) || defined(__ANDROID__) || !defined(GLIBC) | ||
447 | typedef off_t __off_t; | ||
448 | typedef int64_t off64_t; | ||
449 | typedef off64_t __off64_t; | ||
diff --git a/main/xbmc/fix-musl.patch b/main/xbmc/fix-musl.patch new file mode 100644 index 0000000000..f5b4d987c6 --- /dev/null +++ b/main/xbmc/fix-musl.patch | |||
@@ -0,0 +1,93 @@ | |||
1 | diff -ru xbmc-12.3-Frodo.orig/configure.in xbmc-12.3-Frodo/configure.in | ||
2 | --- xbmc-12.3-Frodo.orig/configure.in 2014-04-15 05:52:42.214313750 +0000 | ||
3 | +++ xbmc-12.3-Frodo/configure.in 2014-04-15 05:49:51.921324165 +0000 | ||
4 | @@ -556,11 +556,11 @@ | ||
5 | use_cpu="i686" | ||
6 | ffmpeg_target_os=linux | ||
7 | ;; | ||
8 | - i*86*-linux-gnu*) | ||
9 | + i*86*-linux-gnu*|i*86*-linux-uclibc*|i*86*-linux-musl*) | ||
10 | ARCH="i486-linux" | ||
11 | AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX") | ||
12 | ;; | ||
13 | - x86_64-*-linux-gnu*) | ||
14 | + x86_64-*-linux-gnu*|x86_64-*-linux-uclibc*|x86_64-*-linux-musl*) | ||
15 | ARCH="x86_64-linux" | ||
16 | AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX") | ||
17 | ;; | ||
18 | @@ -619,7 +619,7 @@ | ||
19 | ARCH="powerpc64-linux" | ||
20 | AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_POWERPC64") | ||
21 | ;; | ||
22 | - arm*-*-linux-gnu*) | ||
23 | + arm*-*-linux-gnu*|arm*-*-linux-muslgnu*) | ||
24 | use_texturepacker=no | ||
25 | ARCH="arm" | ||
26 | use_arch="arm" | ||
27 | diff -ru xbmc-12.3-Frodo.orig/lib/SlingboxLib/SlingboxLib.cpp xbmc-12.3-Frodo/lib/SlingboxLib/SlingboxLib.cpp | ||
28 | --- xbmc-12.3-Frodo.orig/lib/SlingboxLib/SlingboxLib.cpp 2013-12-12 21:47:49.000000000 +0000 | ||
29 | +++ xbmc-12.3-Frodo/lib/SlingboxLib/SlingboxLib.cpp 2014-04-15 06:07:15.746789122 +0000 | ||
30 | @@ -29,7 +29,9 @@ | ||
31 | #include <time.h> | ||
32 | #include <netinet/in.h> | ||
33 | #include <arpa/inet.h> | ||
34 | +#include <sys/time.h> | ||
35 | #include <sys/socket.h> | ||
36 | +#include <sys/select.h> | ||
37 | #define INVALID_SOCKET (SOCKET)(~0) | ||
38 | #define SOCKET_ERROR (-1) | ||
39 | #endif | ||
40 | diff -ru xbmc-12.3-Frodo.orig/lib/libXDAAP/thread.h xbmc-12.3-Frodo/lib/libXDAAP/thread.h | ||
41 | --- xbmc-12.3-Frodo.orig/lib/libXDAAP/thread.h 2013-12-12 21:47:49.000000000 +0000 | ||
42 | +++ xbmc-12.3-Frodo/lib/libXDAAP/thread.h 2014-04-15 06:11:09.940947997 +0000 | ||
43 | @@ -37,7 +37,7 @@ | ||
44 | #define ts_mutex pthread_mutex_t | ||
45 | #define ts_condition pthread_cond_t | ||
46 | |||
47 | -#if defined(__APPLE__) || defined(__FreeBSD__) | ||
48 | +#if !defined(PTHREAD_MUTEX_RECURSIVE_NP) | ||
49 | #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE | ||
50 | #endif | ||
51 | |||
52 | diff -ru xbmc-12.3-Frodo.orig/xbmc/visualizations/XBMCProjectM/libprojectM/BeatDetect.cpp xbmc-12.3-Frodo/xbmc/visualizations/XBMCProjectM/libprojectM/BeatDetect.cpp | ||
53 | --- xbmc-12.3-Frodo.orig/xbmc/visualizations/XBMCProjectM/libprojectM/BeatDetect.cpp 2014-04-15 05:52:42.214313750 +0000 | ||
54 | +++ xbmc-12.3-Frodo/xbmc/visualizations/XBMCProjectM/libprojectM/BeatDetect.cpp 2014-04-15 05:49:51.921324165 +0000 | ||
55 | @@ -33,7 +33,7 @@ | ||
56 | |||
57 | #include "Common.hpp" | ||
58 | #include "PCM.hpp" | ||
59 | -#include <cmath> | ||
60 | +#include "math.h" | ||
61 | #include "BeatDetect.hpp" | ||
62 | |||
63 | #ifdef _WIN32 | ||
64 | diff -ru xbmc-12.3-Frodo.orig/tools/TexturePacker/XBTFWriter.cpp xbmc-12.3-Frodo/tools/TexturePacker/XBTFWriter.cpp | ||
65 | --- xbmc-12.3-Frodo.orig/tools/TexturePacker/XBTFWriter.cpp 2013-12-12 21:47:49.000000000 +0000 | ||
66 | +++ xbmc-12.3-Frodo/tools/TexturePacker/XBTFWriter.cpp 2014-04-15 09:58:29.222353358 +0000 | ||
67 | @@ -24,11 +24,7 @@ | ||
68 | #include <inttypes.h> | ||
69 | #include "guilib/XBTF.h" | ||
70 | #include "utils/EndianSwap.h" | ||
71 | -#if defined(__FreeBSD__) | ||
72 | #include <stdlib.h> | ||
73 | -#elif !defined(__APPLE__) | ||
74 | -#include <malloc.h> | ||
75 | -#endif | ||
76 | #include <memory.h> | ||
77 | |||
78 | #define WRITE_STR(str, size, file) fwrite(str, size, 1, file) | ||
79 | diff -ru xbmc-12.3-Frodo.orig/xbmc/cores/DllLoader/ldt_keeper.c xbmc-12.3-Frodo/xbmc/cores/DllLoader/ldt_keeper.c | ||
80 | --- xbmc-12.3-Frodo.orig/xbmc/cores/DllLoader/ldt_keeper.c 2013-12-12 21:47:49.000000000 +0000 | ||
81 | +++ xbmc-12.3-Frodo/xbmc/cores/DllLoader/ldt_keeper.c 2014-04-15 10:10:17.091888453 +0000 | ||
82 | @@ -48,11 +48,7 @@ | ||
83 | #if defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 0)) | ||
84 | _syscall3( int, modify_ldt, int, func, void *, ptr, unsigned long, bytecount ); | ||
85 | #else | ||
86 | -#if defined(__ANDROID__) && defined(__i386__) && !defined(modify_ldt) | ||
87 | #define modify_ldt(a,b,c) syscall( __NR_modify_ldt, a, b, c); | ||
88 | -#else | ||
89 | -int modify_ldt(int func, void *ptr, unsigned long bytecount); | ||
90 | -#endif | ||
91 | #endif | ||
92 | #ifdef __cplusplus | ||
93 | } | ||
diff --git a/main/xbmc/fix-rsxs.patch b/main/xbmc/fix-rsxs.patch new file mode 100644 index 0000000000..ccc7698c73 --- /dev/null +++ b/main/xbmc/fix-rsxs.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | --- xbmc-12.3-Frodo/xbmc/screensavers/rsxs-0.9/configure.ac 2014-04-15 10:22:51.025587069 +0000 | ||
2 | +++ xbmc-12.3-Frodo/xbmc/screensavers/rsxs-0.9/configure.ac 2014-04-15 10:21:51.947852111 +0000 | ||
3 | @@ -14,18 +14,13 @@ | ||
4 | |||
5 | # Checks for programs. | ||
6 | LT_AC_PROG_SED | ||
7 | -AC_LANG(C++) | ||
8 | -AC_PROG_CXX | ||
9 | -#CXXFLAGS=`echo $CXXFLAGS | sed -e s,-O2,-O3,` | ||
10 | -AC_PROG_CXXCPP | ||
11 | - | ||
12 | -#if test x"$GXX" = x"yes"; then | ||
13 | -# CXXFLAGS=`echo $CXXFLAGS -Wall` | ||
14 | -#fi | ||
15 | |||
16 | AC_PROG_CC | ||
17 | AM_PROG_CC_C_O | ||
18 | gl_EARLY | ||
19 | +AC_PROG_CXX | ||
20 | +AC_PROG_CXXCPP | ||
21 | + | ||
22 | AC_PROG_RANLIB | ||
23 | |||
24 | # Cut-down version of AC_LIB_LTDL. We don't want the option to install | ||
diff --git a/main/xbmc/xbmc-uclibc.patch b/main/xbmc/xbmc-uclibc.patch deleted file mode 100644 index 233770b77d..0000000000 --- a/main/xbmc/xbmc-uclibc.patch +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | --- a/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.h.orig | ||
2 | +++ b/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.h | ||
3 | @@ -27,8 +27,10 @@ | ||
4 | #include "system.h" | ||
5 | #include "threads/CriticalSection.h" | ||
6 | |||
7 | -#if defined(_LINUX) && !defined(TARGET_DARWIN) && !defined(__FreeBSD__) && !defined(__ANDROID__) | ||
8 | +#if defined(_LINUX) && !defined(TARGET_DARWIN) && !defined(__FreeBSD__) && !defined(__ANDROID__) && !defined(__UCLIBC__) | ||
9 | #define _file _fileno | ||
10 | +#elif defined(__UCLIBC__) | ||
11 | +#define _file __filedes | ||
12 | #endif | ||
13 | |||
14 | #define MAX_EMULATED_FILES 50 | ||
15 | --- a/xbmc/cores/DllLoader/exports/emu_msvcrt.h.orig | ||
16 | +++ b/xbmc/cores/DllLoader/exports/emu_msvcrt.h | ||
17 | @@ -46,9 +46,9 @@ | ||
18 | |||
19 | typedef void ( *PFV)(void); | ||
20 | |||
21 | -#define __IS_STDIN_STREAM(stream) (stream == stdin || stream->_file == stdin->_file || stream->_file == 0) | ||
22 | -#define __IS_STDOUT_STREAM(stream) (stream == stdout || stream->_file == stdout->_file || stream->_file == 1) | ||
23 | -#define __IS_STDERR_STREAM(stream) (stream == stderr || stream->_file == stderr->_file || stream->_file == 2) | ||
24 | +#define __IS_STDIN_STREAM(stream) (stream == stdin || fileno(stream) == fileno(stdin) || fileno(stream) == 0) | ||
25 | +#define __IS_STDOUT_STREAM(stream) (stream == stdout || fileno(stream) == fileno(stdout) || fileno(stream) == 1) | ||
26 | +#define __IS_STDERR_STREAM(stream) (stream == stderr || fileno(stream) == fileno(stderr) || fileno(stream) == 2) | ||
27 | #define IS_STDIN_STREAM(stream) (stream != NULL && __IS_STDIN_STREAM(stream)) | ||
28 | #define IS_STDOUT_STREAM(stream) (stream != NULL && __IS_STDOUT_STREAM(stream)) | ||
29 | #define IS_STDERR_STREAM(stream) (stream != NULL && __IS_STDERR_STREAM(stream)) | ||
30 | --- a/xbmc/visualizations/XBMCProjectM/libprojectM/BeatDetect.cpp.orig | ||
31 | +++ b/xbmc/visualizations/XBMCProjectM/libprojectM/BeatDetect.cpp | ||
32 | @@ -33,7 +33,7 @@ | ||
33 | |||
34 | #include "Common.hpp" | ||
35 | #include "PCM.hpp" | ||
36 | -#include <cmath> | ||
37 | +#include "math.h" | ||
38 | #include "BeatDetect.hpp" | ||
39 | |||
40 | #ifdef _WIN32 | ||
41 | |||
42 | --- ./configure.in.orig 2013-05-03 05:57:40.000000000 +0000 | ||
43 | +++ ./configure.in 2013-07-08 07:42:11.960541402 +0000 | ||
44 | @@ -556,11 +556,11 @@ | ||
45 | use_cpu="i686" | ||
46 | ffmpeg_target_os=linux | ||
47 | ;; | ||
48 | - i*86*-linux-gnu*) | ||
49 | + i*86*-linux-gnu*|i*86*-linux-uclibc*) | ||
50 | ARCH="i486-linux" | ||
51 | AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX") | ||
52 | ;; | ||
53 | - x86_64-*-linux-gnu*) | ||
54 | + x86_64-*-linux-gnu*|x86_64-*-linux-uclibc*) | ||
55 | ARCH="x86_64-linux" | ||
56 | AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX") | ||
57 | ;; | ||