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 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). 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, +)