From eb0a314adbde1c2b28b7ecdb40ed6bdde3e8ee92 Mon Sep 17 00:00:00 2001 From: igo95862 Date: Wed, 11 Aug 2021 22:53:45 +0300 Subject: [PATCH 1/3] Initial implementation of meson build system. Commands to compile: * Setup build directory: `meson setup --buildtype=release build` * Switch to build directory: `cd build` * Use `ninja` to compile. Compiled executable will be in the build directory * Optionally install it in to the system: `ninja install` * To uninstall: `ninja uninstall` --- meson.build | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 meson.build diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..85ebc00 --- /dev/null +++ b/meson.build @@ -0,0 +1,34 @@ +project('linux-hunter', 'cpp') + +linux_hunter_source = files( + 'src/events.h', + 'src/fdisplay.cpp', + 'src/fdisplay.h', + 'src/hashtext_fmt.h', + 'src/main.cpp', + 'src/memory.h', + 'src/mhw_lookup.cpp', + 'src/mhw_lookup.h', + 'src/mhw_lookup_monster.h', + 'src/offsets.h', + 'src/patterns.cpp', + 'src/patterns.h', + 'src/timer.h', + 'src/ui.cpp', + 'src/ui.h', + 'src/utils.cpp', + 'src/utils.h', + 'src/vbrush.h', + 'src/wdisplay.cpp', + 'src/wdisplay.h', + 'src/memory.cpp', +) + +notcurses_lib = dependency('ncursesw') + +executable( + 'linux-hunter', + linux_hunter_source, + dependencies : notcurses_lib, + install : true, +) From df6a27688c0f0cd8eba926bc321fff7d4cd1ed8b Mon Sep 17 00:00:00 2001 From: igo95862 Date: Sat, 14 Aug 2021 20:28:20 +0300 Subject: [PATCH 2/3] Add meson instructions to README --- README.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 43c1510..f2b2e26 100644 --- a/README.md +++ b/README.md @@ -163,8 +163,23 @@ in memory but hooking functions that the game uses to load the data. It may or m Unforutnately looks like CAPCOM and/or wine/Proton are protecting memory, hence this requires `sudo` access when running. ## How to build -You need to have `libncursesw5-dev` installed to compile (on Ubuntu is `sudo apt install libncursesw5-dev`) and that's it. -Once done, `make release` and you'll have your _linux-hunter_ ready to be running. + +### Requirements + +You need to have `libncurses-dev` installed to compile (on Ubuntu is `sudo apt install libncurses-dev`), meson build +system and C++ compiler. (for example, g++) + +### Build instructions + +_linux-hunter_ uses [Meson](https://mesonbuild.com/) build system. + +The generalized instructions to compile are following (ran from _linux-hunter_ source folder): + +1. Setup build folder: `meson setup --buildtype=release build` +1. Switch to build folder: `cd ./build` +1. Compile: `ninja` +1. Optionally install: `sudo ninja install` +1. To uninstall: `sudo ninja uninstall` ## How to run The most optimized way to run _linux-hunter_ would be `sudo ./linux-hunter -m`; this way you would start it using both low CPU and memory, plus displaying _monsters_ information. In this case _linux-hunter_ will try to find MH:W _pid_ (if this fails to find the pid, you can use the `--pid ` option). From 12f434ec27015ac16cb5cc8fe9267f184464c0b9 Mon Sep 17 00:00:00 2001 From: igo95862 Date: Sat, 14 Aug 2021 20:39:35 +0300 Subject: [PATCH 3/3] Added Github Actions CI --- .github/workflows/build.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..83ae833 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,22 @@ +--- + +name: Test build + +on: [push, pull_request] + +jobs: + test_build: + name: Build linux-hunter + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Update dependencies + run: | + sudo apt update + sudo apt install g++ meson libncurses-dev + - name: Compile + run: | + meson setup ./build + cd ./build + ninja + sudo ninja install