Skip to content

Instantly share code, notes, and snippets.

@thatdutchguy
Created March 16, 2021 15:54
Show Gist options
  • Save thatdutchguy/1b77bdb7337fe485d340d8b405c673fc to your computer and use it in GitHub Desktop.
Save thatdutchguy/1b77bdb7337fe485d340d8b405c673fc to your computer and use it in GitHub Desktop.
Build Hatari emulator in SerenityOS
--- hatari-2.3.1/src/main.c 2020-12-26 13:39:26.000000000 -0800
+++ hatari-2.3.1-patched/src/main.c 2021-03-15 15:28:26.201725394 -0700
@@ -103,7 +103,7 @@
struct tms fields;
if (!ticks_to_msec)
{
- ticks_to_msec = sysconf(_SC_CLK_TCK);
+ ticks_to_msec = 100; // WAS: sysconf(_SC_CLK_TCK);
Log_Printf(LOG_INFO, "OS clock ticks / second: %d\n", ticks_to_msec);
/* Linux has 100Hz virtual clock so no accuracy loss there */
ticks_to_msec = 1000UL / ticks_to_msec;
#!/usr/bin/env -S bash ../.port_include.sh
port="hatari"
version="2.3.1"
files="https://git.tuxfamily.org/hatari/hatari.git/snapshot/hatari-${version}.tar.gz hatari-${version}.tar.gz"
useconfigure="true"
workdir="hatari-${version}"
depends="SDL2 zlib png"
_buildroot="${SERENITY_BUILD_DIR}/Root"
configure() {
run cmake \
-DUSE_BOOST=0 \
-DUSE_OPENGL=0 \
-DCMAKE_TOOLCHAIN_FILE="${SERENITY_ROOT}/Toolchain/CMakeToolchain.txt" \
-DSDL2_INCLUDE_DIR="${_buildroot}/usr/include/SDL2" \
-DSDL2_LIBRARY="SDL2" \
-DZLIB_INCLUDE_DIR="${_buildroot}/usr/local/include" \
-DZLIB_LIBRARY="z" \
-DMATH_INCLUDE_DIR="${_buildroot}/usr/include" \
-DMATH_LIBRARY="${_buildroot}/usr/lib" \
-DPNG_PNG_INCLUDE_DIR="${_buildroot}/usr/local/include" \
-DPNG_LIBRARY="png" \
-DCMAKE_EXE_LINKER_FLAGS="-lm -lpthread -lcore -lgfx -lgui"
}
install() {
run make install
}
@thatdutchguy
Copy link
Author

Display output seems slightly squashed for some reason:
hatari1
hatari2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment