docs(rtd): move documentation to read the docs

This commit is contained in:
Leroy Hopson 2024-03-29 19:07:43 +13:00
parent 4fec353509
commit 5ae8d6a982
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
45 changed files with 609 additions and 772 deletions

View file

@ -1,11 +1,3 @@
---
layout: default
title: Building From Source
parent: Setup
nav_order: 2
permalink: /setup/building-from-source
---
# Building From Source
Building GodotXterm from source consists of four steps:
@ -15,7 +7,9 @@ Building GodotXterm from source consists of four steps:
3. Compile godot-cpp using scons.
4. Compile libtsm and libgodotxterm using scons.
This plugin follows the same format as the [GDNative C++ Example](https://docs.godotengine.org/en/stable/tutorials/plugins/gdnative/gdnative-cpp-example.html). So if you can compile that example then you are 90% of the way there. The main difference is using CMake to compile libuv.
:::{hint}
This plugin follows the same format as the {{ '[GDNative C++ Example]({}/tutorials/plugins/gdnative/gdnative-cpp-example.html)'.format(godot_docs) }}. So if you can compile that example then you are 90% of the way there. The main difference is using CMake to compile libuv.
:::
## Dependencies
@ -28,31 +22,28 @@ This plugin follows the same format as the [GDNative C++ Example](https://docs.g
Run the build script in `addons/godot-xterm/native`:
```
```sh
cd addons/godot_xterm/native
./build.sh
```
On Windows you can use `git-bash` to run this script.
:::{tip}
On Windows, you can use `git-bash` to run this script.
Provided the dependencies above are installed then it should "just work™".
:::
Binaries for your platform will be installed in `addons/godot_xterm/native/bin`.
The [build.sh] script accepts args `--target` which can be set to `debug` (default) or `release` and `--disable-pty` to compile only the dependencies of [Terminal] node and not [PTY] node (even on platforms that support it).
The {{ '[build.sh]({}/addons/godot_xterm/native/build.sh)'.format(repo) }} script accepts args `--target` which can be set to `debug` (default) or `release` and `--disable-pty` to compile only the dependencies of {{Terminal}} node and not {{PTY}} node (even on platforms that support it).
### The Hard Way
## The Hard Way
If you are having trouble compiling, study the [build.sh] script and the GitHub actions workflow in [main.yml] to see what commands are being run and how dependencies are installed. You can also dig into the [SConstruct](https://github.com/lihop/godot-xterm/blob/stable/addons/godot_xterm/native/SConstruct) file, and don't forget to refer back to the [GDNative C++ Example](https://docs.godotengine.org/en/stable/tutorials/plugins/gdnative/gdnative-cpp-example.html).
If you are having trouble compiling, study the {{ '[build.sh]({}/addons/godot_xterm/native/build.sh)'.format(repo) }} script and the GitHub actions workflow in {{ [main.yml]({}/.github/workflows/main.yml)'.format(repo) }} to see what commands are being run and how dependencies are installed. You can also dig into the {{ '[SConstruct]({}/addons/godot_xterm/native/SConstruct)'.format(repo) }} file, and don't forget to refer back to the {{ '[GDNative C++ Example]({}/tutorials/plugins/gdnative/gdnative-cpp-example.html)'.format(godot_docs) }}.
Also feel free to open a new discussion in the [discussions](https://github.com/lihop/godot-xterm/discussions) section of this project.
Also feel free to open a new discussion in the [discussions](https://github.com/lihop/godot-xterm/discussions) section of the project repo.
## Cross Compiling
Although the SConstruct file contains some logic for cross-compiling, it has never been tested. If you want compile for other platforms consider forking this repo and then pushing your changes to GitHub. The workflow defined in [main.yml] will run and build the library for all supported platforms (Linux, macOS, Windows, and HTML5).
Although the SConstruct file contains some logic for cross-compiling, it has never been tested. If you want compile for other platforms consider forking this repo and then pushing your changes to GitHub. The workflow defined in {{ '[main.yml]({}/.github/workflows/main.yml)'.format(repo) }} will run and build the library for all supported platforms (Linux, macOS, Windows, and HTML5).
Additionally, If you have `docker` and `docker-compose` installed, the [build.sh] script will also try to build the HTML5 binary inside a docker container and copy them to `addons/godot_xterm/native/bin`.
[PTY]: /api/pty
[Terminal]: /api/terminal
[build.sh]: https://github.com/lihop/godot-xterm/blob/stable/addons/godot_xterm/native/build.sh
[main.yml]: https://github.com/lihop/godot-xterm/blob/stable/.github/workflows/main.yml
Additionally, If you have `docker` and `docker-compose` installed, the {{ '[build.sh]({}/addons/godot_xterm/native/build.sh)'.format(repo) }} script will also try to build the HTML5 binary inside a docker container and copy them to `addons/godot_xterm/native/bin`.