Skip to content

Commit b91f4f5

Browse files
committed
Merge pull request kivy#2678 from kived/build-sdl2
Build sdl2 by default
2 parents 98a37ae + 1393175 commit b91f4f5

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

kivy/core/clipboard/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ def _paste(self):
120120
_clipboards.append(
121121
('android', 'clipboard_android', 'ClipboardAndroid'))
122122
elif _platform in ('macosx', 'linux', 'win'):
123-
_clipboards.append(
124-
('sdl2', 'clipboard_sdl2', 'ClipboardSDL2'))
125123
_clipboards.append(
126124
('pygame', 'clipboard_pygame', 'ClipboardPygame'))
125+
_clipboards.append(
126+
('sdl2', 'clipboard_sdl2', 'ClipboardSDL2'))
127127
_clipboards.append(
128128
('dummy', 'clipboard_dummy', 'ClipboardDummy'))
129129

kivy/core/image/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,8 +817,8 @@ def load(filename):
817817
image_libs += [
818818
('tex', 'img_tex'),
819819
('dds', 'img_dds'),
820-
('sdl2', 'img_sdl2'),
821820
('pygame', 'img_pygame'),
821+
('sdl2', 'img_sdl2'),
822822
('ffpy', 'img_ffpyplayer'),
823823
('pil', 'img_pil'),
824824
('gif', 'img_gif')]

kivy/core/text/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,8 +673,8 @@ def _set_text_size(self, x):
673673

674674
# Load the appropriate provider
675675
Label = core_select_lib('text', (
676-
('sdl2', 'text_sdl2', 'LabelSDL2'),
677676
('pygame', 'text_pygame', 'LabelPygame'),
677+
('sdl2', 'text_sdl2', 'LabelSDL2'),
678678
('sdlttf', 'text_sdlttf', 'LabelSDLttf'),
679679
('pil', 'text_pil', 'LabelPIL'),
680680
))

kivy/tools/packaging/linux/debian/control

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Build-Depends: debhelper (>= 7.0.50~), pkg-config,
1414
libgl1-mesa-dev,
1515
libgles2-mesa-dev,
1616
libsdl-ttf2.0-dev,
17+
libsdl2-dev, libsdl2-image-dev, libsdl2-mixer-dev, libsdl2-ttf-dev,
1718
libgstreamer1.0-dev | libgstreamer0.10-dev,
1819
texlive-latex-base, texlive-latex-recommended, texlive-latex-extra, texlive-fonts-extra, texlive-fonts-recommended,
1920
Standards-Version: 3.9.1

setup.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,10 @@ def update_if_changed(self, fn, content):
224224
if 'libraries' in gst_flags:
225225
c_options['use_gstreamer'] = True
226226

227+
sdl2_flags = pkgconfig('sdl2', 'SDL2_ttf', 'SDL2_image', 'SDL2_mixer')
228+
if 'libraries' in sdl2_flags:
229+
c_options['use_sdl2'] = True
230+
227231

228232
# -----------------------------------------------------------------------------
229233
# declare flags
@@ -396,14 +400,19 @@ def determine_sdl2():
396400

397401
sdl2_path = environ.get('KIVY_SDL2_PATH', None)
398402

403+
if sdl2_flags and not sdl2_path:
404+
return sdl2_flags
405+
406+
# no pkgconfig info, or we want to use a specific sdl2 path, so perform
407+
# manual configuration
399408
flags['libraries'] = ['SDL2', 'SDL2_ttf', 'SDL2_image', 'SDL2_mixer']
400409
flags['include_dirs'] = ([sdl2_path] if sdl2_path else
401410
['/usr/local/include/SDL2', '/usr/include/SDL2'])
402411

403412
flags['extra_link_args'] = []
404413
flags['extra_compile_args'] = []
405414
flags['extra_link_args'] += (['-L' + sdl2_path] if sdl2_path else
406-
['-L/usr/local/lib/'])
415+
['-L/usr/local/lib/'])
407416

408417
# ensure headers for all the SDL2 and sub libraries are available
409418
libs_to_check = ['SDL', 'SDL_mixer', 'SDL_ttf', 'SDL_image']

0 commit comments

Comments
 (0)