diff --git a/README.md b/README.md index ed6f2f85..e3496417 100644 --- a/README.md +++ b/README.md @@ -50,8 +50,9 @@ A simple cross-platform C++ library for terminal based user interfaces! - [Conan](https://conan.io/center/recipes/ftxui) [Debian package](https://tracker.debian.org/pkg/ftxui) - [Ubuntu package](https://launchpad.net/ubuntu/+source/ftxui) - [Arch Linux](https://aur.archlinux.org/packages/ftxui/) - - [OpenSUSE](https://build.opensuse.org/package/show/devel:libraries:c_c++/ftxui) - - [XMake](https://xmake.io) repository [package](https://github.com/xmake-io/xmake-repo/blob/dev/packages/f/ftxui/xmake.lua) + - [OpenSUSE](https://build.opensuse.org/package/show/devel:libraries:c_c++/ftxui) + - [XMake](https://xmake.io) repository [package](https://github.com/xmake-io/xmake-repo/blob/dev/packages/f/ftxui/xmake.lua) + - [Nix](https://github.com/ArthurSonzogni/FTXUI/blob/main/flake.nix) * Good practices: documentation, tests, fuzzers, performance tests, automated CI, automated packaging, etc... ## Documentation @@ -430,6 +431,7 @@ If you don't, FTXUI may be used from the following packages: - [Ubuntu package](https://launchpad.net/ubuntu/+source/ftxui), - [Arch Linux](https://aur.archlinux.org/packages/ftxui/), - [OpenSUSE](https://build.opensuse.org/package/show/devel:libraries:c_c++/ftxui), +[Nix](https://github.com/ArthurSonzogni/FTXUI/blob/main/flake.nix), [![Packaging status](https://repology.org/badge/vertical-allrepos/libftxui.svg)](https://repology.org/project/libftxui/versions) diff --git a/doc/installation.md b/doc/installation.md index 3a8ecdff..9c49273d 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -16,6 +16,11 @@ This page serves as an entry point for the available integration methods. - @subpage installation_vcpkg - @subpage installation_conan - @subpage installation_manual +- @subpage installation_nix +- @subpage installation_debian +- @subpage installation_arch +- @subpage installation_opensuse +- @subpage installation_xmake ## Next Steps diff --git a/doc/installation_arch.md b/doc/installation_arch.md new file mode 100644 index 00000000..574c5cc2 --- /dev/null +++ b/doc/installation_arch.md @@ -0,0 +1,34 @@ +@page installation_arch Arch Linux + +FTXUI is packaged on the AUR. Install using an AUR helper: + +```bash +yay -S ftxui +``` + +You can also manually download the PKGBUILD from . + +Once installed, you can use it in your CMake projects by adding the following to your `CMakeLists.txt`: + +```cmake +find_package(ftxui REQUIRED) +add_executable(main main.cpp) +target_link_libraries(main + PRIVATE ftxui::screen + PRIVATE ftxui::dom + PRIVATE ftxui::component +) +``` + +> [!note] +> This is an unofficial package. That means it is not maintained by the FTXUI +> team, but by the community. The package maintainers seems to actively update +> the package to the latest version. Thanks to the maintainers for their work! + +
+ +| Previous | +|:------------------| +| [Getting Started](getting-started.html) | + +
diff --git a/doc/installation_conan.md b/doc/installation_conan.md index a17a8747..5aa24710 100644 --- a/doc/installation_conan.md +++ b/doc/installation_conan.md @@ -1,15 +1,19 @@ @page installation_conan Conan -@tableofcontents -## Conan Package +Unofficial recipe for FTXUI exists on Conan Center: + -Unofficial support for FTXUI exists on Conan Center: +> [!note] +> This is an unofficial recipe. That means it is not maintained by the FTXUI +> team, but by the community. The package maintainers seems to actively update +> the package to the latest version. Thanks to the maintainers for their work! -- https://conan.io/center/recipes/ftxui -## TODO +@todo Add instructions on how to use the conan recipe. -This page is incomplete. If you use FTXUI with Conan and can provide a minimal working setup, feel free to contribute. +@todo Please consider adding an "official" recipe to Conan Center if know how. +It could be a github action that will automatically update the conan center +when a new release is made.
diff --git a/doc/installation_debian.md b/doc/installation_debian.md new file mode 100644 index 00000000..de456693 --- /dev/null +++ b/doc/installation_debian.md @@ -0,0 +1,42 @@ +@page installation_debian Debian/Ubuntu + +## Debian and Ubuntu Packages (Unofficial) + +Pre-built packages are provided by the distributions. Install with: + +```bash +sudo apt install libftxui-dev +``` + +The following packages are available: +- `ftxui-doc` +- `ftxui-examples` +- `libftxui-component` +- `libftxui-dev` +- `libftxui-dom` +- `libftxui-screen` + +Once installed, you can use it in your CMake projects by adding the following to +your `CMakeLists.txt`: + +```cmake +find_package(ftxui REQUIRED) +add_executable(main main.cpp) +target_link_libraries(main + PRIVATE ftxui::screen + PRIVATE ftxui::dom + PRIVATE ftxui::component +) +``` + +> [!note] +> This is an **unofficial** package. That means it is not maintained by the FTXUI +> team, but by the community. + +
+ +| Previous | +|:------------------| +| [Getting Started](getting-started.html) | + +
diff --git a/doc/installation_manual.md b/doc/installation_manual.md new file mode 100644 index 00000000..56c39720 --- /dev/null +++ b/doc/installation_manual.md @@ -0,0 +1,35 @@ +@page installation_manual Manual +@tableofcontents + +## Building from Source (Official) + +Clone and build the project using CMake: + +```bash +git clone https://github.com/ArthurSonzogni/FTXUI.git +cd FTXUI +cmake -S . -B build -DFTXUI_ENABLE_INSTALL=ON -D +cmake --build build -j +sudo cmake --install build +``` + +Once installed you can use it in your CMake projects by adding the following to your `CMakeLists.txt`: + +```cmake +find_package(ftxui REQUIRED) +add_executable(main main.cpp) +target_link_libraries(main + PRIVATE ftxui::screen + PRIVATE ftxui::dom + PRIVATE ftxui::component +) +``` + + +
+ +| Previous | +|:------------------| +| [Getting Started](getting-started.html) | + +
diff --git a/doc/installation_nix.md b/doc/installation_nix.md new file mode 100644 index 00000000..e84d10ae --- /dev/null +++ b/doc/installation_nix.md @@ -0,0 +1,38 @@ +@page installation_nix Nix + +> [!note] +> FTXUI author is not very knowledgeable about Nix. This page has been mostly +> generated by AI. If you have any suggestions to improve it, please open a +> PR. + +## Nix Flake + +FTXUI ships with a `flake.nix` providing both packages and a development shell. + +### Build the Library + +```bash +nix build github:ArthurSonzogni/FTXUI +``` + +The resulting package is accessible via the `result` link. + +### Use as a Dependency + +Add FTXUI to your flake inputs: + +```nix +{ + inputs.ftxui.url = "github:ArthurSonzogni/FTXUI"; +} +``` + +Then reference `ftxui.packages..ftxui` in your outputs. + +
+ +| Previous | +|:------------------| +| [Getting Started](getting-started.html) | + +
diff --git a/doc/installation_opensuse.md b/doc/installation_opensuse.md new file mode 100644 index 00000000..3acb26b5 --- /dev/null +++ b/doc/installation_opensuse.md @@ -0,0 +1,32 @@ +@page installation_opensuse openSUSE + +## openSUSE Package (Unofficial) + +FTXUI seems to be available from the `devel:libraries:c_c++` repository. + +```bash +sudo zypper addrepo https://download.opensuse.org/repositories/devel:libraries:c_c++/openSUSE_Leap_$releasever/devel:libraries:c_c++.repo +sudo zypper install ftxui +``` + +See for details. + +> [!note] +> This is an **unofficial** package. That means it is not maintained by the FTXUI +> team, but by the community. + +-- + +> [!note] +> The FTXUI author is not very knowledgeable about openSUSE. This page has been +> mostly generated by AI. If you have any suggestions to improve it, please open +> a PR. + + +
+ +| Previous | +|:------------------| +| [Getting Started](getting-started.html) | + +
diff --git a/doc/installation_vcpkg.md b/doc/installation_vcpkg.md index c2905deb..63368f74 100644 --- a/doc/installation_vcpkg.md +++ b/doc/installation_vcpkg.md @@ -1,15 +1,74 @@ @page installation_vcpkg Vcpkg @tableofcontents -## Vcpkg Package +# Vcpkg Package -FTXUI is available in the Vcpkg registry: +FTXUI is available in the [Vcpkg registry](https://vcpkg.link/ports/ftxui) + +To use it, you can add the following to your `vcpkg.json`: + +```json +{ + "name": "your-project", + "version-string": "0.1.0", + "dependencies": [ + { + "name": "ftxui", + "version>=": "6.1.9" + } + ] +} +``` + +# Install FTXUI using Vcpkg +```bash +vcpkg install --triplet x64-linux # or x64-windows / arm64-osx etc. +``` + +# Configure your build system. +If you are using CMake, you can use the following in your `CMakeLists.txt`: + +**CMakeLists.txt** +```cmake +cmake_minimum_required(VERSION 3.15) +project(my_project) + +# Make sure vcpkg toolchain file is passed at configure time +find_package(ftxui CONFIG REQUIRED) + +add_executable(main main.cpp) +target_link_libraries(main + PRIVATE ftxui::screen + PRIVATE ftxui::dom + PRIVATE ftxui::component +) +``` + +**main.cpp** +```cpp +#include +#include +#include + +int main() { + using namespace ftxui; + + auto screen = ScreenInteractive::TerminalOutput(); + auto button = Button("Click me", [] { std::cout << "Clicked!\n"; }); + + screen.Loop(button); +} +``` + +**Configure and build the project** +```bash +cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake +cmake --build build +./build/main +``` -- https://vcpkg.link/ports/ftxui -## TODO -This page is incomplete. If you use FTXUI with Vcpkg, please help improve this page by contributing working configuration examples.
diff --git a/doc/installation_xmake.md b/doc/installation_xmake.md new file mode 100644 index 00000000..e6b107ad --- /dev/null +++ b/doc/installation_xmake.md @@ -0,0 +1,40 @@ +@page installation_xmake XMake +@tableofcontents + +## XMake Package (Unofficial) + +FTXUI is available in the [xmake-repo](https://github.com/xmake-io/xmake-repo/blob/dev/packages/f/ftxui/xmake.lua) + +Example `xmake.lua` snippet: + +```lua +add_requires("ftxui", {system = false}) + +target("demo") + set_kind("binary") + add_files("src/*.cpp") + add_packages("ftxui") +``` + +Refer to the [XMake documentation](https://xmake.io) for further options. + +> [!note] +> This is an **unofficial** package. That means it is not maintained by the FTXUI +> team, but by the community. + +--- + +> [!note] +> The FTXUI author is not very knowledgeable about openSUSE. This page has been +> mostly generated by AI. If you have any suggestions to improve it, please open +> a PR. + +--- + +
+ +| Previous | +|:------------------| +| [Getting Started](getting-started.html) | + +