Skip to content

Commit 541d7a8

Browse files
committed
sdl3_image 3.2.0 (new formula)
1 parent e088356 commit 541d7a8

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

Formula/s/sdl3_image.rb

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
depends_on "cmake" => :build
10+
depends_on "pkgconf" => :build
11+
depends_on "jpeg-turbo"
12+
depends_on "jpeg-xl"
13+
depends_on "libavif"
14+
depends_on "libpng"
15+
depends_on "libtiff"
16+
depends_on "sdl3"
17+
depends_on "webp"
18+
19+
uses_from_macos "perl" => :build
20+
21+
def install
22+
system "cmake", "-S", ".",
23+
"-B", "build",
24+
"-DSDLIMAGE_BACKEND_IMAGEIO=OFF",
25+
"-DSDLIMAGE_BACKEND_STB=OFF",
26+
"-DSDLIMAGE_DEPS_SHARED=OFF",
27+
"-DSDLIMAGE_INSTALL_MAN=ON",
28+
"-DSDLIMAGE_JXL=ON",
29+
"-DSDLIMAGE_STRICT=ON",
30+
"-DSDLIMAGE_SAMPLES=OFF",
31+
"-DSDLIMAGE_TESTS=OFF",
32+
*std_cmake_args
33+
system "cmake", "--build", "build"
34+
system "cmake", "--install", "build"
35+
end
36+
37+
test do
38+
(testpath/"test.c").write <<~C
39+
#include <SDL3_image/SDL_image.h>
40+
#include <stdlib.h>
41+
42+
int main() {
43+
return IMG_Version() == SDL_IMAGE_VERSION ? EXIT_SUCCESS : EXIT_FAILURE;
44+
}
45+
C
46+
system ENV.cc, "test.c", "-I#{Formula["sdl3"].opt_include}", "-L#{lib}", "-lSDL3_image", "-o", "test"
47+
system "./test"
48+
end
49+
end

0 commit comments

Comments
 (0)