teek-sdl2 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d084a6f681a0b04a3b68ad4bc0b905ff12a50e8cf08060982752601f1d33cad
4
- data.tar.gz: 1ecc0e2befda331f9f427e9885d86f2a0261d609ca2cb6600c7a8f6ab3d92add
3
+ metadata.gz: 42e232c86750e8313a051b00099dc677fa26888e8f0eace2a0fd2101b4d5aebd
4
+ data.tar.gz: ae409b3dae88d5b89c3f5c4552fbd761ae627200c5c7a1ed6859682d5aa61197
5
5
  SHA512:
6
- metadata.gz: 7f847401b7b73c85de8d153ca1275d5756b6d5fa258b1dfd7f7a3d4ff451775fa2d47fc541e0234e405c1b01cf49ee49f7cfa7bb32c042b7a1934aad8fcab246
7
- data.tar.gz: 819be6909a74692e4de3a6e0c00b79305c7f899ba7175e0fe01ae815b9c549dfe5360a827af04988317e3a77806e953021cffa452285f506664b3d298167dd1c
6
+ metadata.gz: 89acada5767fe800d184cc8881053b4b76a0f75cb0742eb150d43567005a4f0474f8ccbad012bc991496e01cbf6c416519f1904c2451dbc866903aac9dad1c12
7
+ data.tar.gz: dbbbb729914e2c17321889c958a4381547ba4944c7ab3f0c313ee8e91ae42695ebc077b0520d5dea4574fc583d9cb2d0dd30545c1c1d6a896ceab4223f561c72
@@ -2,6 +2,17 @@
2
2
 
3
3
  require 'mkmf'
4
4
 
5
+ # Detect MSYS2 package prefix based on Ruby's platform.
6
+ # UCRT builds (Ruby 3.1+) use mingw-w64-ucrt-x86_64-*, older MINGW64
7
+ # builds use mingw-w64-x86_64-*.
8
+ def msys2_pkg_prefix
9
+ if RUBY_PLATFORM.include?('ucrt')
10
+ 'mingw-w64-ucrt-x86_64'
11
+ else
12
+ 'mingw-w64-x86_64'
13
+ end
14
+ end
15
+
5
16
  def find_sdl2
6
17
  # 1. Try SDL2_DIR env var first (explicit override)
7
18
  if ENV['SDL2_DIR']
@@ -82,7 +93,7 @@ unless find_sdl2
82
93
  SDL2 not found. Install it:
83
94
  macOS: brew install sdl2
84
95
  Debian: sudo apt-get install libsdl2-dev
85
- Windows: pacman -S mingw-w64-x86_64-SDL2 (MSYS2)
96
+ Windows: pacman -S #{msys2_pkg_prefix}-SDL2 (MSYS2)
86
97
  Or set SDL2_DIR=/path/to/sdl2
87
98
  MSG
88
99
  end
@@ -93,7 +104,7 @@ unless pkg_config('SDL2_ttf') || have_library('SDL2_ttf', 'TTF_Init', 'SDL2/SDL_
93
104
  SDL2_ttf not found. Install it:
94
105
  macOS: brew install sdl2_ttf
95
106
  Debian: sudo apt-get install libsdl2-ttf-dev
96
- Windows: pacman -S mingw-w64-x86_64-SDL2_ttf (MSYS2)
107
+ Windows: pacman -S #{msys2_pkg_prefix}-SDL2_ttf (MSYS2)
97
108
  MSG
98
109
  end
99
110
 
@@ -103,10 +114,20 @@ unless pkg_config('SDL2_image') || have_library('SDL2_image', 'IMG_Init', 'SDL2/
103
114
  SDL2_image not found. Install it:
104
115
  macOS: brew install sdl2_image
105
116
  Debian: sudo apt-get install libsdl2-image-dev
106
- Windows: pacman -S mingw-w64-x86_64-SDL2_image (MSYS2)
117
+ Windows: pacman -S #{msys2_pkg_prefix}-SDL2_image (MSYS2)
118
+ MSG
119
+ end
120
+
121
+ # SDL2_mixer for audio playback
122
+ unless pkg_config('SDL2_mixer') || have_library('SDL2_mixer', 'Mix_OpenAudio', 'SDL2/SDL_mixer.h')
123
+ abort <<~MSG
124
+ SDL2_mixer not found. Install it:
125
+ macOS: brew install sdl2_mixer
126
+ Debian: sudo apt-get install libsdl2-mixer-dev
127
+ Windows: pacman -S #{msys2_pkg_prefix}-SDL2_mixer (MSYS2)
107
128
  MSG
108
129
  end
109
130
 
110
- $srcs = ['teek_sdl2.c', 'sdl2surface.c', 'sdl2bridge.c', 'sdl2text.c', 'sdl2pixels.c', 'sdl2image.c']
131
+ $srcs = ['teek_sdl2.c', 'sdl2surface.c', 'sdl2bridge.c', 'sdl2text.c', 'sdl2pixels.c', 'sdl2image.c', 'sdl2mixer.c', 'sdl2gamepad.c']
111
132
 
112
133
  create_makefile('teek_sdl2')