summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2021-04-01 12:07:45 +0200
committerAndreas Kling <kling@serenityos.org>2021-04-01 20:55:32 +0200
commit8324e48218ba80cea3d8e1aedc5311792ff72b49 (patch)
tree228314e3e426d200157dd878e2d7f8ad7a7c2424
parent4e2d4b193aae8214c2dc7d1b86a5805094190cc2 (diff)
downloadserenity-8324e48218ba80cea3d8e1aedc5311792ff72b49.zip
Ports: Added a SDL2_image port
-rw-r--r--Ports/AvailablePorts.md1
-rwxr-xr-xPorts/SDL2_image/package.sh23
-rw-r--r--Ports/SDL2_image/patches/configure.patch11
3 files changed, 35 insertions, 0 deletions
diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md
index 6a76481168..956961fa77 100644
--- a/Ports/AvailablePorts.md
+++ b/Ports/AvailablePorts.md
@@ -71,6 +71,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^
| [`quake`](quake/) | Quake | 0.65 | https://github.com/SerenityOS/SerenityQuake |
| [`rsync`](rsync/) | rsync | 3.1.3 | https://rsync.samba.org/ |
| [`SDL2`](SDL2/) | Simple DirectMedia Layer (SDL2) | | https://github.com/SerenityOS/SDL |
+| [`SDL2_image`](SDL2_image/) | SDL2\_image (Image loading add-on for SDL2) | 2.0.5 | https://www.libsdl.org/projects/SDL_image/ |
| [`SDL2_mixer`](SDL2_mixer/) | SDL2\_mixer (audio mixer add-on for SDL2) | 2.0.4 | https://www.libsdl.org/projects/SDL_mixer/ |
| [`SDL2_ttf`](SDL2_ttf/) | SDL2\_ttf (TrueType Font add-on for SDL2) | 2.0.15 | https://www.libsdl.org/projects/SDL_ttf/ |
| [`sed`](sed/) | GNU sed | 4.2.1 | https://www.gnu.org/software/sed/ |
diff --git a/Ports/SDL2_image/package.sh b/Ports/SDL2_image/package.sh
new file mode 100755
index 0000000000..72e02d385e
--- /dev/null
+++ b/Ports/SDL2_image/package.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env -S bash ../.port_include.sh
+port=SDL2_image
+useconfigure=true
+version=2.0.5
+depends="SDL2 libpng libjpeg"
+files="https://www.libsdl.org/projects/SDL_image/release/SDL2_image-${version}.tar.gz SDL_image-${version}.tar.gz"
+
+configure() {
+ run ./configure \
+ --host="${SERENITY_ARCH}-pc-serenity" \
+ --with-sdl-prefix="${SERENITY_BUILD_DIR}/Root/usr" \
+ --prefix="/usr" \
+ --enable-webp=false --enable-webp-shared=false \
+ LDFLAGS="-lgui -lgfx -lipc -lcore -lm"
+}
+
+build() {
+ run make -k
+}
+
+install() {
+ run make -k DESTDIR="${SERENITY_BUILD_DIR}/Root" install
+}
diff --git a/Ports/SDL2_image/patches/configure.patch b/Ports/SDL2_image/patches/configure.patch
new file mode 100644
index 0000000000..01da8b81ae
--- /dev/null
+++ b/Ports/SDL2_image/patches/configure.patch
@@ -0,0 +1,11 @@
+--- SDL2_image-2.0.5/config.sub 2019-06-30 06:52:03.000000000 +0200
++++ /home/baitinq/serenity/Ports/SDL2_image-2.0.5/config.sub 2021-04-01 01:55:57.769997556 +0200
+@@ -1363,7 +1363,7 @@
+ # The portable systems comes first.
+ # Each alternative MUST end in a * to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
++ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -serenity* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+ | -sym* | -kopensolaris* | -plan9* \