Skip to content

Commit

Permalink
sdl2: version 2.26.3
Browse files Browse the repository at this point in the history
The formula depends on quic/quic/libepoxy with EGL enabled, it downloads
sources from github/libsdl-org repository, applies a Cocoa GLES fix
only available in SDL3, installs it and tests sdl2-config.

Signed-off-by: Antonio Caggiano <[email protected]>
  • Loading branch information
Fahien committed Aug 17, 2023
1 parent 63ce18e commit 016486b
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions Formula/sdl2.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause

class Sdl2 < Formula
desc "Low-level access to audio, keyboard, mouse, joystick, and graphics"
homepage "https://github.com/libsdl-org/SDL"
url "https://github.com/libsdl-org/SDL.git", revision: "adf31f6ec0be0f9ba562889398f71172c7941023"
version "2.26.3"
license "Zlib"

depends_on "cmake" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => :build
depends_on "quic/quic/libepoxy"

# Cocoa GLES: do not unload EGL when context is destroy
patch :DATA

def install
mkdir "build" do
system "cmake", "-S..", "-B.", "-GNinja", *std_cmake_args
system "ninja", "-v"
system "ninja", "install", "-v"
end
end

test do
assert_match "2.26.3", shell_output("#{bin}/sdl2-config --version 2>&1")
end
end

__END__
diff --git a/src/video/cocoa/SDL_cocoaopengles.m b/src/video/cocoa/SDL_cocoaopengles.m
index 3efcb4756..2dffe7d99 100644
--- a/src/video/cocoa/SDL_cocoaopengles.m
+++ b/src/video/cocoa/SDL_cocoaopengles.m
@@ -95,7 +95,6 @@ Cocoa_GLES_DeleteContext(_THIS, SDL_GLContext context)
{ @autoreleasepool
{
SDL_EGL_DeleteContext(_this, context);
- Cocoa_GLES_UnloadLibrary(_this);
}}

int

0 comments on commit 016486b

Please sign in to comment.