Gentoo Archives: gentoo-commits

From: James Le Cuirot <chewi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/libsdl2/, media-libs/libsdl2/files/
Date: Mon, 07 May 2018 21:05:59
Message-Id: 1525727146.e993186d745cece33c2085c215cdeb17c30b5696.chewi@gentoo
1 commit: e993186d745cece33c2085c215cdeb17c30b5696
2 Author: Azamat H. Hackimov <azamat.hackimov <AT> gmail <DOT> com>
3 AuthorDate: Sat Apr 21 09:04:45 2018 +0000
4 Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
5 CommitDate: Mon May 7 21:05:46 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e993186d
7
8 media-libs/libsdl2: Fix to CMake building errors
9
10 Generated sdl2.pc contains trailing spaces which considered as error in
11 CMake policy CMP0004. Added patch that fixes that.
12
13 Upstream bug: https://bugzilla.libsdl.org/show_bug.cgi?id=4144
14 Bug: https://bugs.gentoo.org/646364
15 Package-Manager: Portage-2.3.24, Repoman-2.3.6
16 Closes: https://github.com/gentoo/gentoo/pull/8098
17
18 .../files/libsdl2-2.0.8-rework-variables.patch | 68 ++++++++
19 media-libs/libsdl2/libsdl2-2.0.8-r2.ebuild | 171 +++++++++++++++++++++
20 2 files changed, 239 insertions(+)
21
22 diff --git a/media-libs/libsdl2/files/libsdl2-2.0.8-rework-variables.patch b/media-libs/libsdl2/files/libsdl2-2.0.8-rework-variables.patch
23 new file mode 100644
24 index 00000000000..9fc43f2b38c
25 --- /dev/null
26 +++ b/media-libs/libsdl2/files/libsdl2-2.0.8-rework-variables.patch
27 @@ -0,0 +1,68 @@
28 +
29 +# HG changeset patch
30 +# User Sam Lantinga <slouken@××××××.org>
31 +# Date 1524545759 25200
32 +# Node ID 28be2719184c8177899d96b696bcf5e28451266f
33 +# Parent 2a7839691e3d88c0480c4a855126d5fa03f9ff6a
34 +Fixed bug 4144 - CMake complains about trailing spaces in sdl2.pc
35 +
36 + Azamat H. Hackimov
37 +
38 +When you try use SDL2 2.0.8 in CMake project in Linux, it complains about trailing spaces in sdl2.pc:
39 +
40 +CMake Error at CMakeLists.txt:147 (add_executable):
41 + Target "TestSimpleMain" links to item "-L/usr/lib64 -lSDL2 " which has
42 + leading or trailing whitespace. This is now an error according to policy
43 + CMP0004.
44 +
45 +diff -r 2a7839691e3d -r 28be2719184c configure
46 +--- a/configure Mon Apr 23 21:50:03 2018 -0700
47 ++++ b/configure Mon Apr 23 21:55:59 2018 -0700
48 +@@ -15752,10 +15752,17 @@
49 + # fi
50 + #done
51 + SDL_CFLAGS="$BASE_CFLAGS"
52 +-SDL_LIBS="-lSDL2 $BASE_LDFLAGS"
53 +-CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
54 +-CFLAGS="$CFLAGS $EXTRA_CFLAGS"
55 +-LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
56 ++SDL_LIBS="-lSDL2"
57 ++if "$BASE_LDFLAGS" != "" ; then
58 ++ SDL_LIBS="$SDL_LIBS $BASE_LDFLAGS"
59 ++fi
60 ++if "$EXTRA_CFLAGS" != "" ; then
61 ++ CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
62 ++ CFLAGS="$CFLAGS $EXTRA_CFLAGS"
63 ++fi
64 ++if "$EXTRA_LDFLAGS" != "" ; then
65 ++ LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
66 ++fi
67 +
68 + base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
69 +
70 +diff -r 2a7839691e3d -r 28be2719184c configure.in
71 +--- a/configure.in Mon Apr 23 21:50:03 2018 -0700
72 ++++ b/configure.in Mon Apr 23 21:55:59 2018 -0700
73 +@@ -123,10 +123,17 @@
74 + # fi
75 + #done
76 + SDL_CFLAGS="$BASE_CFLAGS"
77 +-SDL_LIBS="-lSDL2 $BASE_LDFLAGS"
78 +-CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
79 +-CFLAGS="$CFLAGS $EXTRA_CFLAGS"
80 +-LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
81 ++SDL_LIBS="-lSDL2"
82 ++if [ "$BASE_LDFLAGS" != "" ]; then
83 ++ SDL_LIBS="$SDL_LIBS $BASE_LDFLAGS"
84 ++fi
85 ++if [ "$EXTRA_CFLAGS" != "" ]; then
86 ++ CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
87 ++ CFLAGS="$CFLAGS $EXTRA_CFLAGS"
88 ++fi
89 ++if [ "$EXTRA_LDFLAGS" != "" ]; then
90 ++ LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
91 ++fi
92 +
93 + dnl set this to use on systems that use lib64 instead of lib
94 + base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
95 +
96
97 diff --git a/media-libs/libsdl2/libsdl2-2.0.8-r2.ebuild b/media-libs/libsdl2/libsdl2-2.0.8-r2.ebuild
98 new file mode 100644
99 index 00000000000..0690eaf5b39
100 --- /dev/null
101 +++ b/media-libs/libsdl2/libsdl2-2.0.8-r2.ebuild
102 @@ -0,0 +1,171 @@
103 +# Copyright 1999-2018 Gentoo Foundation
104 +# Distributed under the terms of the GNU General Public License v2
105 +
106 +EAPI=6
107 +inherit autotools flag-o-matic ltprune toolchain-funcs multilib-minimal
108 +
109 +MY_P="SDL2-${PV}"
110 +DESCRIPTION="Simple Direct Media Layer"
111 +HOMEPAGE="http://www.libsdl.org"
112 +SRC_URI="http://www.libsdl.org/release/${MY_P}.tar.gz"
113 +
114 +LICENSE="ZLIB"
115 +SLOT="0"
116 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
117 +
118 +IUSE="cpu_flags_x86_3dnow alsa altivec aqua custom-cflags dbus gles haptic libsamplerate +joystick cpu_flags_x86_mmx nas opengl oss pulseaudio +sound cpu_flags_x86_sse cpu_flags_x86_sse2 static-libs +threads tslib udev +video wayland X xinerama xscreensaver"
119 +REQUIRED_USE="
120 + alsa? ( sound )
121 + gles? ( video )
122 + nas? ( sound )
123 + opengl? ( video )
124 + pulseaudio? ( sound )
125 + wayland? ( gles )
126 + xinerama? ( X )
127 + xscreensaver? ( X )"
128 +
129 +RDEPEND="
130 + alsa? ( >=media-libs/alsa-lib-1.0.27.2[${MULTILIB_USEDEP}] )
131 + dbus? ( >=sys-apps/dbus-1.6.18-r1[${MULTILIB_USEDEP}] )
132 + gles? ( >=media-libs/mesa-9.1.6[${MULTILIB_USEDEP},gles2] )
133 + libsamplerate? ( media-libs/libsamplerate[${MULTILIB_USEDEP}] )
134 + nas? (
135 + >=media-libs/nas-1.9.4[${MULTILIB_USEDEP}]
136 + >=x11-libs/libXt-1.1.4[${MULTILIB_USEDEP}] )
137 + opengl? (
138 + >=virtual/opengl-7.0-r1[${MULTILIB_USEDEP}]
139 + >=virtual/glu-9.0-r1[${MULTILIB_USEDEP}]
140 + )
141 + pulseaudio? ( >=media-sound/pulseaudio-2.1-r1[${MULTILIB_USEDEP}] )
142 + tslib? ( >=x11-libs/tslib-1.0-r3[${MULTILIB_USEDEP}] )
143 + udev? ( >=virtual/libudev-208:=[${MULTILIB_USEDEP}] )
144 + wayland? (
145 + >=dev-libs/wayland-1.0.6[${MULTILIB_USEDEP}]
146 + >=media-libs/mesa-9.1.6[${MULTILIB_USEDEP},egl,gles2,wayland]
147 + >=x11-libs/libxkbcommon-0.2.0[${MULTILIB_USEDEP}]
148 + )
149 + X? (
150 + >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
151 + >=x11-libs/libXcursor-1.1.14[${MULTILIB_USEDEP}]
152 + >=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
153 + >=x11-libs/libXi-1.7.2[${MULTILIB_USEDEP}]
154 + >=x11-libs/libXrandr-1.4.2[${MULTILIB_USEDEP}]
155 + >=x11-libs/libXxf86vm-1.1.3[${MULTILIB_USEDEP}]
156 + xinerama? ( >=x11-libs/libXinerama-1.1.3[${MULTILIB_USEDEP}] )
157 + xscreensaver? ( >=x11-libs/libXScrnSaver-1.2.2-r1[${MULTILIB_USEDEP}] )
158 + )"
159 +DEPEND="${RDEPEND}
160 + X? (
161 + >=x11-proto/xextproto-7.2.1-r1[${MULTILIB_USEDEP}]
162 + >=x11-proto/xproto-7.0.24[${MULTILIB_USEDEP}]
163 + )
164 + virtual/pkgconfig"
165 +
166 +MULTILIB_WRAPPED_HEADERS=(
167 + /usr/include/SDL2/SDL_config.h
168 +)
169 +
170 +PATCHES=(
171 + # https://bugzilla.libsdl.org/show_bug.cgi?id=1431
172 + "${FILESDIR}"/${PN}-2.0.6-static-libs.patch
173 + # https://bugzilla.libsdl.org/show_bug.cgi?id=4144
174 + "${FILESDIR}"/${P}-rework-variables.patch
175 +)
176 +
177 +S="${WORKDIR}/${MY_P}"
178 +
179 +src_prepare() {
180 + default
181 + sed -i -e 's/configure.in/configure.ac/' Makefile.in || die
182 + mv configure.{in,ac} || die
183 + AT_M4DIR="/usr/share/aclocal acinclude" eautoreconf
184 +}
185 +
186 +multilib_src_configure() {
187 + use custom-cflags || strip-flags
188 +
189 + # sorted by `./configure --help`
190 + local myeconfargs=(
191 + $(use_enable static-libs static)
192 + --enable-atomic
193 + $(use_enable sound audio)
194 + $(use_enable video)
195 + --enable-render
196 + --enable-events
197 + $(use_enable joystick)
198 + $(use_enable haptic)
199 + --enable-power
200 + --enable-filesystem
201 + $(use_enable threads)
202 + --enable-timers
203 + --enable-file
204 + $(use_enable kernel_Winnt loadso)
205 + --enable-cpuinfo
206 + --enable-assembly
207 + $(use_enable cpu_flags_x86_sse ssemath)
208 + $(use_enable cpu_flags_x86_mmx mmx)
209 + $(use_enable cpu_flags_x86_3dnow 3dnow)
210 + $(use_enable cpu_flags_x86_sse sse)
211 + $(use_enable cpu_flags_x86_sse2 sse2)
212 + $(use_enable altivec)
213 + $(use_enable oss)
214 + $(use_enable alsa)
215 + --disable-alsa-shared
216 + --disable-esd
217 + $(use_enable pulseaudio)
218 + --disable-pulseaudio-shared
219 + --disable-arts
220 + $(use_enable libsamplerate)
221 + $(use_enable nas)
222 + --disable-nas-shared
223 + --disable-sndio
224 + --disable-sndio-shared
225 + $(use_enable sound diskaudio)
226 + $(use_enable sound dummyaudio)
227 + $(use_enable wayland video-wayland)
228 + --disable-wayland-shared
229 + --disable-video-mir
230 + $(use_enable X video-x11)
231 + --disable-x11-shared
232 + $(use_enable X video-x11-xcursor)
233 + $(use_enable X video-x11-xdbe)
234 + $(use_enable xinerama video-x11-xinerama)
235 + $(use_enable X video-x11-xinput)
236 + $(use_enable X video-x11-xrandr)
237 + $(use_enable xscreensaver video-x11-scrnsaver)
238 + $(use_enable X video-x11-xshape)
239 + $(use_enable X video-x11-vm)
240 + $(use_enable aqua video-cocoa)
241 + --disable-video-directfb
242 + --disable-fusionsound
243 + --disable-fusionsound-shared
244 + $(use_enable video video-dummy)
245 + $(use_enable opengl video-opengl)
246 + --disable-video-opengles1
247 + $(use_enable gles video-opengles2)
248 + --disable-video-vulkan
249 + $(use_enable udev libudev)
250 + $(use_enable dbus)
251 + --disable-ibus
252 + $(use_enable tslib input-tslib)
253 + --disable-directx
254 + --disable-rpath
255 + --disable-render-d3d
256 + $(use_with X x)
257 + )
258 +
259 + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
260 +}
261 +
262 +multilib_src_compile() {
263 + emake V=1
264 +}
265 +
266 +multilib_src_install() {
267 + emake DESTDIR="${D}" install
268 +}
269 +
270 +multilib_src_install_all() {
271 + prune_libtool_files
272 + dodoc {BUGS,CREDITS,README,README-SDL,TODO,WhatsNew}.txt docs/README*.md
273 +}