mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-06 20:55:31 +02:00
Update CHANGELOG, README and bump version
This commit is contained in:
parent
6689ad1c09
commit
bdbc82e444
4 changed files with 94 additions and 47 deletions
114
README.md
114
README.md
|
@ -17,58 +17,96 @@ Terminal emulator for Godot using GDNative and [libtsm](https://github.com/Aetf/
|
|||
|
||||
### Confirmed:
|
||||
- Linux 64-bit (primarily developed/tested on this platform)
|
||||
- Linux 32-bit
|
||||
- MacOS 64-bit
|
||||
- Windows 64-bit
|
||||
|
||||
### Planned/untested:
|
||||
- Linux 32-bit
|
||||
- Windows 32-bit
|
||||
- MacOS 64-bit
|
||||
|
||||
## Building
|
||||
## Setup
|
||||
|
||||
**Important**: It is recommended that you build the native binaries before opening this demo project, otherwise the Godot editor will automatically modify the example scenes when it can't find the native libs, such that they won't work when the files _are_ in place.
|
||||
|
||||
If you prefer not to build your own binaries from source, there are some pre-compiled release binaries in the [dist] directory.
|
||||
They can be copied to the correct location by:
|
||||
To install, copy (or symlink) the `addons/godot_xterm` directory in this repo to the `addons` directory of your Godot project. You will then need to setup the gdnative components, by either downloading the precompiled binaries or building from source.
|
||||
|
||||
**Note**: If you are running the demo project, it is recommended that you build or install the gdnative binaries before opening it, otherwise the Godot editor will disconnect some signals when it fails to find the gdnative nodes meaning that the project won't run correctly when they _are_ installed. If in doubt, use `git status` to see if any of the `.tscn` files have been changed automatically by the editor.
|
||||
|
||||
### Precompiled Binaries
|
||||
|
||||
Precompiled binaries can be downloaded from the GitHub releases page. Download the `bin.zip` file and extract it to the `addons/godot_xterm/native/bin` directory. This will install the gdnative libraries for all supported platforms.
|
||||
After extracting the zip file, the directory should contain the following:
|
||||
- `libgodot-xterm.linux.64.so`
|
||||
- `libgodot-xterm.linux.32.so`
|
||||
- `libgodot-xterm.osx.64.dylib`
|
||||
- `libgodot-xterm.windows.64.dll`
|
||||
|
||||
### Building From Source
|
||||
This plugin follows the standard format of a GDNative plugin as shown in [GDNative C++ Example](https://docs.godotengine.org/en/stable/tutorials/plugins/gdnative/gdnative-cpp-example.html), including the use of the SCons build tool.
|
||||
Therefore, referring to the following documentation on compiling a GDNative plugin and compiling the Godot engine itself may be useful:
|
||||
- [GDNative C++ Example: Compiling the plugin](https://docs.godotengine.org/en/stable/tutorials/plugins/gdnative/gdnative-cpp-example.html#compiling-the-plugin).
|
||||
- [Compiling for X11 (Linux, \*BSD)](https://docs.godotengine.org/en/stable/development/compiling/compiling_for_x11.html)
|
||||
- [Compiling for macOS](https://docs.godotengine.org/en/stable/development/compiling/compiling_for_osx.html)
|
||||
- [Compiling for Windows](https://docs.godotengine.org/en/stable/development/compiling/compiling_for_windows.html)
|
||||
|
||||
#### Dependencies
|
||||
This plugin does not have any special dependencies beyond those used to compile Godot or the GDNative C++ example. If you can compile those then you should be able to compile this plugin. When in doubt, see the documentation above.
|
||||
The main dependencies are:
|
||||
- [Git](https://git-scm.com/) (to clone git submodules)
|
||||
- [SCons](https://scons.org/) (a software construction tool)
|
||||
- A C/C++ compiler (i.e. [gcc](https://gcc.gnu.org/), [llvm](https://llvm.org/), [MSVC](https://visualstudio.microsoft.com/vs/features/cplusplus/))
|
||||
|
||||
**Note**: If you are cross-compiling, then you will likely need other dependencies than those listed below.
|
||||
|
||||
##### Linux
|
||||
|
||||
| Distribution | Command |
|
||||
-------------------|--------------------------------------------------|
|
||||
NixOS | `nix-env -iA nixpkgs.git nixpkgs.scons` |
|
||||
Arch Linux | `pacman -S --needed git scons base-devel` |
|
||||
Ubuntu | `sudo apt-get install git scons build-essential` |
|
||||
|
||||
##### MacOS
|
||||
If [Homebrew](https://brew.sh/) is installed then you should already have llvm and git. In this case you simply need to install scons with:
|
||||
```
|
||||
cd addons/godot_xterm/native
|
||||
cp -rf dist/* bin/
|
||||
brew install scons
|
||||
```
|
||||
|
||||
### All Operating Systems
|
||||
|
||||
You will need at least these dependencies in order to build this plugin:
|
||||
- Git (for git submodules)
|
||||
- a C++ compiler (e.g. gcc)
|
||||
- ar (part of GNU Binutils)
|
||||
- CMake
|
||||
- Python
|
||||
- SCons
|
||||
|
||||
### Linux
|
||||
|
||||
#### NixOS
|
||||
You can simply run the [build.sh] script in the `addons/godot_xterm/native` directory:
|
||||
##### Windows
|
||||
You will need to have Git and Microsoft Visual Studio installed with C++ tools (compiling using mingw is not yet supported).
|
||||
If you have the [chocolatey](https://chocolatey.org/) package manager, you can install scons with:
|
||||
```
|
||||
addons/godot_xterm/native/build.sh
|
||||
```
|
||||
All dependencies will be pulled in by nix-shell and the build steps will run.
|
||||
|
||||
#### Arch Linux and Ubuntu
|
||||
See the [Arch Linux Dockerfile](dockerfiles/archlinux) and [Ubuntu Dockerfile](dockerfiles/ubuntu) for a list of packages that need to be installed. Once installed, run the [build.sh] script in the `addons/godot_xterm/native` directory:
|
||||
```
|
||||
addons/godot_xterm/native/build.sh
|
||||
choco install python3 && python -m pip install scons
|
||||
```
|
||||
|
||||
#### Other Linux Distributions
|
||||
Will probably be similar to the above. When in doubt check the documentation in the submodule repos, the [build.sh] script, and the [SConstruct] file.
|
||||
#### Steps
|
||||
|
||||
### Windows
|
||||
Compiling on Windows for 64-bit is supported using [Visual Studio Community](https://visualstudio.microsoft.com/vs/community/) version 2019, although other versions might work. See the [Godot documentation](https://docs.godotengine.org/en/stable/development/compiling/compiling_for_windows.html) for more information on setting up the development environment.
|
||||
See the [github workflow file](.github/workflows/main.yml) for the commands that can be used to build the native libraries.
|
||||
The [build.sh] script in `addons/godot_xterm/native` is provided for convenience and can be used on Linux to perform the steps below using the default scons options. On NixOS it will use the `shell.nix` file in the same directory to bring in all dependencies to the build environment.
|
||||
|
||||
### Other Operating Systems
|
||||
This plugin is not currently supported for other operating systems (i.e. MacOS). If you manage to build it on a different platform, please submit a PR for this readme.
|
||||
##### 1. Clone Git Submodules
|
||||
This step only needs to be performed once and will clone the git repos this plugin depends on to `addons/godot_xterm/native/external`.
|
||||
```
|
||||
# In the top-level directory of this git repo...
|
||||
git submodule update --init --recursive
|
||||
```
|
||||
|
||||
##### 2. Build C++ Bindings
|
||||
This step only needs to be performed once per platform/target/bits combination your are targeting, and possibly more if you are targeting different versions of Godot. See [GDNative C++ Example: Building the C++ bindings](https://docs.godotengine.org/en/stable/tutorials/plugins/gdnative/gdnative-cpp-example.html#building-the-c-bindings) for more info.
|
||||
```
|
||||
# From the top-level directory of this git repo...
|
||||
cd addons/godot_xterm/native/external/godot-cpp
|
||||
scons platform=<platform> target=<target> bits=<bits> generate_bindings=yes
|
||||
```
|
||||
Where `<platform>` is one of `linux`, `osx` or `windows`, `<target>` is one of `release` or `debug` and `<bits>` is one of `32` or `64`.
|
||||
The `generate_bindings=yes` option is essential.
|
||||
|
||||
##### 3. Build GodotXterm
|
||||
This step needs to be performed every time the code of this plugin in `src/` or `external/libtsm` is modified.
|
||||
```
|
||||
cd ../../ # If following from the directory of the previous step.
|
||||
# In addons/godot_xterm/native.
|
||||
scons platform=<platform> target=<target> bits=<bits>
|
||||
```
|
||||
The same options should be used as in the previous step. If the options are omitted, scons will auto-detect the platform and architecture of the current machine and `target` will default to `debug`.
|
||||
|
||||
## Usage
|
||||
|
||||
|
@ -76,7 +114,7 @@ This plugin is not currently supported for other operating systems (i.e. MacOS).
|
|||
The main node provided by this plugin.
|
||||
|
||||
- ### [Pseudoterminal](addons/godot_xterm/nodes/pseudoterminal/README.md)
|
||||
A node that can be used to connect the Terminal to a shell. Currently Linux only.
|
||||
A node that can be used to connect the Terminal to a shell. Currently Linux and MacOS only.
|
||||
|
||||
An example of how to use this node with a Terminal can be found in the [terminal scene](examples/terminal).
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue