summaryrefslogtreecommitdiff
path: root/glfw.spec
blob: 4c829ab94e67665eacb558fbfba60b2e0cc168a5 (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
# topdir: glfw-3.6.0
# Disable auto-generated debuginfo/debugsource subpackages: the cmake build
# does not emit usable debug source references, so find-debuginfo produces an
# empty debugsourcefiles.list and rpmbuild aborts with "Empty %files file".
%global debug_package %{nil}
Name:           glfw
Version:        3.6.0
Release:        2%{?dist}
Summary:        A multi-platform library for OpenGL, OpenGL ES and Vulkan application development

License:        zlib
URL:            https://www.glfw.org/
# Pinned to the exact commit built from (no git tag at this version); local
# source tarball is created with topdir glfw-VERSION for reproducible prep.
Source0:        https://github.com/glfw/glfw/archive/92dcf4ce74f2e2554a98fea09be7c705c17daa5a.tar.gz#/glfw-%{version}.tar.gz

Group:          Development/Libraries
Packager:       openEuler Builder <builder@openeuler.org>

BuildRequires:  cmake
BuildRequires:  gcc
BuildRequires:  make
# X11 backend (GLFW_BUILD_X11 default ON)
BuildRequires:  libX11-devel
BuildRequires:  libXrandr-devel
BuildRequires:  libXinerama-devel
BuildRequires:  libXcursor-devel
BuildRequires:  libXi-devel
BuildRequires:  libXext-devel
# Wayland backend (GLFW_BUILD_WAYLAND default ON) - wayland-devel provides
# wayland-client/cursor/egl and the wayland-scanner binary; xkbcommon for input.
# Protocol XML files are bundled in deps/wayland/, so wayland-protocols is not
# required. EpollShim is only looked up on non-Linux and skipped here.
BuildRequires:  wayland-devel
BuildRequires:  libxkbcommon-devel

%description
GLFW is an Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan
application development. It provides a simple, platform-independent API for
creating windows, contexts and surfaces, reading input, handling events, etc.
GLFW is written primarily in C99 and is licensed under the zlib/libpng license.

%package devel
Summary:        Development files for %{name}
Group:          Development/Libraries
Packager:       openEuler Builder <builder@openeuler.org>
Requires:       %{name} = %{version}-%{release}

%description devel
Header files, the development library symlink, CMake integration files and
pkg-config metadata for %{name}.

%prep
%autosetup -n %{name}-%{version} -p1

%build
# Use explicit cmake commands: openEuler 24.03 the cmake macro is in-source
# (no -B) while the cmake_build macro expects an out-of-tree target-platform
# directory; explicit -B build / cmake --build / cmake --install avoids the mismatch.
mkdir -p build
cmake -B build \
    -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \
    -DCMAKE_INSTALL_LIBDIR=%{_libdir} \
    -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \
    -DGLFW_LIBRARY_TYPE=SHARED \
    -DGLFW_BUILD_EXAMPLES=OFF \
    -DGLFW_BUILD_TESTS=OFF \
    -DGLFW_BUILD_DOCS=OFF
cmake --build build %{?_smp_build_ncpus:-j%{_smp_build_ncpus}}

%install
DESTDIR=%{buildroot} cmake --install build

%files
%license LICENSE.md
%doc README.md
%{_libdir}/libglfw.so.3
%{_libdir}/libglfw.so.3.*

%files devel
%{_includedir}/GLFW/
%{_libdir}/libglfw.so
%{_libdir}/cmake/glfw3/
%{_libdir}/pkgconfig/glfw3.pc

%changelog
* Wed Sep 30 2026 openEuler Builder <builder@openeuler.org> - 3.6.0-2
- Disable debug_package to fix empty debugsourcefiles.list build failure

* Wed Sep 30 2026 openEuler Builder <builder@openeuler.org> - 3.6.0-1
- Initial package