summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrendan Coles <bcoles@gmail.com>2021-10-28 11:27:43 +0000
committerAndreas Kling <kling@serenityos.org>2021-10-31 11:52:27 +0100
commit3ce4d0f89a9dccc760cdcbced20f381da5625bb2 (patch)
tree40489dcaffb5a97b1e143d1ab966c4bfbc5f9544
parent287bbabbc1b7f0e7bd06a13c2d65144f6d12712b (diff)
downloadserenity-3ce4d0f89a9dccc760cdcbced20f381da5625bb2.zip
Ports: Add FreeDink port
-rw-r--r--Ports/AvailablePorts.md1
-rwxr-xr-xPorts/freedink/package.sh29
-rw-r--r--Ports/freedink/patches/config.sub.patch10
-rw-r--r--Ports/freedink/patches/input.cpp.patch13
4 files changed, 53 insertions, 0 deletions
diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md
index 0b8596c68c..27c6eae5b5 100644
--- a/Ports/AvailablePorts.md
+++ b/Ports/AvailablePorts.md
@@ -41,6 +41,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^
| [`fontconfig`](fontconfig/) | Fontconfig | 2.13.94 | https://www.freedesktop.org/wiki/Software/fontconfig/ |
| [`ffmpeg`](ffmpeg/) | ffmpeg | 4.4 | https://ffmpeg.org |
| [`freeciv`](freeciv/) | Freeciv | 3.0.0-beta2 | http://freeciv.org/ |
+| [`freedink`](freedink/) | FreeDink | 109.6 | https://www.gnu.org/software/freedink/ |
| [`freetype`](freetype/) | FreeType | 2.10.4 | https://www.freetype.org/ |
| [`frotz`](frotz/) | Frotz | 2.53 | https://gitlab.com/DavidGriffith/frotz |
| [`gawk`](gawk/) | GNU awk | 5.1.0 | https://www.gnu.org/software/gawk/ |
diff --git a/Ports/freedink/package.sh b/Ports/freedink/package.sh
new file mode 100755
index 0000000000..76cce7697d
--- /dev/null
+++ b/Ports/freedink/package.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env -S bash ../.port_include.sh
+port=FreeDink
+version=109.6
+useconfigure="true"
+depends=("SDL2" "SDL2_image" "SDL2_mixer" "SDL2_ttf" "SDL2_gfx" "gettext" "fontconfig" "glm")
+workdir="freedink-${version}"
+freedink_data="freedink-data-1.08.20190120"
+files="https://ftpmirror.gnu.org/gnu/freedink/freedink-${version}.tar.gz freedink-${version}.tar.gz
+https://ftpmirror.gnu.org/gnu/freedink/freedink-${version}.tar.gz.sig freedink-${version}.tar.gz.sig
+https://ftpmirror.gnu.org/gnu/freedink/${freedink_data}.tar.gz ${freedink_data}.tar.gz 715f44773b05b73a9ec9b62b0e152f3f281be1a1512fbaaa386176da94cffb9d
+https://ftpmirror.gnu.org/gnu/gnu-keyring.gpg gnu-keyring.gpg"
+auth_type="sig"
+auth_opts=("--keyring" "./gnu-keyring.gpg" "freedink-${version}.tar.gz.sig")
+configopts=("--prefix=/usr/local" "--disable-rpath" "--disable-tests" "LDFLAGS=-ldl -lfontconfig -lxml2")
+
+resource_path="/usr/local/share/games/dink"
+
+launcher_name="FreeDink"
+launcher_category=Games
+launcher_command="/usr/local/bin/freedink --software-rendering --truecolor --refdir ${resource_path}"
+
+install() {
+ target_dir="${SERENITY_INSTALL_ROOT}${resource_path}"
+ run_nocd mkdir -p ${target_dir}
+ run_nocd tar zxvf ${freedink_data}.tar.gz
+ run_nocd cp -R ${freedink_data}/* ${target_dir}
+}
+
+export CPPFLAGS="-I${SERENITY_INSTALL_ROOT}/usr/local/include/SDL2 -I${SERENITY_INSTALL_ROOT}/usr/local/include/libxml2"
diff --git a/Ports/freedink/patches/config.sub.patch b/Ports/freedink/patches/config.sub.patch
new file mode 100644
index 0000000000..4baa75088c
--- /dev/null
+++ b/Ports/freedink/patches/config.sub.patch
@@ -0,0 +1,10 @@
+--- freedink-109.6/autotools/config.sub 2018-03-01 08:34:41.000000000 -0800
++++ freedink-109.6/autotools/config.sub 2021-04-09 10:52:45.687169960 -0700
+@@ -1409,6 +1409,7 @@
+ # 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* \
++ | -serenity* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+ | -sym* | -kopensolaris* | -plan9* \
diff --git a/Ports/freedink/patches/input.cpp.patch b/Ports/freedink/patches/input.cpp.patch
new file mode 100644
index 0000000000..8335a217a1
--- /dev/null
+++ b/Ports/freedink/patches/input.cpp.patch
@@ -0,0 +1,13 @@
+--- freedink-109.6/src/input.cpp 2021-10-24 21:47:29.904647862 -0700
++++ freedink-109.6/src/input.cpp 2021-10-24 21:47:32.528649774 -0700
+@@ -89,10 +89,6 @@
+ // It also keeps the mouse within the window in software mode.
+ SDL_SetHint(SDL_HINT_MOUSE_RELATIVE_MODE_WARP, "1");
+
+- // TODO: don't attempt to simulate mouse events from touch events -
+- // fake mouse events often are de-centered
+- SDL_SetHint(SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH, "0");
+-
+ /* Touch devices */
+ {
+ int i;