Gentoo Archives: gentoo-commits

From: Matt Turner <mattst88@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/waffle/files/, media-libs/waffle/
Date: Fri, 07 Feb 2020 21:47:50
Message-Id: 1581112044.909c1837f2cdc2bf1d93728b33c7c1285dff96bb.mattst88@gentoo
1 commit: 909c1837f2cdc2bf1d93728b33c7c1285dff96bb
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Fri Feb 7 21:16:43 2020 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Fri Feb 7 21:47:24 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=909c1837
7
8 media-libs/waffle: Generate WaffleConfig.cmake file
9
10 Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
11
12 ...ate-cmake-config-and-version-files-if-mes.patch | 87 ++++++++++++++++++++++
13 media-libs/waffle/waffle-1.6.0-r1.ebuild | 77 +++++++++++++++++++
14 2 files changed, 164 insertions(+)
15
16 diff --git a/media-libs/waffle/files/waffle-1.6.0-meson-Generate-cmake-config-and-version-files-if-mes.patch b/media-libs/waffle/files/waffle-1.6.0-meson-Generate-cmake-config-and-version-files-if-mes.patch
17 new file mode 100644
18 index 00000000000..ef31275de08
19 --- /dev/null
20 +++ b/media-libs/waffle/files/waffle-1.6.0-meson-Generate-cmake-config-and-version-files-if-mes.patch
21 @@ -0,0 +1,87 @@
22 +From b71cfa674db5828a2be04a42ce9996d6677629ee Mon Sep 17 00:00:00 2001
23 +From: Dylan Baker <dylan@×××××××××.com>
24 +Date: Fri, 7 Jun 2019 15:36:09 -0700
25 +Subject: [PATCH] meson: Generate cmake config and version files if meson is
26 + new enough
27 +
28 +Meson 0.50.0 added a module similar to the pkg-config module for
29 +generating cmake config files. Since the CMake build system provides
30 +these the meson build system should as well.
31 +
32 +v2: - Bump version to 0.50 instead of incorrect 0.49
33 +v3: - remove TODO comment that this fixes
34 + - Add a definition of set_and_check for meson-generated Config
35 + files.
36 +
37 +Reviewed-by: Eric Engestrom <eric.engestrom@×××××.com>
38 +---
39 + cmake/Modules/WaffleConfig.cmake.in | 10 ++++++++++
40 + meson.build | 2 --
41 + src/waffle/meson.build | 20 ++++++++++++++++++++
42 + 3 files changed, 30 insertions(+), 2 deletions(-)
43 +
44 +diff --git a/cmake/Modules/WaffleConfig.cmake.in b/cmake/Modules/WaffleConfig.cmake.in
45 +index b60b470..4e19755 100644
46 +--- a/cmake/Modules/WaffleConfig.cmake.in
47 ++++ b/cmake/Modules/WaffleConfig.cmake.in
48 +@@ -7,6 +7,16 @@
49 +
50 + @PACKAGE_INIT@
51 +
52 ++# This should only be used for meson
53 ++if (NOT DEFINED set_and_check)
54 ++ macro(set_and_check _var _file)
55 ++ set(${_var} "${_file}")
56 ++ if(NOT EXISTS "${_file}")
57 ++ message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
58 ++ endif()
59 ++ endmacro()
60 ++endif()
61 ++
62 + set_and_check(Waffle_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@/@waffle_libname@")
63 + set_and_check(Waffle_LIBRARY_DIRS "@PACKAGE_CMAKE_INSTALL_LIBDIR@")
64 + set(Waffle_LIBRARIES "@waffle_libname@")
65 +diff --git a/meson.build b/meson.build
66 +index 29fda22..22b7f59 100644
67 +--- a/meson.build
68 ++++ b/meson.build
69 +@@ -231,5 +231,3 @@ endif
70 + if get_option('build-examples')
71 + subdir('examples')
72 + endif
73 +-
74 +-# TODO: CMake config file
75 +diff --git a/src/waffle/meson.build b/src/waffle/meson.build
76 +index 322df40..cd68ddf 100644
77 +--- a/src/waffle/meson.build
78 ++++ b/src/waffle/meson.build
79 +@@ -211,6 +211,26 @@ pkg.generate(
80 + description : 'A library for selecting an OpenGL API and windows system at runtime.',
81 + )
82 +
83 ++if meson.version().version_compare('>= 0.50')
84 ++ cmake = import('cmake')
85 ++ cmake.write_basic_package_version_file(
86 ++ name : 'Waffle',
87 ++ version : meson.project_version(),
88 ++ compatibility : 'SameMajorVersion',
89 ++ )
90 ++
91 ++ cmake_conf = configuration_data()
92 ++ cmake_conf.set('waffle_libname', waffle_name)
93 ++ cmake_conf.set('PACKAGE_CMAKE_INSTALL_INCLUDEDIR', join_paths('${PACKAGE_PREFIX_DIR}', get_option('includedir')))
94 ++ cmake_conf.set('PACKAGE_CMAKE_INSTALL_LIBDIR', join_paths('${PACKAGE_PREFIX_DIR}', get_option('libdir')))
95 ++
96 ++ cmake.configure_package_config_file(
97 ++ name : 'Waffle',
98 ++ input : '../../cmake/Modules/WaffleConfig.cmake.in',
99 ++ configuration : cmake_conf,
100 ++ )
101 ++endif
102 ++
103 + if get_option('build-tests')
104 + if get_option('default_library') == 'shared'
105 + # The unit tests need to poke at internals of the library, but with a
106 +--
107 +2.24.1
108 +
109
110 diff --git a/media-libs/waffle/waffle-1.6.0-r1.ebuild b/media-libs/waffle/waffle-1.6.0-r1.ebuild
111 new file mode 100644
112 index 00000000000..2f9c6de8b55
113 --- /dev/null
114 +++ b/media-libs/waffle/waffle-1.6.0-r1.ebuild
115 @@ -0,0 +1,77 @@
116 +# Copyright 1999-2019 Gentoo Authors
117 +# Distributed under the terms of the GNU General Public License v2
118 +
119 +EAPI=7
120 +
121 +if [[ ${PV} = *9999* ]]; then
122 + EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/${PN}"
123 + GIT_ECLASS="git-r3"
124 +else
125 + SRC_URI="http://www.waffle-gl.org/files/release/${P}/${P}.tar.xz"
126 + KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86"
127 +fi
128 +inherit meson multilib-minimal ${GIT_ECLASS}
129 +
130 +DESCRIPTION="Library that allows selection of GL API and of window system at runtime"
131 +HOMEPAGE="http://www.waffle-gl.org/ https://gitlab.freedesktop.org/mesa/waffle"
132 +
133 +LICENSE="BSD-2"
134 +SLOT="0"
135 +IUSE="doc egl gbm test wayland X"
136 +RESTRICT="test" # gl_basic tests don't work when run from portage
137 +
138 +RDEPEND="
139 + >=media-libs/mesa-9.1.6[egl?,gbm?,${MULTILIB_USEDEP}]
140 + >=virtual/opengl-7.0-r1[${MULTILIB_USEDEP}]
141 + >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
142 + >=x11-libs/libxcb-1.9.1[${MULTILIB_USEDEP}]
143 + gbm? ( >=virtual/libudev-208:=[${MULTILIB_USEDEP}] )
144 + wayland? ( >=dev-libs/wayland-1.0.6[${MULTILIB_USEDEP}] )
145 +"
146 +DEPEND="${RDEPEND}
147 + >=x11-base/xcb-proto-1.8-r3[${MULTILIB_USEDEP}]
148 + doc? (
149 + dev-libs/libxslt
150 + app-text/docbook-xml-dtd:4.2
151 + )
152 +"
153 +
154 +PATCHES=(
155 + "${FILESDIR}"/${P}-meson-Generate-cmake-config-and-version-files-if-mes.patch
156 +)
157 +
158 +MULTILIB_CHOST_TOOLS=(
159 + /usr/bin/wflinfo$(get_exeext)
160 +)
161 +
162 +src_unpack() {
163 + default
164 + [[ $PV = 9999* ]] && git-r3_src_unpack
165 +}
166 +
167 +multilib_src_configure() {
168 + local emesonargs=(
169 + $(meson_feature X glx)
170 + $(meson_feature wayland)
171 + $(meson_feature X x11_egl)
172 + $(meson_feature gbm)
173 + $(meson_feature egl surfaceless_egl)
174 + $(meson_use test build-tests)
175 + $(meson_use doc build-manpages)
176 + )
177 + meson_src_configure
178 +}
179 +
180 +multilib_src_compile() {
181 + meson_src_compile
182 +}
183 +
184 +multilib_src_test() {
185 + meson_src_test
186 +}
187 +
188 +multilib_src_install() {
189 + meson_src_install
190 +
191 + rm -rf "${D}"/usr/share/doc/waffle1
192 +}