SHA256
1
0
forked from pool/raylib

- Use meson to build raylib:

* Takes care of creating proper so versioning
  * Install works (where their makefiles didnt)
- Add root-meson.build
- Add src-meson.build
  Meson files will be in next release, see:
  https://github.com/raysan5/raylib/pull/297
  See: https://github.com/raysan5/raylib/pull/295

OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/raylib?expand=0&rev=2
This commit is contained in:
Michael Vetter 2017-06-08 15:26:37 +00:00 committed by Git OBS Bridge
parent 18eb7c4d9c
commit 64fd0c0d0c
4 changed files with 77 additions and 10 deletions

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Thu Jun 8 15:14:33 UTC 2017 - mvetter@suse.com
- Use meson to build raylib:
* Takes care of creating proper so versioning
* Install works (where their makefiles didnt)
- Add root-meson.build
- Add src-meson.build
Meson files will be in next release, see:
https://github.com/raysan5/raylib/pull/297
-------------------------------------------------------------------
Sun Jun 4 19:36:11 UTC 2017 - mvetter@suse.com
@ -14,6 +25,7 @@ Mon May 29 16:47:32 UTC 2017 - mvetter@suse.com
- Add OpenAL to BuildRequires
- Add raylig-use-optflags.patch: allow passing of optflags
See: https://github.com/raysan5/raylib/pull/295
-------------------------------------------------------------------
Mon May 29 10:26:46 UTC 2017 - mvetter@suse.com

View File

@ -15,17 +15,23 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: raylib
Version: 1.7.0
Release: 0
Summary: C library to learn videogames programming
License: Zlib
Group: Development/Libraries
Group: Development/Libraries/C and C++
Url: http://www.raylib.com
Source: https://github.com/raysan5/%{name}/archive/%{version}.tar.gz
# Will be in next release: https://github.com/raysan5/raylib/pull/297
Source1: root-meson.build
Source2: src-meson.build
# https://github.com/raysan5/raylib/pull/295
Patch0: raylig-use-optflags.patch
BuildRequires: Mesa-libGL-devel
BuildRequires: libglfw-devel
BuildRequires: meson >= 0.39.1
BuildRequires: openal-soft-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -35,27 +41,40 @@ raylib is highly inspired by Borland BGI graphics lib and by XNA framework.
%package -n raylib-devel
Summary: Development files for %{name}
Group: Development/Libraries
Group: Development/Libraries/C and C++
Requires: openal-soft-devel
Requires: libraylib1 = %{version}
%description -n raylib-devel
Development files and headers for %{name}
%package -n libraylib1
Summary: Development files for %{name}
Group: Development/Libraries/C and C++
%description -n libraylib1
C library to learn videogames programming
%prep
%setup -q
%patch0 -p1
cp %{SOURCE1} meson.build
cp %{SOURCE2} src/meson.build
%build
cd src
CFLAGS="%optflags" make %{?_smp_mflags} PLATFORM=PLATFORM_DESKTOP SHARED_RAYLIB=YES
%{meson}
%{meson_build}
%install
cd src
# for some reason that doesnt work
#%make_install SHARED_RAYLIB=YES
# so lets install manually
install -Dm 0755 ../release/linux/libraylib.so %{buildroot}%{_libdir}/libraylib.so
install -Dm 0644 ../release/linux/raylib.h %{buildroot}%{_includedir}/raylib.h
%{meson_install}
%post -n libraylib1 -p /sbin/ldconfig
%postun -n libraylib1 -p /sbin/ldconfig
%files -n libraylib1
%defattr(-,root,root)
%{_libdir}/libraylib.so.1
%{_libdir}/libraylib.so.1.7.0
%files -n raylib-devel
%defattr(-,root,root)

14
root-meson.build Normal file
View File

@ -0,0 +1,14 @@
project('raylib', 'c', version: '1.7.0',
license: 'zlib',
meson_version: '>= 0.39.1')
cc = meson.get_compiler('c')
glfw_dep = dependency('glfw3')
gl_dep = dependency('gl')
openal_dep = dependency('openal')
x11_dep = dependency('x11')
m_dep = cc.find_library('m', required : false)
subdir('src')

22
src-meson.build Normal file
View File

@ -0,0 +1,22 @@
install_headers('raylib.h')
source_c = [
'audio.c',
'core.c',
'models.c',
'rlgl.c',
'shapes.c',
'text.c',
'textures.c',
'utils.c',
'external/stb_vorbis.c',
]
# use 'meson --default-library=static builddir' to build as static, if no builddir yet exists
# use 'mesonconf -Ddefault_library=static builddir' to change the type
raylib = library('raylib',
source_c,
dependencies : [ glfw_dep, gl_dep, openal_dep, m_dep, x11_dep],
install : true,
version : '1.7.0')