Switch to meson; Add license file
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
This commit is contained in:
parent
2c119cb2e7
commit
727af8dbef
89
0001-Add-C-guards-around-generated-headers.patch
Normal file
89
0001-Add-C-guards-around-generated-headers.patch
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
From 3fb4fea6743c660401b78f1f08afda731d32192e Mon Sep 17 00:00:00 2001
|
||||||
|
From: Emmanuele Bassi <ebassi@gnome.org>
|
||||||
|
Date: Fri, 3 Mar 2017 14:41:15 +0000
|
||||||
|
Subject: [PATCH 1/6] Add C++ guards around generated headers
|
||||||
|
|
||||||
|
Commit 0625a74d69f762df8d411bc0451927424aee1f2c moved the C++ guards
|
||||||
|
after the inclusion of the generated headers, which was an unintended
|
||||||
|
behavioural change and now requires header guards around the inclusion
|
||||||
|
of Epoxy headers.
|
||||||
|
|
||||||
|
Fixes: #106
|
||||||
|
---
|
||||||
|
include/epoxy/egl.h | 4 ++--
|
||||||
|
include/epoxy/gl.h | 4 ++--
|
||||||
|
include/epoxy/glx.h | 4 ++--
|
||||||
|
include/epoxy/wgl.h | 4 ++--
|
||||||
|
4 files changed, 8 insertions(+), 8 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/include/epoxy/egl.h b/include/epoxy/egl.h
|
||||||
|
index d5083da..b5f8ee0 100644
|
||||||
|
--- a/include/epoxy/egl.h
|
||||||
|
+++ b/include/epoxy/egl.h
|
||||||
|
@@ -41,10 +41,10 @@
|
||||||
|
#define __eglext_h_
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-#include "epoxy/egl_generated.h"
|
||||||
|
-
|
||||||
|
EPOXY_BEGIN_DECLS
|
||||||
|
|
||||||
|
+#include "epoxy/egl_generated.h"
|
||||||
|
+
|
||||||
|
EPOXY_PUBLIC bool epoxy_has_egl_extension(EGLDisplay dpy, const char *extension);
|
||||||
|
EPOXY_PUBLIC int epoxy_egl_version(EGLDisplay dpy);
|
||||||
|
EPOXY_PUBLIC bool epoxy_has_egl(void);
|
||||||
|
diff --git a/include/epoxy/gl.h b/include/epoxy/gl.h
|
||||||
|
index 078ecee..88b9a15 100644
|
||||||
|
--- a/include/epoxy/gl.h
|
||||||
|
+++ b/include/epoxy/gl.h
|
||||||
|
@@ -84,10 +84,10 @@
|
||||||
|
#define GLAPIENTRYP GLAPIENTRY *
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-#include "epoxy/gl_generated.h"
|
||||||
|
-
|
||||||
|
EPOXY_BEGIN_DECLS
|
||||||
|
|
||||||
|
+#include "epoxy/gl_generated.h"
|
||||||
|
+
|
||||||
|
EPOXY_PUBLIC bool epoxy_has_gl_extension(const char *extension);
|
||||||
|
EPOXY_PUBLIC bool epoxy_is_desktop_gl(void);
|
||||||
|
EPOXY_PUBLIC int epoxy_gl_version(void);
|
||||||
|
diff --git a/include/epoxy/glx.h b/include/epoxy/glx.h
|
||||||
|
index a06b13d..8517063 100644
|
||||||
|
--- a/include/epoxy/glx.h
|
||||||
|
+++ b/include/epoxy/glx.h
|
||||||
|
@@ -44,10 +44,10 @@
|
||||||
|
#define __glxext_h_
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-#include "epoxy/glx_generated.h"
|
||||||
|
-
|
||||||
|
EPOXY_BEGIN_DECLS
|
||||||
|
|
||||||
|
+#include "epoxy/glx_generated.h"
|
||||||
|
+
|
||||||
|
EPOXY_PUBLIC bool epoxy_has_glx_extension(Display *dpy, int screen, const char *extension);
|
||||||
|
EPOXY_PUBLIC int epoxy_glx_version(Display *dpy, int screen);
|
||||||
|
EPOXY_PUBLIC bool epoxy_has_glx(Display *dpy);
|
||||||
|
diff --git a/include/epoxy/wgl.h b/include/epoxy/wgl.h
|
||||||
|
index 503f899..7c85dec 100644
|
||||||
|
--- a/include/epoxy/wgl.h
|
||||||
|
+++ b/include/epoxy/wgl.h
|
||||||
|
@@ -49,10 +49,10 @@
|
||||||
|
#define wglUseFontBitmaps wglUseFontBitmapsA
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-#include "epoxy/wgl_generated.h"
|
||||||
|
-
|
||||||
|
EPOXY_BEGIN_DECLS
|
||||||
|
|
||||||
|
+#include "epoxy/wgl_generated.h"
|
||||||
|
+
|
||||||
|
EPOXY_PUBLIC bool epoxy_has_wgl_extension(HDC hdc, const char *extension);
|
||||||
|
EPOXY_PUBLIC void epoxy_handle_external_wglMakeCurrent(void);
|
||||||
|
|
||||||
|
--
|
||||||
|
2.12.0
|
||||||
|
|
35
0002-Add-z-relro-and-z-now-to-the-GCC-linker-flags.patch
Normal file
35
0002-Add-z-relro-and-z-now-to-the-GCC-linker-flags.patch
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
From f19f943a6699d771ef85402998a56743d6dfa3d9 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Emmanuele Bassi <ebassi@gnome.org>
|
||||||
|
Date: Fri, 3 Mar 2017 16:58:46 +0000
|
||||||
|
Subject: [PATCH 2/6] Add z,relro and z,now to the GCC linker flags
|
||||||
|
|
||||||
|
These flags are mitigations against memory corruption bugs, and are
|
||||||
|
typically enabled by Linux distributions hardening rules.
|
||||||
|
|
||||||
|
We only use these flags with GCC, similarly to `-Bsymbolic`.
|
||||||
|
|
||||||
|
More information on relro is available here:
|
||||||
|
|
||||||
|
- http://tk-blog.blogspot.co.uk/2009/02/relro-not-so-well-known-memory.html
|
||||||
|
- http://mudongliang.github.io/2016/07/11/relro-a-not-so-well-known-memory-corruption-mitigation-technique.html
|
||||||
|
- https://wiki.debian.org/Hardening#DEB_BUILD_HARDENING_RELRO_.28ld_-z_relro.29
|
||||||
|
---
|
||||||
|
src/meson.build | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/meson.build b/src/meson.build
|
||||||
|
index 3610af3..ecd032a 100644
|
||||||
|
--- a/src/meson.build
|
||||||
|
+++ b/src/meson.build
|
||||||
|
@@ -52,7 +52,7 @@ foreach h: headers
|
||||||
|
endforeach
|
||||||
|
|
||||||
|
if cc.get_id() == 'gcc'
|
||||||
|
- common_ldflags = [ '-Wl,-Bsymbolic', ]
|
||||||
|
+ common_ldflags = [ '-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now', ]
|
||||||
|
else
|
||||||
|
common_ldflags = []
|
||||||
|
endif
|
||||||
|
--
|
||||||
|
2.12.0
|
||||||
|
|
38
0003-Add-explicit-version-flags-for-macOS-builds.patch
Normal file
38
0003-Add-explicit-version-flags-for-macOS-builds.patch
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
From d0a1a4e6767da8a2455b8822446978b35813161d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Emmanuele Bassi <ebassi@gnome.org>
|
||||||
|
Date: Tue, 7 Mar 2017 11:52:26 +0000
|
||||||
|
Subject: [PATCH 3/6] Add explicit version flags for macOS builds
|
||||||
|
|
||||||
|
Autotools automatically adds version related linker flags on macOS that
|
||||||
|
are not related to the version information. Since we want to maintain
|
||||||
|
binary compatibility, we should do the same when building on macOS.
|
||||||
|
|
||||||
|
Fixes: #108
|
||||||
|
---
|
||||||
|
src/meson.build | 8 ++++++--
|
||||||
|
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/meson.build b/src/meson.build
|
||||||
|
index ecd032a..4dbb3eb 100644
|
||||||
|
--- a/src/meson.build
|
||||||
|
+++ b/src/meson.build
|
||||||
|
@@ -51,10 +51,14 @@ foreach h: headers
|
||||||
|
epoxy_headers += join_paths(meson.source_root(), 'include/epoxy/@0@'.format(h))
|
||||||
|
endforeach
|
||||||
|
|
||||||
|
+common_ldflags = []
|
||||||
|
if cc.get_id() == 'gcc'
|
||||||
|
common_ldflags = [ '-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now', ]
|
||||||
|
-else
|
||||||
|
- common_ldflags = []
|
||||||
|
+endif
|
||||||
|
+
|
||||||
|
+# Maintain compatibility with autotools; see: https://github.com/anholt/libepoxy/issues/108
|
||||||
|
+if host_system == 'darwin'
|
||||||
|
+ common_ldflags += [ '-compatibility_version=1', '-current_version=1.0', ]
|
||||||
|
endif
|
||||||
|
|
||||||
|
epoxy_deps = [ dl_dep, ]
|
||||||
|
--
|
||||||
|
2.12.0
|
||||||
|
|
29
0004-Use-some-linker-flags-only-on-Linux.patch
Normal file
29
0004-Use-some-linker-flags-only-on-Linux.patch
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
From bfd99a94218275361fc3b207e397e93042a0b1b1 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Emmanuele Bassi <ebassi@gnome.org>
|
||||||
|
Date: Tue, 7 Mar 2017 15:32:43 +0000
|
||||||
|
Subject: [PATCH 4/6] Use some linker flags only on Linux
|
||||||
|
|
||||||
|
Using GCC is not a guarantee of also having access to the Linux linker;
|
||||||
|
just like we use specific linker flags on macOS, the symbolic and relro
|
||||||
|
linker flags are pretty much Linux specific.
|
||||||
|
---
|
||||||
|
src/meson.build | 3 ++-
|
||||||
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/meson.build b/src/meson.build
|
||||||
|
index 4dbb3eb..a3d76db 100644
|
||||||
|
--- a/src/meson.build
|
||||||
|
+++ b/src/meson.build
|
||||||
|
@@ -52,7 +52,8 @@ foreach h: headers
|
||||||
|
endforeach
|
||||||
|
|
||||||
|
common_ldflags = []
|
||||||
|
-if cc.get_id() == 'gcc'
|
||||||
|
+
|
||||||
|
+if host_system == 'linux'
|
||||||
|
common_ldflags = [ '-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now', ]
|
||||||
|
endif
|
||||||
|
|
||||||
|
--
|
||||||
|
2.12.0
|
||||||
|
|
68
0005-Add-missing-visibility-compiler-flags.patch
Normal file
68
0005-Add-missing-visibility-compiler-flags.patch
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
From 4719e586c0f92fa7546fa954115b92d2ae9aee9f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Emmanuele Bassi <ebassi@gnome.org>
|
||||||
|
Date: Thu, 9 Mar 2017 21:21:09 +0000
|
||||||
|
Subject: [PATCH 5/6] Add missing visibility compiler flags
|
||||||
|
|
||||||
|
We have been building the shared library for Epoxy without the symbol
|
||||||
|
visibility flags for the compiler, which means we've been leaking
|
||||||
|
internal symbols all over the floor.
|
||||||
|
|
||||||
|
Fixes: #111
|
||||||
|
---
|
||||||
|
meson.build | 10 ++++++----
|
||||||
|
src/meson.build | 4 +---
|
||||||
|
2 files changed, 7 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/meson.build b/meson.build
|
||||||
|
index 95aac5c..afe576b 100644
|
||||||
|
--- a/meson.build
|
||||||
|
+++ b/meson.build
|
||||||
|
@@ -140,9 +140,11 @@ foreach cflag: test_cflags
|
||||||
|
endif
|
||||||
|
endforeach
|
||||||
|
|
||||||
|
-# Visibility compiler flags
|
||||||
|
-visibility_cflags = []
|
||||||
|
-if get_option('default_library') != 'static'
|
||||||
|
+libtype = get_option('default_library')
|
||||||
|
+
|
||||||
|
+# Visibility compiler flags; we only use this for shared libraries
|
||||||
|
+if libtype == 'shared'
|
||||||
|
+ visibility_cflags = []
|
||||||
|
if host_system == 'windows'
|
||||||
|
conf.set('DLL_EXPORT', true)
|
||||||
|
if cc.get_id() == 'msvc'
|
||||||
|
@@ -152,7 +154,7 @@ if get_option('default_library') != 'static'
|
||||||
|
visibility_cflags += [ '-fvisibility=hidden' ]
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
- conf.set('EPOXY_PUBLIC', '__attribute__((visibility("default")))')
|
||||||
|
+ conf.set('EPOXY_PUBLIC', '__attribute__((visibility("default"))) extern')
|
||||||
|
visibility_cflags += [ '-fvisibility=hidden' ]
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
diff --git a/src/meson.build b/src/meson.build
|
||||||
|
index a3d76db..ce6fe45 100644
|
||||||
|
--- a/src/meson.build
|
||||||
|
+++ b/src/meson.build
|
||||||
|
@@ -68,8 +68,6 @@ if host_system == 'windows'
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Allow building a static version of epoxy
|
||||||
|
-libtype = get_option('default_library')
|
||||||
|
-
|
||||||
|
if libtype != 'shared'
|
||||||
|
libepoxy_static = static_library('epoxy',
|
||||||
|
sources: epoxy_sources + epoxy_headers,
|
||||||
|
@@ -88,7 +86,7 @@ if libtype != 'static'
|
||||||
|
install: true,
|
||||||
|
dependencies: epoxy_deps,
|
||||||
|
include_directories: libepoxy_inc,
|
||||||
|
- c_args: common_cflags,
|
||||||
|
+ c_args: common_cflags + visibility_cflags,
|
||||||
|
link_args: common_ldflags)
|
||||||
|
libepoxy = libepoxy_shared
|
||||||
|
endif
|
||||||
|
--
|
||||||
|
2.12.0
|
||||||
|
|
42
0006-Prefer-using-pkg-config-files-to-find-GLES.patch
Normal file
42
0006-Prefer-using-pkg-config-files-to-find-GLES.patch
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
From f7d3671a0fcad0f5371ce60916394e0269c5cee3 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Emmanuele Bassi <ebassi@gnome.org>
|
||||||
|
Date: Thu, 9 Mar 2017 21:28:52 +0000
|
||||||
|
Subject: [PATCH 6/6] Prefer using pkg-config files to find GLES
|
||||||
|
|
||||||
|
Just like we do for GL and EGL, we can use pkg-config to find the GLES
|
||||||
|
v2 and v1 dependencies.
|
||||||
|
|
||||||
|
Fixes: #110
|
||||||
|
---
|
||||||
|
meson.build | 15 +++++++++++++--
|
||||||
|
1 file changed, 13 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/meson.build b/meson.build
|
||||||
|
index afe576b..a513f5f 100644
|
||||||
|
--- a/meson.build
|
||||||
|
+++ b/meson.build
|
||||||
|
@@ -166,8 +166,19 @@ egl_dep = dependency('egl', required: false)
|
||||||
|
|
||||||
|
# Optional dependencies for tests
|
||||||
|
x11_dep = dependency('x11', required: false)
|
||||||
|
-gles1_dep = cc.find_library('libGLESv1_CM', required: false)
|
||||||
|
-gles2_dep = cc.find_library('libGLESv2', required: false)
|
||||||
|
+
|
||||||
|
+# GLES v2 and v1 may have pkg-config files, courtesy of downstream
|
||||||
|
+# packagers; let's check those first, and fall back to find_library()
|
||||||
|
+# if we fail
|
||||||
|
+gles2_dep = dependency('glesv2', required: false)
|
||||||
|
+if not gles2_dep.found()
|
||||||
|
+ gles2_dep = cc.find_library('libGLESv2', required: false)
|
||||||
|
+endif
|
||||||
|
+
|
||||||
|
+gles1_dep = dependency('glesv1_cm', required: false)
|
||||||
|
+if not gles1_dep.found()
|
||||||
|
+ gles1_dep = cc.find_library('libGLESv1_CM', required: false)
|
||||||
|
+endif
|
||||||
|
|
||||||
|
# On windows, the DLL has to have all of its functions
|
||||||
|
# resolved at link time, so we have to link directly aginst
|
||||||
|
--
|
||||||
|
2.12.0
|
||||||
|
|
@ -1,23 +1,23 @@
|
|||||||
#global gitdate 20140411
|
|
||||||
|
|
||||||
%global commit e2c33af5bfcfc9d168f9e776156dd47c33f428b3
|
|
||||||
#global shortcommit %(c=%{commit}; echo ${c:0:7})
|
|
||||||
|
|
||||||
Summary: epoxy runtime library
|
Summary: epoxy runtime library
|
||||||
Name: libepoxy
|
Name: libepoxy
|
||||||
Version: 1.4.1
|
Version: 1.4.1
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: http://github.com/anholt/libepoxy
|
URL: http://github.com/anholt/libepoxy
|
||||||
# github url - generated archive
|
Source0: %{url}/archive/%{name}-%{version}.tar.gz
|
||||||
#ource0: https://github.com/anholt/libepoxy/archive/%{commit}/%{name}-%{commit}.tar.gz
|
|
||||||
Source0: https://github.com/anholt/libepoxy/archive/libepoxy-%{version}.tar.gz
|
|
||||||
|
|
||||||
BuildRequires: automake autoconf libtool
|
Patch0001: 0001-Add-C-guards-around-generated-headers.patch
|
||||||
BuildRequires: mesa-libGL-devel
|
Patch0002: 0002-Add-z-relro-and-z-now-to-the-GCC-linker-flags.patch
|
||||||
BuildRequires: mesa-libEGL-devel
|
Patch0003: 0003-Add-explicit-version-flags-for-macOS-builds.patch
|
||||||
BuildRequires: mesa-libGLES-devel
|
Patch0004: 0004-Use-some-linker-flags-only-on-Linux.patch
|
||||||
BuildRequires: xorg-x11-util-macros
|
Patch0005: 0005-Add-missing-visibility-compiler-flags.patch
|
||||||
|
Patch0006: 0006-Prefer-using-pkg-config-files-to-find-GLES.patch
|
||||||
|
|
||||||
|
BuildRequires: meson
|
||||||
|
BuildRequires: gcc
|
||||||
|
BuildRequires: pkgconfig(gl)
|
||||||
|
BuildRequires: pkgconfig(egl)
|
||||||
|
BuildRequires: pkgconfig(glesv2)
|
||||||
BuildRequires: python3
|
BuildRequires: python3
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -32,43 +32,37 @@ This package contains libraries and header files for
|
|||||||
developing applications that use %{name}.
|
developing applications that use %{name}.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%autosetup -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
autoreconf -vif || exit 1
|
%meson
|
||||||
%configure --disable-silent-rules
|
%meson_build
|
||||||
make %{?_smp_mflags}
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
make install DESTDIR=$RPM_BUILD_ROOT
|
%meson_install
|
||||||
|
|
||||||
# NOTE: We intentionally don't ship *.la files
|
|
||||||
find $RPM_BUILD_ROOT -type f -name '*.la' -delete -print
|
|
||||||
|
|
||||||
%check
|
%check
|
||||||
# In theory this is fixed in 1.2 but we still see errors on most platforms
|
%meson_test
|
||||||
# https://github.com/anholt/libepoxy/issues/24
|
|
||||||
%ifnarch %{arm} aarch64 %{power64} s390x
|
|
||||||
make check
|
|
||||||
%else
|
|
||||||
make check ||:
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%post -p /sbin/ldconfig
|
%post -p /sbin/ldconfig
|
||||||
%postun -p /sbin/ldconfig
|
%postun -p /sbin/ldconfig
|
||||||
|
|
||||||
%files
|
%files
|
||||||
|
%license COPYING
|
||||||
%doc README.md
|
%doc README.md
|
||||||
%{_libdir}/libepoxy.so.0
|
%{_libdir}/libepoxy.so.0*
|
||||||
%{_libdir}/libepoxy.so.0.0.0
|
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%dir %{_includedir}/epoxy/
|
%{_includedir}/epoxy/
|
||||||
%{_includedir}/epoxy/*
|
|
||||||
%{_libdir}/libepoxy.so
|
%{_libdir}/libepoxy.so
|
||||||
%{_libdir}/pkgconfig/epoxy.pc
|
%{_libdir}/pkgconfig/epoxy.pc
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Mar 09 2017 Igor Gnatenko <ignatenko@redhat.com> - 1.4.1-2
|
||||||
|
- Switch to meson
|
||||||
|
- Add license file
|
||||||
|
- Simplify spec
|
||||||
|
|
||||||
* Thu Mar 09 2017 Dave Airlie <airlied@redhat.com> - 1.4.1-1
|
* Thu Mar 09 2017 Dave Airlie <airlied@redhat.com> - 1.4.1-1
|
||||||
- libepoxy 1.4.1
|
- libepoxy 1.4.1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user