diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3e3d469 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/v1.3.1.tar.gz diff --git a/.libepoxy.metadata b/.libepoxy.metadata new file mode 100644 index 0000000..2c01ee8 --- /dev/null +++ b/.libepoxy.metadata @@ -0,0 +1 @@ +94d98d83a50d2f607ee9986b622a48df00d5926c SOURCES/v1.3.1.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/0001-Fix-ppc64le-and-arm64.patch b/SOURCES/0001-Fix-ppc64le-and-arm64.patch new file mode 100644 index 0000000..e069baf --- /dev/null +++ b/SOURCES/0001-Fix-ppc64le-and-arm64.patch @@ -0,0 +1,24 @@ +From 50d865007906b79e4ba0e5dd717136f17de3713a Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Fri, 27 Jan 2017 13:38:37 -0500 +Subject: [PATCH] Fix ppc64le and arm64 + +--- + test/dlwrap.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/test/dlwrap.c b/test/dlwrap.c +index 9d1add5..5cda6b9 100644 +--- a/test/dlwrap.c ++++ b/test/dlwrap.c +@@ -232,6 +232,7 @@ dlwrap_real_dlsym(void *handle, const char *name) + * In the meantime, I'll just keep augmenting this + * hard-coded version list as people report bugs. */ + const char *version[] = { ++ "GLIBC_2.17", + "GLIBC_2.3", + "GLIBC_2.2.5", + "GLIBC_2.2", +-- +2.9.3 + diff --git a/SOURCES/0001-test-Fix-dlwrap-on-ppc64-and-s390x.patch b/SOURCES/0001-test-Fix-dlwrap-on-ppc64-and-s390x.patch new file mode 100644 index 0000000..dfd7c27 --- /dev/null +++ b/SOURCES/0001-test-Fix-dlwrap-on-ppc64-and-s390x.patch @@ -0,0 +1,29 @@ +From ce5afcca4648b34e2ce9f7804a5444f81d94e07d Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Thu, 5 Nov 2015 10:26:03 -0500 +Subject: [PATCH] test: Fix dlwrap on ppc64 and s390x + +These have dlsym versions of GLIBC_2.3 and GLIBC_2.2, respectively. + +Signed-off-by: Adam Jackson +--- + test/dlwrap.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/test/dlwrap.c b/test/dlwrap.c +index b104da4..9d1add5 100644 +--- a/test/dlwrap.c ++++ b/test/dlwrap.c +@@ -232,7 +232,9 @@ dlwrap_real_dlsym(void *handle, const char *name) + * In the meantime, I'll just keep augmenting this + * hard-coded version list as people report bugs. */ + const char *version[] = { ++ "GLIBC_2.3", + "GLIBC_2.2.5", ++ "GLIBC_2.2", + "GLIBC_2.0" + }; + int num_versions = sizeof(version) / sizeof(version[0]); +-- +2.9.3 + diff --git a/SOURCES/libepoxy-handle-lack-of-GLX.patch b/SOURCES/libepoxy-handle-lack-of-GLX.patch new file mode 100644 index 0000000..57d1c75 --- /dev/null +++ b/SOURCES/libepoxy-handle-lack-of-GLX.patch @@ -0,0 +1,106 @@ +From 31a1fd9d6dcf298b7ed61ac06d54e6f9cd2dee03 Mon Sep 17 00:00:00 2001 +From: Yaron Cohen-Tal +Date: Fri, 29 Jul 2016 17:55:49 +0300 +Subject: [PATCH 1/3] Check for NULL extensions string + +Some X server not supporting any OpenGL feature, glXQueryExtensionsString +will return NULL and causes the function to fail. + +Thanks to Emmanuel Stapf (manus@eiffel.com) for the original patch. + +This was verified running an application on macOS while the X server was +running on Windows Xming 7.5.0.10 + +Signed-off-by: Emmanuele Bassi +--- + src/dispatch_common.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/dispatch_common.c b/src/dispatch_common.c +index 013027f85bd5..ba6fca373d76 100644 +--- a/src/dispatch_common.c ++++ b/src/dispatch_common.c +@@ -347,6 +347,8 @@ epoxy_conservative_gl_version(void) + bool + epoxy_extension_in_string(const char *extension_list, const char *ext) + { ++ if (!extension_list) ++ return false; + const char *ptr = extension_list; + int len = strlen(ext); + +-- +2.14.3 + + +From 7a1a79ec3b68857f8a0b1d26811fec2d00ea4fb2 Mon Sep 17 00:00:00 2001 +From: Emmanuele Bassi +Date: Wed, 7 Dec 2016 15:12:15 +0000 +Subject: [PATCH 2/3] Avoid C99 declaration after statement + +The rest of the library is C89-only, so we should keep it that way. +--- + src/dispatch_common.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/dispatch_common.c b/src/dispatch_common.c +index ba6fca373d76..4f58be2caed2 100644 +--- a/src/dispatch_common.c ++++ b/src/dispatch_common.c +@@ -347,11 +347,12 @@ epoxy_conservative_gl_version(void) + bool + epoxy_extension_in_string(const char *extension_list, const char *ext) + { +- if (!extension_list) +- return false; + const char *ptr = extension_list; + int len = strlen(ext); + ++ if (extension_list == NULL || *extension_list == '\0') ++ return false; ++ + /* Make sure that don't just find an extension with our name as a prefix. */ + while (true) { + ptr = strstr(ptr, ext); +-- +2.14.3 + + +From 40d724e11ea37a4177bbb04fbe954c840c8e102d Mon Sep 17 00:00:00 2001 +From: Emmanuele Bassi +Date: Mon, 12 Dec 2016 14:18:15 +0000 +Subject: [PATCH 3/3] Ensure we don't assert if GLX is not available + +Certain X server do not have GLX enabled or supported, such as x2go. We +can handle this case gracefully inside libepoxy. + +Signed-off-by: Emmanuele Bassi +--- + src/dispatch_glx.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/dispatch_glx.c b/src/dispatch_glx.c +index 78e61c24a761..9e4cef62c86a 100644 +--- a/src/dispatch_glx.c ++++ b/src/dispatch_glx.c +@@ -57,11 +57,17 @@ epoxy_glx_version(Display *dpy, int screen) + int ret; + + version_string = glXQueryServerString(dpy, screen, GLX_VERSION); ++ if (!version_string) ++ return 0; ++ + ret = sscanf(version_string, "%d.%d", &server_major, &server_minor); + assert(ret == 2); + server = server_major * 10 + server_minor; + + version_string = glXGetClientString(dpy, GLX_VERSION); ++ if (!version_string) ++ return 0; ++ + ret = sscanf(version_string, "%d.%d", &client_major, &client_minor); + assert(ret == 2); + client = client_major * 10 + client_minor; +-- +2.14.3 + diff --git a/SPECS/libepoxy.spec b/SPECS/libepoxy.spec new file mode 100644 index 0000000..34c2c88 --- /dev/null +++ b/SPECS/libepoxy.spec @@ -0,0 +1,103 @@ +#global gitdate 20140411 + +#global commit 6eb075c70e2f91a9c45a90677bd46e8fb0432655 +#global shortcommit %(c=%{commit}; echo ${c:0:7}) + +Summary: epoxy runtime library +Name: libepoxy +Version: 1.3.1 +Release: 2%{?dist} +License: MIT +URL: http://github.com/anholt/libepoxy +# github url - generated archive +#ource0: https://github.com/anholt/libepoxy/archive/%{commit}/%{name}-%{commit}.tar.gz +Source0: https://github.com/anholt/libepoxy/archive/v%{version}/v%{version}.tar.gz + +Patch0: 0001-test-Fix-dlwrap-on-ppc64-and-s390x.patch +Patch1: 0001-Fix-ppc64le-and-arm64.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1566101 +Patch2: libepoxy-handle-lack-of-GLX.patch + +BuildRequires: automake autoconf libtool +BuildRequires: mesa-libGL-devel +BuildRequires: mesa-libEGL-devel +BuildRequires: mesa-libGLES-devel +BuildRequires: xorg-x11-util-macros +BuildRequires: python + +%description +A library for handling OpenGL function pointer management. + +%package devel +Summary: Development files for libepoxy +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +This package contains libraries and header files for +developing applications that use %{name}. + +%prep +%setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 + +%build +autoreconf -vif || exit 1 +%configure --disable-silent-rules +make %{?_smp_mflags} + +%install +make install DESTDIR=$RPM_BUILD_ROOT + +# NOTE: We intentionally don't ship *.la files +find $RPM_BUILD_ROOT -type f -name '*.la' -delete -print + +%check +# In theory this is fixed in 1.2 but we still see errors on most platforms +# https://github.com/anholt/libepoxy/issues/24 +make check # || ( cat test/test-suite.log ; objdump -T %{_libdir}/libdl.so.? ) + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%files +%doc README.md +%{_libdir}/libepoxy.so.0 +%{_libdir}/libepoxy.so.0.0.0 + +%files devel +%dir %{_includedir}/epoxy/ +%{_includedir}/epoxy/* +%{_libdir}/libepoxy.so +%{_libdir}/pkgconfig/epoxy.pc + +%changelog +* Wed Apr 11 2018 Debarshi Ray - 1.3.1-2 +- Prevent crash in epoxy_glx_version if GLX is not available +Resolves: #1566101 + +* Fri Jan 27 2017 Adam Jackson - 1.3.1-1 +- libepoxy 1.3.1 + +* Wed Mar 25 2015 Adam Jackson 1.2-2 +- Fix description to not talk about DRM +- Sync some small bugfixes from git + +* Mon Oct 13 2014 Peter Robinson 1.2.0-1 +- Update to 1.2 GA +- Don't fail build on make check failure for some architectures + +* Sun Aug 17 2014 Fedora Release Engineering - 1.2-0.4.20140411git6eb075c +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 1.2-0.3.20140411git6eb075c +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Fri Apr 11 2014 Dave Airlie 1.2-0.2.20140411git6eb075c +- update to latest git snapshot + +* Thu Mar 27 2014 Dave Airlie 1.2-0.1.20140307gitd4ad80f +- initial git snapshot +