diff options
author | jperkin <jperkin@pkgsrc.org> | 2016-02-23 11:16:55 +0000 |
---|---|---|
committer | jperkin <jperkin@pkgsrc.org> | 2016-02-23 11:16:55 +0000 |
commit | 99ba19f411656ea1479a4507a7f44bf4ca18d51f (patch) | |
tree | cf9b9873164f06cc67d9cfc350375232963a6905 /graphics/MesaLib | |
parent | ddfa89e4ae927b6d5b3857cb55de2a6149b3df4f (diff) | |
download | pkgsrc-99ba19f411656ea1479a4507a7f44bf4ca18d51f.tar.gz |
Provide compat strndup/strnlen for older Darwin.
Diffstat (limited to 'graphics/MesaLib')
6 files changed, 129 insertions, 9 deletions
diff --git a/graphics/MesaLib/distinfo b/graphics/MesaLib/distinfo index 9df2134b31e..14d5b7cfa37 100644 --- a/graphics/MesaLib/distinfo +++ b/graphics/MesaLib/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.113 2016/02/13 11:45:17 wiz Exp $ +$NetBSD: distinfo,v 1.114 2016/02/23 11:16:55 jperkin Exp $ SHA1 (mesa-11.1.2.tar.xz) = f6c306828427ad694885ebd488d3b7681eaafa87 RMD160 (mesa-11.1.2.tar.xz) = 6d47d523dc79260dfbc57fa24724cef804c794b3 @@ -7,6 +7,7 @@ Size (mesa-11.1.2.tar.xz) = 7561920 bytes SHA1 (patch-configure) = 87f0f2e60f342c91b3aecab02d3a4d8940eadf0a SHA1 (patch-include_GL_glxext.h) = 830902f2d38a8395cda682c059fc5223e1b0e89e SHA1 (patch-src_egl_drivers_dri2_platform__drm.c) = 99b6dd6739c29551ae2c885eabd7babd159fc3e5 +SHA1 (patch-src_egl_drivers_dri2_platform__x11.c) = 8102c982cefc3fff667b6e30b7b3133f5e0f2143 SHA1 (patch-src_egl_main_eglglobals.c) = 2d81ae27f09162d23bc684456cc5fef48c042652 SHA1 (patch-src_gallium_auxiliary_util_u__format__tests.c) = 4d5e4677c2825778c43440ab131b8807f6840975 SHA1 (patch-src_gallium_auxiliary_util_u__math.h) = 812e4a5291aea47e06505f09891e0434c4d9c34d @@ -21,7 +22,7 @@ SHA1 (patch-src_gallium_winsys_svga_drm_vmw__screen.c) = 4b2ae565377b1a0396c8bf6 SHA1 (patch-src_gallium_winsys_svga_drm_vmw__screen__ioctl.c) = e4b891e8b4ebe5b8e8c7b8c2c1dbed11b9c417df SHA1 (patch-src_gbm_main_gbm.c) = 70225ab7352f123c9efc68b6d4ff0d9675b6f9dc SHA1 (patch-src_glsl_glsl__parser__extras.cpp) = eb05a70782edb0ccb82c04ef17de60352c840268 -SHA1 (patch-src_glsl_ralloc.c) = 7443d00ff05ee1e1dcfa2b76972b55abadebcad8 +SHA1 (patch-src_glsl_ralloc.c) = 63c8e40b9f74404033c20c5c9a00c5f6d8df6433 SHA1 (patch-src_glx_apple_apple__glapi.c) = df70afc24759978f954ac3a774a14e6518dde97a SHA1 (patch-src_glx_glxclient.h) = e15256851559dafb7a86e1eb7e9d6afc86de581b SHA1 (patch-src_glx_glxcurrent.c) = 713f75bcafb186c7123d19a6aae3deaed9d5fa69 @@ -35,7 +36,7 @@ SHA1 (patch-src_mapi_u__current.c) = 1731375d82119be326b35d141d7879e083d6d620 SHA1 (patch-src_mapi_u__current.h) = 214dd29cb0c4fe127eb1157b04b12ddfc455b4b0 SHA1 (patch-src_mesa_drivers_dri_Makefile.in) = 48032b8f8e6eac59092f68f3c32cfdd44d7ce8bf SHA1 (patch-src_mesa_drivers_dri_common_Makefile.in) = 5e160f7d92c2e9f3fa36e52a082a496af67e634e -SHA1 (patch-src_mesa_drivers_dri_common_xmlconfig.c) = 668cc1d6a58f8f02eb9eb32c1aeffb4bef7beaf4 +SHA1 (patch-src_mesa_drivers_dri_common_xmlconfig.c) = b87644c5ef5fb5d71c3260026d3afdfbaee749a8 SHA1 (patch-src_mesa_drivers_dri_i915_intel__screen.c) = fd8436e4e3a69250256c2cddf8138effb16bd7b3 SHA1 (patch-src_mesa_drivers_dri_i965_intel__screen.c) = 7c1a1e5c549f64d4c390e0c87984c44a88d4abfe SHA1 (patch-src_mesa_drivers_dri_swrast_swrast.c) = b8a6cca517e1cccbdb2c59cf67a6d2481cdfebd4 @@ -45,4 +46,6 @@ SHA1 (patch-src_mesa_main_macros.h) = e0e98dff37bbf96fea2f3adf0dc9ef9911b711d9 SHA1 (patch-src_mesa_main_shader__query.cpp) = 6273c74161f045363c58f38adeb672287f6a0898 SHA1 (patch-src_mesa_tnl_t__pipeline.c) = afc7d5f27aeadacc7c6a762e5aa892e01a0c1317 SHA1 (patch-src_mesa_x86_common__x86.c) = bdac91384d67ad0238ecd4cdcf5cfc787952a3d9 +SHA1 (patch-src_util_strndup.c) = b8dfae71f1b219e44f884b8fc6f89a86201353c3 +SHA1 (patch-src_util_strndup.h) = a48a0ebefbc79a770db4baa590d3f858bb52cacf SHA1 (patch-src_util_u__atomic.h) = 4a567b6fe5bf67fb7f386fa5f37bedb66d593085 diff --git a/graphics/MesaLib/patches/patch-src_egl_drivers_dri2_platform__x11.c b/graphics/MesaLib/patches/patch-src_egl_drivers_dri2_platform__x11.c new file mode 100644 index 00000000000..02bc9d26104 --- /dev/null +++ b/graphics/MesaLib/patches/patch-src_egl_drivers_dri2_platform__x11.c @@ -0,0 +1,30 @@ +$NetBSD: patch-src_egl_drivers_dri2_platform__x11.c,v 1.1 2016/02/23 11:16:55 jperkin Exp $ + +Provide compat strndup for older Darwin. + +--- src/egl/drivers/dri2/platform_x11.c.orig 2016-01-29 12:21:30.000000000 +0000 ++++ src/egl/drivers/dri2/platform_x11.c +@@ -540,6 +540,23 @@ dri2_x11_flush_front_buffer(__DRIdrawabl + #endif + } + ++#if (defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 < 1070) ++static char * ++strndup(const char *s, int length) ++{ ++ char *d; ++ ++ d = malloc(length + 1); ++ if (d == NULL) ++ return NULL; ++ ++ memcpy(d, s, length); ++ d[length] = '\0'; ++ ++ return d; ++} ++#endif ++ + static EGLBoolean + dri2_x11_connect(struct dri2_egl_display *dri2_dpy) + { diff --git a/graphics/MesaLib/patches/patch-src_glsl_ralloc.c b/graphics/MesaLib/patches/patch-src_glsl_ralloc.c index e29c842cc5e..f0e3ba6314a 100644 --- a/graphics/MesaLib/patches/patch-src_glsl_ralloc.c +++ b/graphics/MesaLib/patches/patch-src_glsl_ralloc.c @@ -1,10 +1,11 @@ -$NetBSD: patch-src_glsl_ralloc.c,v 1.3 2015/04/25 11:19:18 tnn Exp $ +$NetBSD: patch-src_glsl_ralloc.c,v 1.4 2016/02/23 11:16:55 jperkin Exp $ * Fix exit time segfault of qt5 application with modular xorg +* Provide compat strnlen for older Darwin. ---- src/util/ralloc.c.orig 2014-10-03 03:59:51.000000000 +0000 +--- src/util/ralloc.c.orig 2016-01-29 12:21:30.000000000 +0000 +++ src/util/ralloc.c -@@ -285,7 +285,7 @@ ralloc_parent(const void *ptr) +@@ -312,7 +312,7 @@ ralloc_parent(const void *ptr) static void *autofree_context = NULL; @@ -13,7 +14,7 @@ $NetBSD: patch-src_glsl_ralloc.c,v 1.3 2015/04/25 11:19:18 tnn Exp $ autofree(void) { ralloc_free(autofree_context); -@@ -296,7 +296,6 @@ ralloc_autofree_context(void) +@@ -323,7 +323,6 @@ ralloc_autofree_context(void) { if (unlikely(autofree_context == NULL)) { autofree_context = ralloc_context(NULL); @@ -21,3 +22,18 @@ $NetBSD: patch-src_glsl_ralloc.c,v 1.3 2015/04/25 11:19:18 tnn Exp $ } return autofree_context; } +@@ -360,7 +359,14 @@ ralloc_strndup(const void *ctx, const ch + if (unlikely(str == NULL)) + return NULL; + ++#if (defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 < 1070) ++ for (n = 0; n < max; n++, str++) { ++ if (!*str) ++ break; ++ } ++#else + n = strnlen(str, max); ++#endif + ptr = ralloc_array(ctx, char, n + 1); + memcpy(ptr, str, n); + ptr[n] = '\0'; diff --git a/graphics/MesaLib/patches/patch-src_mesa_drivers_dri_common_xmlconfig.c b/graphics/MesaLib/patches/patch-src_mesa_drivers_dri_common_xmlconfig.c index fbd0c9d895d..22dafc62fe7 100644 --- a/graphics/MesaLib/patches/patch-src_mesa_drivers_dri_common_xmlconfig.c +++ b/graphics/MesaLib/patches/patch-src_mesa_drivers_dri_common_xmlconfig.c @@ -1,8 +1,9 @@ -$NetBSD: patch-src_mesa_drivers_dri_common_xmlconfig.c,v 1.2 2015/09/11 00:03:36 tnn Exp $ +$NetBSD: patch-src_mesa_drivers_dri_common_xmlconfig.c,v 1.3 2016/02/23 11:16:55 jperkin Exp $ PR pkg/50202. +Provide compat strndup for older Darwin. ---- src/mesa/drivers/dri/common/xmlconfig.c.orig 2015-07-14 18:10:47.000000000 +0000 +--- src/mesa/drivers/dri/common/xmlconfig.c.orig 2016-01-29 12:21:30.000000000 +0000 +++ src/mesa/drivers/dri/common/xmlconfig.c @@ -50,12 +50,17 @@ extern char *program_invocation_name, *p # define GET_PROGRAM_NAME() program_invocation_short_name @@ -22,3 +23,28 @@ PR pkg/50202. #elif defined(__NetBSD__) && defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106000100) # include <stdlib.h> # define GET_PROGRAM_NAME() getprogname() +@@ -111,6 +116,24 @@ static const char *__getProgramName () { + # endif + #endif + ++#if (defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 < 1070) ++static char * ++strndup(const char *str, size_t n) ++{ ++ size_t len; ++ char *copy; ++ ++ for (len = 0; len < n && str[len]; len++) ++ continue; ++ ++ if ((copy = (char *)malloc(len + 1)) == NULL) ++ return (NULL); ++ memcpy(copy, str, len); ++ copy[len] = '\0'; ++ return (copy); ++} ++#endif ++ + /** \brief Find an option in an option cache with the name as key */ + static uint32_t findOption (const driOptionCache *cache, const char *name) { + uint32_t len = strlen (name); diff --git a/graphics/MesaLib/patches/patch-src_util_strndup.c b/graphics/MesaLib/patches/patch-src_util_strndup.c new file mode 100644 index 00000000000..3afd89bf1f6 --- /dev/null +++ b/graphics/MesaLib/patches/patch-src_util_strndup.c @@ -0,0 +1,30 @@ +$NetBSD: patch-src_util_strndup.c,v 1.1 2016/02/23 11:16:55 jperkin Exp $ + +Provide compat strndup for older Darwin. + +--- src/util/strndup.c.orig 2016-01-22 15:44:31.000000000 +0000 ++++ src/util/strndup.c +@@ -21,7 +21,7 @@ + * IN THE SOFTWARE. + */ + +-#if defined(_WIN32) ++#if defined(_WIN32) || (defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 < 1070) + #include <stdlib.h> + #include <string.h> + #include "strndup.h" +@@ -35,7 +35,14 @@ strndup(const char *str, size_t max) + if (!str) + return NULL; + ++#if defined(__APPLE__) ++ for (n = 0; n < max; n++, str++) { ++ if (!*str) ++ break; ++ } ++#else + n = strnlen(str, max); ++#endif + ptr = (char *) calloc(n + 1, sizeof(char)); + if (!ptr) + return NULL; diff --git a/graphics/MesaLib/patches/patch-src_util_strndup.h b/graphics/MesaLib/patches/patch-src_util_strndup.h new file mode 100644 index 00000000000..5de6a78338f --- /dev/null +++ b/graphics/MesaLib/patches/patch-src_util_strndup.h @@ -0,0 +1,15 @@ +$NetBSD: patch-src_util_strndup.h,v 1.1 2016/02/23 11:16:55 jperkin Exp $ + +Provide compat strndup for older Darwin. + +--- src/util/strndup.h.orig 2016-01-22 15:44:31.000000000 +0000 ++++ src/util/strndup.h +@@ -25,7 +25,7 @@ + + #include <stdlib.h> // size_t + +-#if defined(_WIN32) ++#if defined(_WIN32) || (defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 < 1070) + + #ifdef __cplusplus + extern "C" { |