Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ build/
.cache
compile_commands.json
.ccls

# local helper script
copy.sh
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "third_party/subhook"]
path = third_party/subhook
url = https://github.com/Zeex/subhook.git
url = https://github.com/Dasharo/subhook.git
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.10)

project (DarkTanos)

set(API_VERSION 9)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
Expand All @@ -11,6 +13,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SUBHOOK_STATIC ON)
set(SUBHOOK_TESTS OFF)

include_directories(${CMAKE_SOURCE_DIR}/tools)

add_subdirectory(client/)
add_subdirectory(do_lib/)
Expand Down
109 changes: 109 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Tanos API lib build and test guide

## Goal
Build all required artifacts with one command:

```bash
./build.sh -b
```

Expected output files:

- `browser/dist/darkbot_browser_linux.AppImage`
- `build/client/DarkTanos.so`
- `build/do_lib/libdo_lib.so`

## Prerequisites (Linux)

- `cmake` and a C++ toolchain (`gcc/g++`, `make`)
- `strip` (usually from `binutils`)
- `nvm` installed (`~/.nvm/nvm.sh` must exist)
- Node.js version from `browser/.nvmrc` (the script runs `nvm use || nvm install`)
- `npm`

## Build libs + browser

From repo root:

```bash
./build.sh -b
```

What this does:

1. Builds browser AppImage in `browser/dist/`
2. Configures/builds CMake project in `build/`
3. Renames `build/client/libDarkTanos.so` to `build/client/DarkTanos.so`
4. Strips symbols from `DarkTanos.so` and `libdo_lib.so`
5. Runs `./copy.sh` automatically if that file exists and is executable

## Set executable permission for AppImage

```bash
chmod +x browser/dist/darkbot_browser_linux.AppImage
```

## Quick verification / smoke test

Check artifacts exist:

```bash
ls -lh \
browser/dist/darkbot_browser_linux.AppImage \
build/client/DarkTanos.so \
build/do_lib/libdo_lib.so
```

Check library dependencies resolve:

```bash
ldd build/client/DarkTanos.so
ldd build/do_lib/libdo_lib.so
```

Optional AppImage smoke check:

```bash
./browser/dist/darkbot_browser_linux.AppImage --appimage-version
```

## DarkBot build requirements

Your DarkBot base must be:

- Latest changes from: <https://github.com/darkbot-reloaded/DarkBot>
- Including PR: <https://github.com/darkbot-reloaded/DarkBot/pull/449>
- Including PR: <https://github.com/darkbot-reloaded/DarkBot/pull/448>
- Including PR: <https://github.com/darkbot-reloaded/DarkBot/pull/453>

After building, copy these files into your DarkBot `lib` directory:

- `browser/dist/darkbot_browser_linux.AppImage`
- `build/client/DarkTanos.so`
- `build/do_lib/libdo_lib.so`

You can copy them manually, or use `copy.sh` as described below.

### Important: prevent lib overwrite in DarkBot

In DarkBot `LibSetup`, disable/skip logic that overwrites these files in the bot `lib` directory:

- `DarkTanos.so`
- `libdo_lib.so`

This is required so your locally built versions remain in use.

## Optional copy helper

If you want automatic copy to your DarkBot `lib` folder after each build:

1. Copy `copy.sh.example` to `copy.sh`
2. Set destination path (`DEST`) in `copy.sh`
3. Make it executable:

```bash
cp copy.sh.example copy.sh
chmod +x copy.sh
```

Then `./build.sh -b` will copy artifacts automatically.
3 changes: 3 additions & 0 deletions browser/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

/node_modules
/dist
1 change: 1 addition & 0 deletions browser/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
Loading