Source: handbrake Version: 0.9.9+svn6422+dfsg1-1 Severity: important Tags: patch User: debian-h...@lists.debian.org Usertags: hurd
Hi, Currently handbrake fails to build from source due to usage of PATH_MAX, which is not defined on GNU/Hurd. Another issue is missing linkage with libpthread, the same as for kFreeBSD, see #730976 For the PATH_MAX issues strcmp and strlen are used instead of strncmp and strnlen, respectively. According to the submitters knowledge there is no big difference between these functions, and the chosen functions avoid the on some systems undefined constant PATH_MAX. If there is a wish to keep the old code a conditional test can easily be made, please let me know, and I'll create a patch depending on if PATH_MAX is defined or not. The attached patch fixes these build problems. Thanks!
Index: handbrake-0.9.9+svn6422+dfsg1/test/module.defs =================================================================== --- handbrake-0.9.9+svn6422+dfsg1.orig/test/module.defs +++ handbrake-0.9.9+svn6422+dfsg1/test/module.defs @@ -46,6 +46,8 @@ ifeq ($(BUILD.system),darwin) TEST.GCC.l += iconv else ifeq ($(BUILD.system),linux) TEST.GCC.l += pthread dl m +else ifeq ($(BUILD.system),gnu) + TEST.GCC.l += pthread dl m else ifeq ($(BUILD.system),solaris) TEST.GCC.l += pthread nsl socket iconv TEST.GCC.D += _POSIX_C_SOURCE=200112L __EXTENSIONS__ Index: handbrake-0.9.9+svn6422+dfsg1/libhb/batch.c =================================================================== --- handbrake-0.9.9+svn6422+dfsg1.orig/libhb/batch.c +++ handbrake-0.9.9+svn6422+dfsg1/libhb/batch.c @@ -18,7 +18,7 @@ struct hb_batch_s static int compare_str(const void *a, const void *b) { - return strncmp(*(const char**)a, *(const char**)b, PATH_MAX); + return strcmp(*(const char**)a, *(const char**)b); } /*********************************************************************** Index: handbrake-0.9.9+svn6422+dfsg1/gtk/src/queuehandler.c =================================================================== --- handbrake-0.9.9+svn6422+dfsg1.orig/gtk/src/queuehandler.c +++ handbrake-0.9.9+svn6422+dfsg1/gtk/src/queuehandler.c @@ -987,7 +987,7 @@ title_multiple_can_select(GValue *settin settings = ghb_array_get_nth(settings_array, ii); gdest = ghb_settings_get_value(settings, "destination"); tmp = g_value_get_string(gdest); - if (tmp != NULL && !strncmp(dest, tmp, PATH_MAX)) + if (tmp != NULL && !strcmp(dest, tmp)) return FALSE; } return TRUE; @@ -1449,7 +1449,7 @@ queue_add_multiple_clicked_cb(GtkWidget int len; title_label = ghb_create_title_label(title); - len = strnlen(title_label, PATH_MAX); + len = strlen(title_label); if (len > max_title_len) max_title_len = len;