summaryrefslogtreecommitdiff
path: root/packaging/emulator-yagl.spec
blob: 99e5e5eb64215746ebbdf6c7fa71f48234434fbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
%bcond_with wayland
%bcond_with emulator

%define ENABLE_TIZEN_BACKEND 1

Name:       emulator-yagl
Summary:    YaGL - OpenGLES acceleration module for emulator
Version:    1.6
Release:    1
License:    MIT and LGPL-3.0+
Group:      SDK/Libraries
Source0:    %{name}-%{version}.tar.gz
Source1001:     emulator-yagl.manifest
BuildRequires:  cmake
BuildRequires:  flex
BuildRequires:  bison
BuildRequires:  pkgconfig(libdrm)
%if "%{ENABLE_TIZEN_BACKEND}" == "1"
BuildRequires:  pkgconfig(libtbm)
BuildRequires:  pkgconfig(libtbm-vigs)
BuildRequires:  pkgconfig(tpl-egl)
BuildRequires:  pkgconfig(wayland-egl)
%endif
BuildRequires:  pkgconfig(gbm)
BuildRequires:  pkgconfig(libudev)
BuildRequires:  pkgconfig(wayland-client)
BuildRequires:  pkgconfig(wayland-server)
Provides:   opengl-es-drv

%if %{with emulator}
ExclusiveArch: %{ix86} x86_64
%else
ExclusiveArch:
%endif

%description
YaGL - OpenGLES acceleration module for emulator.
This package contains shared libraries libEGL, libGLES_CM, libGLESv2.

%package devel
Summary:    YaGL - OpenGLES acceleration module for emulator (devel)
Requires:   %{name} = %{version}-%{release}

%description devel
YaGL - OpenGLES acceleration module for emulator (devel)

%if "%{ENABLE_TIZEN_BACKEND}" == "0"
%package -n libwayland-egl
Summary:    Wayland EGL backend

%description -n libwayland-egl
Wayland EGL backend

%package -n libwayland-egl-devel
Summary:    Development files for use with Wayland protocol

%description -n libwayland-egl-devel
Development files for use with Wayland protocol
%endif

%prep
%setup -q

%build
%{?asan:%define ASAN_LIBS -DWAYLAND_CLIENT_LIBRARIES="-lpthread"}
cp %{SOURCE1001} .
%if "%{ENABLE_TIZEN_BACKEND}" == "1"
cmake -DCMAKE_INSTALL_PREFIX=%{buildroot} -DINSTALL_LIB_DIR=%{buildroot}%{_libdir} -DPLATFORM_TIZEN=1 -DDUMMY_LIBS=1 %?ASAN_LIBS
%else
cmake -DCMAKE_INSTALL_PREFIX=%{buildroot} -DINSTALL_LIB_DIR=%{buildroot}%{_libdir} -DPLATFORM_X11=0 -DPLATFORM_GBM=0 -DPLATFORM_WAYLAND=1 %?ASAN_LIBS
%endif
make

%install
rm -fr %{buildroot}
mkdir -p %{buildroot}
mkdir -p %{buildroot}%{_libdir}
mkdir -p %{buildroot}%{_libdir}/pkgconfig
mkdir -p %{buildroot}/etc/profile.d

make install

cp packaging/opengl-es-setup-yagl-env.sh %{buildroot}/etc/profile.d/

%if "%{ENABLE_TIZEN_BACKEND}" == "0"
cp pkgconfig/wayland-egl.pc %{buildroot}%{_libdir}/pkgconfig/
%post   -n libwayland-egl -p /sbin/ldconfig
%postun -n libwayland-egl -p /sbin/ldconfig
%endif

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%files
%manifest %{name}.manifest
%license COPYING
%defattr(-,root,root,-)
%{_libdir}/driver/libEGL*
%{_libdir}/driver/libGL*
%attr(770,root,root)/etc/profile.d/opengl-es-setup-yagl-env.sh

%if "%{ENABLE_TIZEN_BACKEND}" == "0"
%files -n libwayland-egl
%manifest %{name}.manifest
%license COPYING
%defattr(-,root,root,-)
%{_libdir}/libwayland-egl*

%files -n libwayland-egl-devel
%defattr(-,root,root,-)
%{_libdir}/pkgconfig/wayland-egl.pc
%endif