summaryrefslogtreecommitdiff
path: root/ports/doom
diff options
context:
space:
mode:
Diffstat (limited to 'ports/doom')
-rw-r--r--ports/doom/files/doomgeneric_camellia.c (renamed from ports/doom)33
-rw-r--r--ports/doom/patches/0-wad-dir.patch8
-rwxr-xr-xports/doom/port32
-rw-r--r--ports/doom/sha256sums2
4 files changed, 47 insertions, 28 deletions
diff --git a/ports/doom b/ports/doom/files/doomgeneric_camellia.c
index 7ef03dd..3fe6032 100644
--- a/ports/doom
+++ b/ports/doom/files/doomgeneric_camellia.c
@@ -1,19 +1,3 @@
-set -eu
-camellia_path_check
-
-fetch() {
- git clone https://github.com/ozkl/doomgeneric
- cd doomgeneric
- # TODO use a newer commit
- git -c advice.detachedHead=false checkout ee3ee581912dacd38af06e81da2374c1267453e8
-
- cd doomgeneric
- rm doomgeneric # a leftover OS X binary
- sed s/xlib/camellia/ -i Makefile
- sed s/-lX11// -i Makefile
- echo note: you need to supply your own WADs
-
- cat <<\EOF > doomgeneric_camellia.c
#include <camellia/syscalls.h>
#include <shared/ring.h>
#include <stdbool.h>
@@ -135,17 +119,10 @@ int DG_GetKey(int *pressed, unsigned char *key) {
void DG_SetWindowTitle(const char *title) {
(void)title;
}
-EOF
-}
-prep() {
- [ -d doomgeneric ] || (fetch)
- cd doomgeneric/doomgeneric
+int main(int argc, char **argv) {
+ doomgeneric_Create(argc, argv);
+ for (;;) {
+ doomgeneric_Tick();
+ }
}
-
-case $1 in
- install) (prep; make "CC=x86_64-camellia-gcc" && cp doomgeneric $PREFIX/bin/doom && cp *.WAD $PREFIX/) ;;
- clean) (prep; make clean) ;;
- deepclean) (rm -rf doomgeneric) ;;
- *) echo "usage: $0 install|clean"; false ;;
-esac
diff --git a/ports/doom/patches/0-wad-dir.patch b/ports/doom/patches/0-wad-dir.patch
new file mode 100644
index 0000000..85db2e6
--- /dev/null
+++ b/ports/doom/patches/0-wad-dir.patch
@@ -0,0 +1,8 @@
+--- config.h.orig 2023-06-24 22:10:06.945656877 +0200
++++ config.h 2023-06-24 22:11:54.456841542 +0200
+@@ -97,4 +97,4 @@
+ #undef ORIGCODE
+
+ /* Define to the directory where all game files are located */
+-#define FILES_DIR "."
++#define FILES_DIR "/usr/share/games/doom/"
diff --git a/ports/doom/port b/ports/doom/port
new file mode 100755
index 0000000..c747b77
--- /dev/null
+++ b/ports/doom/port
@@ -0,0 +1,32 @@
+#!/bin/sh
+. ports/pre
+
+pkg=doom
+tarball=ozkl-doomgeneric-613f870.tar.gz
+tarball_dir=ozkl-doomgeneric-613f870/doomgeneric
+url=https://github.com/ozkl/doomgeneric/tarball/613f870b6fa83ede448a247de5a2571092fa729d
+
+extra_files=https://github.com/freedoom/freedoom/releases/download/v0.12.1/freedoom-0.12.1.zip
+
+post_patch() {
+ sed s/xlib/camellia/ -i $tarball_dir/Makefile
+ sed s/-lX11// -i $tarball_dir/Makefile
+}
+
+post_unpack() {
+ unzip $downdir/freedoom-0.12.1.zip
+}
+
+install() {
+ # no make install target
+ build
+ mkdir -p $DESTDIR/usr/bin/ $DESTDIR/usr/share/games/doom/
+ cp $tarball_dir/doomgeneric $DESTDIR/usr/bin/doom
+ cp freedoom-0.12.1/freedoom1.wad $DESTDIR/usr/share/games/doom/
+}
+
+relink() {
+ rm $tarball_dir/doomgeneric
+}
+
+. ports/post
diff --git a/ports/doom/sha256sums b/ports/doom/sha256sums
new file mode 100644
index 0000000..fc1594e
--- /dev/null
+++ b/ports/doom/sha256sums
@@ -0,0 +1,2 @@
+07bd8aaf2f3c8b5cb9642de60689834524651fe50d87cf00eed1cd7c716e4dd7 ozkl-doomgeneric-613f870.tar.gz
+f42c6810fc89b0282de1466c2c9c7c9818031a8d556256a6db1b69f6a77b5806 freedoom-0.12.1.zip