[SCM] mplayer/master: Fix FTBFS in GNU/Hurd.
micove-guest at users.alioth.debian.org
micove-guest at users.alioth.debian.org
Wed May 25 16:04:48 UTC 2016
The following commit has been merged in the master branch:
commit c4052a3b881e578f0ee401ed17f018c9bb844af1
Author: Miguel A. Colón Vélez <debian.micove at gmail.com>
Date: Wed May 25 11:51:29 2016 -0400
Fix FTBFS in GNU/Hurd.
diff --git a/debian/patches/0200_Hurd_PATH_MAX.patch b/debian/patches/0200_Hurd_PATH_MAX.patch
deleted file mode 100644
index 89f8260..0000000
--- a/debian/patches/0200_Hurd_PATH_MAX.patch
+++ /dev/null
@@ -1,274 +0,0 @@
-Author: Samuel Thibault <sthibault at debian.org>
-Description: fix FTBFS on the Hurd
-Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=654974
-
---- a/libmenu/menu_filesel.c
-+++ b/libmenu/menu_filesel.c
-@@ -16,6 +16,9 @@
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-+#ifdef __GNU__
-+#define _GNU_SOURCE
-+#endif
- #include <stdlib.h>
- #include <stdio.h>
- #include <dirent.h>
-@@ -420,7 +423,11 @@
- static int open_fs(menu_t* menu, char* av_unused args) {
- char *path = mpriv->path;
- int r = 0;
-+#ifdef __GNU__
-+ char *wd, *b = NULL;
-+#else
- char wd[PATH_MAX+1], b[PATH_MAX+1];
-+#endif
-
- menu->draw = menu_list_draw;
- menu->read_cmd = read_cmd;
-@@ -448,7 +455,11 @@
- }
- }
-
-+#ifdef __GNU__
-+ wd = get_current_dir_name();
-+#else
- getcwd(wd,PATH_MAX);
-+#endif
- if (!path || path[0] == '\0') {
- #if 0
- char *slash = NULL;
-@@ -467,13 +478,24 @@
- path = wd;
- }
- if (path[0] != '/') {
-+#ifdef __GNU__
-+ if(path[strlen(path)-1] != '/')
-+ asprintf(&b,"%s/%s/",wd,path);
-+ else
-+ asprintf(&b,"%s/%s",wd,path);
-+#else
- if(path[strlen(path)-1] != '/')
- snprintf(b,sizeof(b),"%s/%s/",wd,path);
- else
- snprintf(b,sizeof(b),"%s/%s",wd,path);
-+#endif
- path = b;
- } else if (path[strlen(path)-1]!='/') {
-+#ifdef __GNU__
-+ asprintf(&b,"%s/",path);
-+#else
- sprintf(b,"%s/",path);
-+#endif
- path = b;
- }
- if (menu_chroot && menu_chroot[0] == '/') {
-@@ -484,13 +506,22 @@
- if (menu_chroot[l] == '/')
- path = menu_chroot;
- else {
-+#ifdef __GNU__
-+ asprintf(&b,"%s/",menu_chroot);
-+#else
- sprintf(b,"%s/",menu_chroot);
-+#endif
- path = b;
- }
- }
- }
- r = open_dir(menu,path);
-
-+#ifdef __GNU__
-+ free(wd);
-+ free(b);
-+#endif
-+
- return r;
- }
-
---- a/libmpdemux/mf.c
-+++ b/libmpdemux/mf.c
-@@ -18,6 +18,9 @@
-
- #define _BSD_SOURCE
-
-+#ifdef __GNU__
-+#define _GNU_SOURCE
-+#endif
- #include <ctype.h>
- #include <stdio.h>
- #include <stdlib.h>
-@@ -66,8 +69,13 @@
- FILE *lst_f=fopen(filename + 1,"r");
- if ( lst_f )
- {
-+#ifdef __GNU__
-+ fname=NULL;
-+ while ( getline( &fname, 0, lst_f ) >= 0 )
-+#else
- fname=malloc(PATH_MAX);
- while ( fgets( fname,PATH_MAX,lst_f ) )
-+#endif
- {
- /* remove spaces from end of fname */
- char *t=fname + strlen( fname ) - 1;
-@@ -82,6 +90,10 @@
- mf->names[mf->nr_of_files]=strdup( fname );
- mf->nr_of_files++;
- }
-+#ifdef __GNU__
-+ free( fname );
-+ fname=NULL;
-+#endif
- }
- fclose( lst_f );
-
---- a/stream/stream_bd.c
-+++ b/stream/stream_bd.c
-@@ -19,6 +19,10 @@
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-+#ifdef __GNU__
-+#define _GNU_SOURCE
-+#endif
-+
- #include <stdio.h>
- #include <limits.h>
- #include <ctype.h>
-@@ -148,7 +152,11 @@
- static int find_vuk(struct bd_priv *bd, const uint8_t discid[20])
- {
- char line[1024];
-+#ifdef __GNU__
-+ char *filename;
-+#else
- char filename[PATH_MAX];
-+#endif
- const char *home;
- int vukfound = 0;
- stream_t *file;
-@@ -156,13 +164,23 @@
-
- // look up discid in KEYDB.cfg to get VUK
- home = getenv("HOME");
-+#ifdef __GNU__
-+ asprintf(&filename, "%s/.dvdcss/KEYDB.cfg", home);
-+#else
- snprintf(filename, sizeof(filename), "%s/.dvdcss/KEYDB.cfg", home);
-+#endif
- file = open_stream(filename, NULL, NULL);
- if (!file) {
- mp_msg(MSGT_OPEN,MSGL_ERR,
- "Cannot open VUK database file %s\n", filename);
-+#ifdef __GNU__
-+ free(filename);
-+#endif
- return 0;
- }
-+#ifdef __GNU__
-+ free(filename);
-+#endif
- id2str(discid, 20, idstr);
- while (stream_read_line(file, line, sizeof(line), 0)) {
- char *vst;
-@@ -207,23 +225,40 @@
- struct AVAES *a;
- struct AVSHA *asha;
- stream_t *file;
-+#ifdef __GNU__
-+ char *filename;
-+#else
- char filename[PATH_MAX];
-+#endif
- uint8_t discid[20];
- char idstr[ID_STR_LEN];
-
-+#ifdef __GNU__
-+ asprintf(&filename, BD_UKF_PATH, bd->device);
-+#else
- snprintf(filename, sizeof(filename), BD_UKF_PATH, bd->device);
-+#endif
- file = open_stream(filename, NULL, NULL);
- if (!file) {
- mp_msg(MSGT_OPEN, MSGL_ERR,
- "Cannot open file %s to get UK and DiscID\n", filename);
-+#ifdef __GNU__
-+ free(filename);
-+#endif
- return 0;
- }
- file_size = file->end_pos;
- if (file_size <= 0 || file_size > 10 * 1024* 1024) {
- mp_msg(MSGT_OPEN, MSGL_ERR, "File %s too large\n", filename);
- free_stream(file);
-+#ifdef __GNU__
-+ free(filename);
-+#endif
- return 0;
- }
-+#ifdef __GNU__
-+ free(filename);
-+#endif
- buf = av_malloc(file_size);
- stream_read(file, buf, file_size);
- free_stream(file);
-@@ -414,15 +449,29 @@
- {
- int i;
- int langmap_offset, index_offset, end_offset;
-+#ifdef __GNU__
-+ char *filename;
-+#else
- char filename[PATH_MAX];
-+#endif
- stream_t *file;
-
-+#ifdef __GNU__
-+ asprintf(&filename, BD_CLIPINF_PATH, bd->device, bd->title);
-+#else
- snprintf(filename, sizeof(filename), BD_CLIPINF_PATH, bd->device, bd->title);
-+#endif
- file = open_stream(filename, NULL, NULL);
- if (!file) {
- mp_msg(MSGT_OPEN, MSGL_ERR, "Cannot open clipinf %s\n", filename);
-+#ifdef __GNU__
-+ free(filename);
-+#endif
- return;
- }
-+#ifdef __GNU__
-+ free(filename);
-+#endif
- if (stream_read_qword(file) != AV_RB64("HDMV0200")) {
- mp_msg(MSGT_OPEN, MSGL_ERR, "Unknown clipinf format\n");
- return;
-@@ -472,7 +521,11 @@
-
- static int bd_stream_open(stream_t *s, int mode, void* opts, int* file_format)
- {
-+#ifdef __GNU__
-+ char *filename;
-+#else
- char filename[PATH_MAX];
-+#endif
-
- struct stream_priv_s* p = opts;
- struct bd_priv *bd = calloc(1, sizeof(*bd));
-@@ -509,9 +562,16 @@
- // set up AES key from uk
- av_aes_init(bd->aeseed, bd->uks.keys[0].u8, 128, 0);
-
-+#ifdef __GNU__
-+ asprintf(&filename, BD_M2TS_PATH, bd->device, bd->title);
-+#else
- snprintf(filename, sizeof(filename), BD_M2TS_PATH, bd->device, bd->title);
-+#endif
- mp_msg(MSGT_OPEN, MSGL_STATUS, "Opening %s\n", filename);
- bd->title_file = open_stream(filename, NULL, NULL);
-+#ifdef __GNU__
-+ free(filename);
-+#endif
- if (!bd->title_file)
- return STREAM_ERROR;
- s->end_pos = bd->title_file->end_pos;
diff --git a/debian/patches/0201_PATH_MAX_HURD.patch b/debian/patches/0201_PATH_MAX_HURD.patch
index 88af0da..3548b87 100644
--- a/debian/patches/0201_PATH_MAX_HURD.patch
+++ b/debian/patches/0201_PATH_MAX_HURD.patch
@@ -8,7 +8,7 @@ Description: Fix FTBFS in GNU/Hurd.
improved patch for that.
Author: Miguel A. Colón Vélez <debian.micove at gmail.com>
Forwarded: yes
-Last-Update: 2015-09-15
+Last-Update: 2016-05-25
--- a/gui/dialog/fileselect.c
+++ b/gui/dialog/fileselect.c
@@ -32,12 +32,26 @@ Last-Update: 2015-09-15
*/
+#ifdef __GNU__
-+#define _BSD_SOURCE
++# define _BSD_SOURCE
+#endif
+
#include <sys/types.h>
#include <sys/time.h>
#include <sys/socket.h>
+--- a/libmenu/menu_filesel.c
++++ b/libmenu/menu_filesel.c
+@@ -51,6 +51,11 @@
+
+ #define MENU_KEEP_PATH "/tmp/mp_current_path"
+
++// FIXME: Some systems don't define PATH_MAX (Example: GNU/Hurd)
++#ifndef PATH_MAX
++# define PATH_MAX 4096
++#endif
++
+ int menu_keepdir = 0;
+ char *menu_chroot = NULL;
+
--- a/libmpcodecs/vf_screenshot.c
+++ b/libmpcodecs/vf_screenshot.c
@@ -38,6 +38,11 @@
@@ -52,6 +66,20 @@ Last-Update: 2015-09-15
struct vf_priv_s {
int frameno;
char fname[PATH_MAX];
+--- a/libmpdemux/mf.c
++++ b/libmpdemux/mf.c
+@@ -40,6 +40,11 @@
+
+ #include "mf.h"
+
++// FIXME: Some systems don't define PATH_MAX (Example: GNU/Hurd)
++#ifndef PATH_MAX
++# define PATH_MAX 4096
++#endif
++
+ int mf_w = 0; //352; // let codecs to detect it
+ int mf_h = 0; //288;
+ double mf_fps = 25.0;
--- a/mplayer.c
+++ b/mplayer.c
@@ -335,6 +335,11 @@
@@ -80,3 +108,17 @@ Last-Update: 2015-09-15
#define fopen(n, m) \
(strlen(n) >= PATH_MAX ? (errno = ENAMETOOLONG, NULL) : (fopen)(n, m))
+--- a/stream/stream_bd.c
++++ b/stream/stream_bd.c
+@@ -36,6 +36,11 @@
+ #include "stream.h"
+ #include "stream_bd.h"
+
++// FIXME: Some systems don't define PATH_MAX (Example: GNU/Hurd)
++#ifndef PATH_MAX
++# define PATH_MAX 4096
++#endif
++
+ static const int BD_UNIT_SIZE = 6144;
+ static const char BD_UKF_PATH[] = "%s/AACS/Unit_Key_RO.inf";
+ static const char BD_M2TS_PATH[] = "%s/BDMV/STREAM/%05d.m2ts";
diff --git a/debian/patches/series b/debian/patches/series
index b22e40c..0ad6c4e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,6 +1,5 @@
0001_version.patch
0002_mplayer_debug_printf.patch
0100_svn37857_CVE-2016-4352.patch
-#0200_Hurd_PATH_MAX.patch
0200_fix_spelling_error_in_binary.patch
0201_PATH_MAX_HURD.patch
--
mplayer packaging
More information about the pkg-multimedia-commits
mailing list