[144798] trunk/dports/graphics/libepoxy
jeremyhu at macports.org
jeremyhu at macports.org
Mon Jan 18 10:24:23 PST 2016
Revision: 144798
https://trac.macports.org/changeset/144798
Author: jeremyhu at macports.org
Date: 2016-01-18 10:24:23 -0800 (Mon, 18 Jan 2016)
Log Message:
-----------
libepoxy: Cleanup symbol lookups and dependencies
Modified Paths:
--------------
trunk/dports/graphics/libepoxy/Portfile
Added Paths:
-----------
trunk/dports/graphics/libepoxy/files/0001-select-platforms-based-on-configuration-results.patch
trunk/dports/graphics/libepoxy/files/0002-add-an-option-to-disable-glx-support.patch
trunk/dports/graphics/libepoxy/files/0003-Make-enable-glx-actually-work-on-OSX-and-Windows.patch
trunk/dports/graphics/libepoxy/files/0004-darwin-Use-GLX-instead-of-OpenGL.framework-if-it-is-.patch
trunk/dports/graphics/libepoxy/files/prefix.patch
Removed Paths:
-------------
trunk/dports/graphics/libepoxy/files/patch-configure.ac.diff
trunk/dports/graphics/libepoxy/files/patch-glx.diff
Modified: trunk/dports/graphics/libepoxy/Portfile
===================================================================
--- trunk/dports/graphics/libepoxy/Portfile 2016-01-18 17:40:28 UTC (rev 144797)
+++ trunk/dports/graphics/libepoxy/Portfile 2016-01-18 18:24:23 UTC (rev 144798)
@@ -5,6 +5,7 @@
PortGroup github 1.0
github.setup anholt libepoxy 1.3.1 v
+revision 1
license MIT permissive
categories graphics
maintainers devans openmaintainer
@@ -18,29 +19,38 @@
checksums rmd160 fc67ebfc18fe1209d23d8ef315cc9ab387731563 \
sha256 2c8155016e6bcf2ad604094ba84f0404edda3278dea851d6ce44830291eb885b
+# Yes, mesa and xorg-libX11 are *build* dependencies. The library will function correctly
+# if they are not present because it loads mesa dynamically only when GLX is used. When
+# OpenGL.framework is used, there is no need to have mesa at runtime.
+#
+# Clients of this library must link mesa directly and have it listed as their dependency
+# in order to use mesa with libepoxy.
+
depends_build port:pkgconfig \
port:autoconf \
port:automake \
port:libtool \
- port:xorg-util-macros
-
-depends_lib port:mesa \
+ port:xorg-util-macros \
+ port:mesa \
port:xorg-libX11
-patchfiles patch-configure.ac.diff
+patch.pre_args -p1
+patchfiles \
+ prefix.patch \
+ 0001-select-platforms-based-on-configuration-results.patch \
+ 0002-add-an-option-to-disable-glx-support.patch \
+ 0003-Make-enable-glx-actually-work-on-OSX-and-Windows.patch \
+ 0004-darwin-Use-GLX-instead-of-OpenGL.framework-if-it-is-.patch
-# turn on support for glx that was disabled in v1.3
-# see https://github.com/anholt/libepoxy/commit/e3051481cc9f5b7b36b317aff1454ee16ea9cdb9
-# see https://github.com/anholt/libepoxy/releases/tag/v1.3
-patchfiles-append patch-glx.diff
-
post-patch {
reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/src/dispatch_common.c
}
configure.cmd ./autogen.sh
-configure.args --disable-silent-rules
+configure.args \
+ --disable-silent-rules \
+ --enable-glx
variant python27 conflicts python34 python35 description {build with python 2.7} {
depends_lib-append port:python27
@@ -58,5 +68,5 @@
}
if {![variant_isset python27] && ![variant_isset python34] && ![variant_isset python35]} {
- default_variants +python34
+ default_variants-append +python34
}
Added: trunk/dports/graphics/libepoxy/files/0001-select-platforms-based-on-configuration-results.patch
===================================================================
--- trunk/dports/graphics/libepoxy/files/0001-select-platforms-based-on-configuration-results.patch (rev 0)
+++ trunk/dports/graphics/libepoxy/files/0001-select-platforms-based-on-configuration-results.patch 2016-01-18 18:24:23 UTC (rev 144798)
@@ -0,0 +1,124 @@
+From 7eff2bf8e27599c1c94217b2bb1b73d4b7d18e59 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony at googlemail.com>
+Date: Wed, 6 May 2015 10:45:22 +0200
+Subject: [PATCH 1/4] select platforms based on configuration results
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Andreas Müller <schnitzeltony at googlemail.com>
+---
+ configure.ac | 13 +++++--------
+ src/dispatch_common.c | 9 ++++++---
+ src/dispatch_common.h | 9 +++++----
+ 3 files changed, 16 insertions(+), 15 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 2d67726..225ab73 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -58,6 +58,10 @@ AC_CHECK_HEADER([KHR/khrplatform.h],
+ # uintptr_t to a void *") by default. Kill that.
+ XORG_TESTSET_CFLAG(CWARNFLAGS, [-Wno-int-conversion])
+
++PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no])
++
++AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)
++
+ has_znow=yes
+
+ case $host_os in
+@@ -86,7 +90,7 @@ case $host_os in
+ ;;
+ *)
+ build_egl=yes
+- build_glx=yes
++ build_glx=$x11
+ build_wgl=no
+ # On platforms with dlopen, we load everything dynamically and
+ # don't link against a specific window system or GL implementation.
+@@ -144,13 +148,6 @@ esac
+
+ AC_SUBST([VISIBILITY_CFLAGS])
+
+-PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no])
+-if test x$x11 = xno -a x$build_glx = xyes; then
+- AC_MSG_ERROR([libX11 headers (libx11-dev) required to build with GLX support])
+-fi
+-
+-AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)
+-
+ PKG_CHECK_MODULES(GL, [gl], [gl=yes], [gl=no])
+
+ AC_CONFIG_FILES([
+diff --git a/src/dispatch_common.c b/src/dispatch_common.c
+index 013027f..163d348 100644
+--- a/src/dispatch_common.c
++++ b/src/dispatch_common.c
+@@ -656,10 +656,13 @@ epoxy_get_proc_address(const char *name)
+ #elif defined(__APPLE__)
+ return epoxy_gl_dlsym(name);
+ #else
++#if PLATFORM_HAS_GLX
+ if (epoxy_current_context_is_glx()) {
+ return glXGetProcAddressARB((const GLubyte *)name);
+- } else {
++ } else
++#endif /* PLATFORM_HAS_GLX */
+ #if PLATFORM_HAS_EGL
++ {
+ GLenum egl_api = epoxy_egl_get_current_gl_context_api();
+
+ switch (egl_api) {
+@@ -669,10 +672,10 @@ epoxy_get_proc_address(const char *name)
+ case EGL_NONE:
+ break;
+ }
+-#endif
+ }
++#endif /* PLATFORM_HAS_EGL */
+ errx(1, "Couldn't find current GLX or EGL context.\n");
+-#endif
++#endif /* _WIN32 | __APPLE__*/
+ }
+
+ WRAPPER_VISIBILITY (void)
+diff --git a/src/dispatch_common.h b/src/dispatch_common.h
+index 676a4d5..2728b45 100644
+--- a/src/dispatch_common.h
++++ b/src/dispatch_common.h
+@@ -21,12 +21,13 @@
+ * IN THE SOFTWARE.
+ */
+
++#include <config.h>
+ #include <stdbool.h>
+
+ #ifdef _WIN32
+ #define PLATFORM_HAS_EGL 0
+ #define PLATFORM_HAS_GLX 0
+-#define PLATFORM_HAS_WGL 1
++#define PLATFORM_HAS_WGL BUILD_WGL
+ #define EPOXY_IMPORTEXPORT __declspec(dllexport)
+ #elif defined(__APPLE__)
+ #define PLATFORM_HAS_EGL 0
+@@ -34,13 +35,13 @@
+ #define PLATFORM_HAS_WGL 0
+ #define EPOXY_IMPORTEXPORT
+ #elif defined(ANDROID)
+-#define PLATFORM_HAS_EGL 1
++#define PLATFORM_HAS_EGL BUILD_EGL
+ #define PLATFORM_HAS_GLX 0
+ #define PLATFORM_HAS_WGL 0
+ #define EPOXY_IMPORTEXPORT
+ #else
+-#define PLATFORM_HAS_EGL 1
+-#define PLATFORM_HAS_GLX 1
++#define PLATFORM_HAS_EGL BUILD_EGL
++#define PLATFORM_HAS_GLX BUILD_GLX
+ #define PLATFORM_HAS_WGL 0
+ #define EPOXY_IMPORTEXPORT
+ #endif
+--
+2.7.0
+
Added: trunk/dports/graphics/libepoxy/files/0002-add-an-option-to-disable-glx-support.patch
===================================================================
--- trunk/dports/graphics/libepoxy/files/0002-add-an-option-to-disable-glx-support.patch (rev 0)
+++ trunk/dports/graphics/libepoxy/files/0002-add-an-option-to-disable-glx-support.patch 2016-01-18 18:24:23 UTC (rev 144798)
@@ -0,0 +1,38 @@
+From a9efde0fb2678cd26bdf26d256732d97ded0c595 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony at googlemail.com>
+Date: Wed, 6 May 2015 11:05:48 +0200
+Subject: [PATCH 2/4] add an option to disable glx support
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+this option would help us in yocto to get deterministic build results
+
+Signed-off-by: Andreas Müller <schnitzeltony at googlemail.com>
+---
+ configure.ac | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 225ab73..d3d947c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -58,7 +58,14 @@ AC_CHECK_HEADER([KHR/khrplatform.h],
+ # uintptr_t to a void *") by default. Kill that.
+ XORG_TESTSET_CFLAG(CWARNFLAGS, [-Wno-int-conversion])
+
+-PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no])
++AC_ARG_ENABLE([glx],
++ [AS_HELP_STRING([--disable-glx],
++ [disable if you don't want x11/glx support])],
++ [],
++ [enable_glx=yes]
++ )
++
++PKG_CHECK_MODULES(X11, [x11], [x11=$enable_glx], [x11=no])
+
+ AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)
+
+--
+2.7.0
+
Added: trunk/dports/graphics/libepoxy/files/0003-Make-enable-glx-actually-work-on-OSX-and-Windows.patch
===================================================================
--- trunk/dports/graphics/libepoxy/files/0003-Make-enable-glx-actually-work-on-OSX-and-Windows.patch (rev 0)
+++ trunk/dports/graphics/libepoxy/files/0003-Make-enable-glx-actually-work-on-OSX-and-Windows.patch 2016-01-18 18:24:23 UTC (rev 144798)
@@ -0,0 +1,66 @@
+From 902ea1eb073187603ec2eda4d2a146bef96592d4 Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
+Date: Mon, 18 Jan 2016 10:08:44 -0800
+Subject: [PATCH 3/4] Make --enable-glx actually work on OSX and Windows
+
+Followup for anholt/libepoxy#52
+
+Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
+---
+ configure.ac | 6 +++---
+ src/dispatch_common.h | 4 ++--
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index d3d947c..b4c7ede 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -61,7 +61,7 @@ XORG_TESTSET_CFLAG(CWARNFLAGS, [-Wno-int-conversion])
+ AC_ARG_ENABLE([glx],
+ [AS_HELP_STRING([--disable-glx],
+ [disable if you don't want x11/glx support])],
+- [],
++ [enable_glx=$enableval],
+ [enable_glx=yes]
+ )
+
+@@ -74,7 +74,7 @@ has_znow=yes
+ case $host_os in
+ mingw*)
+ build_egl=no
+- build_glx=no
++ build_glx=$x11
+ build_wgl=yes
+ # On windows, the DLL has to have all of its functions
+ # resolved at link time, so we have to link directly aginst
+@@ -89,7 +89,7 @@ case $host_os in
+ ;;
+ darwin*)
+ build_egl=no
+- build_glx=no
++ build_glx=$x11
+ build_wgl=no
+ build_apple=yes
+ has_znow=no
+diff --git a/src/dispatch_common.h b/src/dispatch_common.h
+index 2728b45..c30ce44 100644
+--- a/src/dispatch_common.h
++++ b/src/dispatch_common.h
+@@ -26,12 +26,12 @@
+
+ #ifdef _WIN32
+ #define PLATFORM_HAS_EGL 0
+-#define PLATFORM_HAS_GLX 0
++#define PLATFORM_HAS_GLX BUILD_GLX
+ #define PLATFORM_HAS_WGL BUILD_WGL
+ #define EPOXY_IMPORTEXPORT __declspec(dllexport)
+ #elif defined(__APPLE__)
+ #define PLATFORM_HAS_EGL 0
+-#define PLATFORM_HAS_GLX 0
++#define PLATFORM_HAS_GLX BUILD_GLX
+ #define PLATFORM_HAS_WGL 0
+ #define EPOXY_IMPORTEXPORT
+ #elif defined(ANDROID)
+--
+2.7.0
+
Added: trunk/dports/graphics/libepoxy/files/0004-darwin-Use-GLX-instead-of-OpenGL.framework-if-it-is-.patch
===================================================================
--- trunk/dports/graphics/libepoxy/files/0004-darwin-Use-GLX-instead-of-OpenGL.framework-if-it-is-.patch (rev 0)
+++ trunk/dports/graphics/libepoxy/files/0004-darwin-Use-GLX-instead-of-OpenGL.framework-if-it-is-.patch 2016-01-18 18:24:23 UTC (rev 144798)
@@ -0,0 +1,95 @@
+From d010922282580a32dfebcda12ee1c307b3ef6005 Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
+Date: Mon, 18 Jan 2016 09:49:55 -0800
+Subject: [PATCH 4/4] darwin: Use GLX instead of OpenGL.framework if it is the
+ current context
+
+Also makes a stab at similar support for Win32
+
+anholt/libepoxy#63
+
+Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
+---
+ src/dispatch_common.c | 29 ++++++++++++++++-------------
+ 1 file changed, 16 insertions(+), 13 deletions(-)
+
+diff --git a/src/dispatch_common.c b/src/dispatch_common.c
+index 163d348..cb9f76a 100644
+--- a/src/dispatch_common.c
++++ b/src/dispatch_common.c
+@@ -482,16 +482,20 @@ epoxy_glx_dlsym(const char *name)
+ void *
+ epoxy_gl_dlsym(const char *name)
+ {
+-#ifdef _WIN32
++#if defined(_WIN32) || defined(__APPLE__)
++if (!epoxy_current_context_is_glx()) {
++# if defined(_WIN32)
+ return do_dlsym(&api.gl_handle, "OPENGL32", name, true);
+-#elif defined(__APPLE__)
++# elif defined(__APPLE__)
+ return do_dlsym(&api.gl_handle,
+ "/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL",
+ name, true);
+-#else
++# endif
++}
++#endif
++
+ /* There's no library for desktop GL support independent of GLX. */
+ return epoxy_glx_dlsym(name);
+-#endif
+ }
+
+ void *
+@@ -615,7 +619,7 @@ epoxy_get_bootstrap_proc_address(const char *name)
+ */
+ #if PLATFORM_HAS_GLX
+ if (api.glx_handle && glXGetCurrentContext())
+- return epoxy_gl_dlsym(name);
++ return epoxy_glx_dlsym(name);
+ #endif
+
+ /* If epoxy hasn't loaded any API-specific library yet, try to
+@@ -644,22 +648,17 @@ epoxy_get_bootstrap_proc_address(const char *name)
+ }
+ #endif /* PLATFORM_HAS_EGL */
+
+- /* Fall back to GLX */
++ /* Fall back to the platform default */
+ return epoxy_gl_dlsym(name);
+ }
+
+ void *
+ epoxy_get_proc_address(const char *name)
+ {
+-#ifdef _WIN32
+- return wglGetProcAddress(name);
+-#elif defined(__APPLE__)
+- return epoxy_gl_dlsym(name);
+-#else
+ #if PLATFORM_HAS_GLX
+ if (epoxy_current_context_is_glx()) {
+ return glXGetProcAddressARB((const GLubyte *)name);
+- } else
++ }
+ #endif /* PLATFORM_HAS_GLX */
+ #if PLATFORM_HAS_EGL
+ {
+@@ -674,8 +673,12 @@ epoxy_get_proc_address(const char *name)
+ }
+ }
+ #endif /* PLATFORM_HAS_EGL */
++#if defined(_WIN32)
++ return wglGetProcAddress(name);
++#elif defined(__APPLE__)
++ return epoxy_gl_dlsym(name);
++#endif
+ errx(1, "Couldn't find current GLX or EGL context.\n");
+-#endif /* _WIN32 | __APPLE__*/
+ }
+
+ WRAPPER_VISIBILITY (void)
+--
+2.7.0
+
Deleted: trunk/dports/graphics/libepoxy/files/patch-configure.ac.diff
===================================================================
--- trunk/dports/graphics/libepoxy/files/patch-configure.ac.diff 2016-01-18 17:40:28 UTC (rev 144797)
+++ trunk/dports/graphics/libepoxy/files/patch-configure.ac.diff 2016-01-18 18:24:23 UTC (rev 144798)
@@ -1,11 +0,0 @@
---- configure.ac.orig 2014-11-07 04:56:03.000000000 -0800
-+++ configure.ac 2014-11-07 04:56:27.000000000 -0800
-@@ -40,7 +40,7 @@
- XORG_MACROS_VERSION(1.8)
- XORG_DEFAULT_OPTIONS
-
--AC_CHECK_PROGS([PYTHON], [python3 python2 python])
-+AC_CHECK_PROGS([PYTHON], [$(PYTHON) python3 python2 python])
-
- # Initialize libtool
- AC_DISABLE_STATIC
Deleted: trunk/dports/graphics/libepoxy/files/patch-glx.diff
===================================================================
--- trunk/dports/graphics/libepoxy/files/patch-glx.diff 2016-01-18 17:40:28 UTC (rev 144797)
+++ trunk/dports/graphics/libepoxy/files/patch-glx.diff 2016-01-18 18:24:23 UTC (rev 144798)
@@ -1,33 +0,0 @@
---- configure.ac.orig 2015-07-15 16:46:36.000000000 -0700
-+++ configure.ac 2015-10-18 10:52:14.000000000 -0700
-@@ -78,7 +78,7 @@
- ;;
- darwin*)
- build_egl=no
-- build_glx=no
-+ build_glx=yes
- build_wgl=no
- build_apple=yes
- has_znow=no
---- src/dispatch_common.h.orig 2015-07-15 16:46:36.000000000 -0700
-+++ src/dispatch_common.h 2015-10-18 10:53:18.000000000 -0700
-@@ -30,7 +30,7 @@
- #define EPOXY_IMPORTEXPORT __declspec(dllexport)
- #elif defined(__APPLE__)
- #define PLATFORM_HAS_EGL 0
--#define PLATFORM_HAS_GLX 0
-+#define PLATFORM_HAS_GLX 1
- #define PLATFORM_HAS_WGL 0
- #define EPOXY_IMPORTEXPORT
- #elif defined(ANDROID)
---- src/dispatch_common.c.orig 2015-07-15 16:46:36.000000000 -0700
-+++ src/dispatch_common.c 2015-12-05 09:38:47.000000000 -0800
-@@ -103,7 +103,7 @@
- #include "dispatch_common.h"
-
- #ifdef __APPLE__
--#define GLX_LIB "/opt/X11/lib/libGL.1.dylib"
-+#define GLX_LIB "@PREFIX@/lib/libGL.1.dylib"
- #elif defined(ANDROID)
- #define GLX_LIB "libGLESv2.so"
- #else
Added: trunk/dports/graphics/libepoxy/files/prefix.patch
===================================================================
--- trunk/dports/graphics/libepoxy/files/prefix.patch (rev 0)
+++ trunk/dports/graphics/libepoxy/files/prefix.patch 2016-01-18 18:24:23 UTC (rev 144798)
@@ -0,0 +1,11 @@
+--- a/src/dispatch_common.c 2015-07-15 16:46:36.000000000 -0700
++++ b/src/dispatch_common.c 2015-12-05 09:38:47.000000000 -0800
+@@ -103,7 +103,7 @@
+ #include "dispatch_common.h"
+
+ #ifdef __APPLE__
+-#define GLX_LIB "/opt/X11/lib/libGL.1.dylib"
++#define GLX_LIB "@PREFIX@/lib/libGL.1.dylib"
+ #elif defined(ANDROID)
+ #define GLX_LIB "libGLESv2.so"
+ #else
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160118/7876f187/attachment-0001.html>
More information about the macports-changes
mailing list