Skip to content

Commit 3993539

Browse files
authored
Merge pull request #206275 from FtZPetruska/sdl3_image
sdl3_image 3.2.0 (new formula)
2 parents a46fee3 + 550d140 commit 3993539

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

Formula/s/sdl3_image.rb

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
class Sdl3Image < Formula
2+
desc "Library for loading images as SDL surfaces and textures"
3+
homepage "https://github.com/libsdl-org/SDL_image"
4+
url "https://github.com/libsdl-org/SDL_image/releases/download/release-3.2.0/SDL3_image-3.2.0.tar.gz"
5+
sha256 "1690baea71b2b4ded9895126cddbc03a1000b027d099a4fb4669c4d23d73b19f"
6+
license "Zlib"
7+
head "https://github.com/libsdl-org/SDL_image.git", branch: "main"
8+
9+
bottle do
10+
sha256 cellar: :any, arm64_sequoia: "7b4a40bd5b49da068f9f7b1aa6416ea1608435a6b962880d1f4005b3c12c63c3"
11+
sha256 cellar: :any, arm64_sonoma: "ce64145b5f82c159ee9791c5bdb8a2d44090b3de8851f8454458f8b2124c43cb"
12+
sha256 cellar: :any, arm64_ventura: "b2576e6ef14d01ef979668451f3894258e3f4ec10620f974cf276f06a1a6a49c"
13+
sha256 cellar: :any, sonoma: "0a5582939101f4c5fddc3cc4a17f288778a55b18164412b059c9fc503bcaf752"
14+
sha256 cellar: :any, ventura: "5db9220c012cc50214d03950d86eab0aca7d529387e3119706fc66216def2ff2"
15+
sha256 cellar: :any_skip_relocation, x86_64_linux: "7a4806be12a2ccd946d99cdfdf6ed5022ee19a35091da9222845cae2e1bceb23"
16+
end
17+
18+
depends_on "cmake" => :build
19+
depends_on "pkgconf" => :build
20+
depends_on "jpeg-turbo"
21+
depends_on "jpeg-xl"
22+
depends_on "libavif"
23+
depends_on "libpng"
24+
depends_on "libtiff"
25+
depends_on "sdl3"
26+
depends_on "webp"
27+
28+
uses_from_macos "perl" => :build
29+
30+
def install
31+
system "cmake", "-S", ".",
32+
"-B", "build",
33+
"-DSDLIMAGE_BACKEND_IMAGEIO=OFF",
34+
"-DSDLIMAGE_BACKEND_STB=OFF",
35+
"-DSDLIMAGE_DEPS_SHARED=OFF",
36+
"-DSDLIMAGE_INSTALL_MAN=ON",
37+
"-DSDLIMAGE_JXL=ON",
38+
"-DSDLIMAGE_STRICT=ON",
39+
"-DSDLIMAGE_SAMPLES=OFF",
40+
"-DSDLIMAGE_TESTS=OFF",
41+
*std_cmake_args
42+
system "cmake", "--build", "build"
43+
system "cmake", "--install", "build"
44+
end
45+
46+
test do
47+
(testpath/"test.c").write <<~C
48+
#include <SDL3_image/SDL_image.h>
49+
#include <stdlib.h>
50+
51+
int main() {
52+
return IMG_Version() == SDL_IMAGE_VERSION ? EXIT_SUCCESS : EXIT_FAILURE;
53+
}
54+
C
55+
system ENV.cc, "test.c", "-I#{Formula["sdl3"].opt_include}", "-L#{lib}", "-lSDL3_image", "-o", "test"
56+
system "./test"
57+
end
58+
end

0 commit comments

Comments
 (0)