summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Ports/AvailablePorts.md1
-rwxr-xr-xPorts/sam/package.sh14
-rw-r--r--Ports/sam/patches/sam.patch28
3 files changed, 43 insertions, 0 deletions
diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md
index c9622fc070..546d7a64c0 100644
--- a/Ports/AvailablePorts.md
+++ b/Ports/AvailablePorts.md
@@ -112,6 +112,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^
| [`quake2`](quake2/) | QuakeII | 0.1 | https://github.com/SerenityOS/SerenityQuakeII |
| [`readline`](readline/) | GNU Readline Library | 8.1 | https://tiswww.case.edu/php/chet/readline/rltop.html |
| [`rsync`](rsync/) | rsync | 3.1.3 | https://rsync.samba.org/ |
+| [`sam`](sam/) | Software Automatic Mouth (SAM) | c86ea39 | https://github.com/vidarh/SAM |
| [`scummvm`](scummvm/) | ScummVM | 2.2.0 | https://www.scummvm.org/ |
| [`SDL2`](SDL2/) | Simple DirectMedia Layer (SDL2) | | https://github.com/SerenityOS/SDL |
| [`SDL2-GNUBoy`](SDL2-GNUBoy/) | SDL2 GNUBoy | 1.2 | https://github.com/AlexOberhofer/SDL2-GNUBoy |
diff --git a/Ports/sam/package.sh b/Ports/sam/package.sh
new file mode 100755
index 0000000000..8d57e91e10
--- /dev/null
+++ b/Ports/sam/package.sh
@@ -0,0 +1,14 @@
+#!/usr/bin/env -S bash ../.port_include.sh
+port=SAM
+version=c86ea395743b8ea4ad071c2167fd1f7f96648f7b
+files="https://github.com/vidarh/SAM/archive/${version}.tar.gz ${version}.tar.gz 1f534245e2c7a096de5f886fd96ea1ad966c4e674c1ed91e0c6a59662e8d6c11"
+auth_type=sha256
+depends="SDL2"
+
+build() {
+ run make CC="${CC}"
+}
+
+install() {
+ run cp sam "${SERENITY_INSTALL_ROOT}/usr/local/bin/sam"
+}
diff --git a/Ports/sam/patches/sam.patch b/Ports/sam/patches/sam.patch
new file mode 100644
index 0000000000..e09df7da30
--- /dev/null
+++ b/Ports/sam/patches/sam.patch
@@ -0,0 +1,28 @@
+diff --git a/Makefile b/Makefile
+index 1153e0c..9c70190 100644
+--- a/Makefile
++++ b/Makefile
+@@ -3,8 +3,8 @@ OBJS = reciter.o sam.o render.o main.o debug.o processframes.o createtransitions
+ CC = gcc
+
+ # libsdl present
+-CFLAGS = -Wall -O2 -DUSESDL `sdl-config --cflags`
+-LFLAGS = `sdl-config --libs`
++CFLAGS = -Wall -O2 -DUSESDL -I../../SDL2/SDL-main-serenity/include -D_REENTRANT
++LFLAGS = -L../../SDL2 -lSDL2
+
+ # no libsdl present
+ #CFLAGS = -Wall -O2
+diff --git a/src/main.c b/src/main.c
+index 3e8fdde..3432fe8 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -14,7 +14,7 @@
+
+
+ // Approximations of some Windows functions to ease portability
+-#if defined __GNU_LIBRARY__ || defined __GLIBC__
++#if defined __GNU_LIBRARY__ || defined __GLIBC__ || defined __serenity__
+ static int min(int l, int r) { return l < r ? l : r; }
+ static void strcat_s(char * dest, int size, char * str) {
+ unsigned int dlen = strlen(dest);