From 02bbf56c19b0662d921753d6233477b63c9229dc Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Thu, 25 Apr 2024 11:24:14 +1000 Subject: [PATCH 1/4] Update README.md [skip ci] --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ad4dfa4..a51f422 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Note: Not every function from [StarExtensions](https://github.com/StarExtensions * Modded system types require a patch to display their custom sun. * You can also access the skybox sun scale and its default ray colors. For more details see, [sky.config.patch](https://github.com/OpenStarbound/OpenStarbound/blob/main/assets/opensb/sky.config.patch). -[Discord](https://discord.gg/D4QqtBNmAY) +[Discord](https://discord.gg/f8B5bWy3bA) ## Building From 9e875d5212eaa1dce9455ab50838df18281fae9c Mon Sep 17 00:00:00 2001 From: Kilkenni Date: Thu, 25 Apr 2024 13:37:34 +0300 Subject: [PATCH 2/4] Added instructionf for Fedora --- .gitignore | 1 + README.md | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) diff --git a/.gitignore b/.gitignore index 2169edd..4613197 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ /vcpkg/ /client_distribution/ /server_distribution/ +/source/vcpkg_installed/ enc_temp_folder/ .cache/ /attic/user/ diff --git a/README.md b/README.md index a51f422..bf15935 100644 --- a/README.md +++ b/README.md @@ -87,5 +87,88 @@ Note: Some of these [texts](## "hi :3") are just tooltips rather than links. * The built binaries will be in **dist/**. Copy the the .so libs from **lib/linux/** and the **sbinit.config** above into **dist/** so the game can run. * From the root dir of the repo, you can run the assembly script which is used by the GitHub Action: `scripts/ci/linux/assemble.sh` * This packs the game assets and copies the built binaries, premade sbinit configs & required libs into **client/** & **server/**. + +### Linux (Fedora) + +Starbound in general is built from the ground up, with its own engine written in C++ on top of some basic libraries. + +* CMake is a C++ build scenario generator and your first target. You need at least version 3.19. Where Ubuntu uses APT, Fedora uses DNF as package manager. + + 1. `sudo dnf upgrade --refresh` to ensure your OS is up-to-date + 2. `sudo dnf install cmake` + 3. `cmake --version` to verify + +* You will need at least the same dependencies ("basic libraries") as for Linux. Some packages have different names or contents between Linux builds. Namely, Fedora uses "-devel" instead of "-dev" for development packages. + + 1. `sudo dnf install` [pkg-config](## "will install pkgconf-pkg-config") libXmu-devel libXi-devel [libGL-devel](## "will install mesa-libGL-devel") mesa-libGLU-devel SDL2-devel python3-jinja2 ninja-build + 2. If you find out that you need any other dependencies not listed here, try finding them via [Fedora Packages](https://packages.fedoraproject.org/) first. And, preferably, improve this instruction. + +* Next you will need VCPKG. + +VCPKG is another package manager/dependency resolver for C++. CMake will need it to pull the rest of dependencies automatically early in the building process. If you've worked with language-specific package managers before (for example, NPM or YUM for JavaScript), VSPKG is similar. For reference, the list of dependencies VCPKG will try to install later can be found in `source/vcpkg.json`. + + 1. There are many ways to get VCPKG. Here's one: `. <(curl https://aka.ms/vcpkg-init.sh -L)`. This instruction should install VCPKG in your Linux home (user profile) directory in `.vcpkg`. Note that this dir is usually hidden by default. + 2. Next you need to set your **`VCPKG_ROOT`** environment variable to the correct path. Run `. ~/.vcpkg/vcpkg-init` to bootstrap VCPKG. You may want to check if the path is now known to the system by running `printenv VCPKG_ROOT` afterwards. + 3. Step 2 (init command) should be run in **every** new Terminal (Konsole) window **before** you begin building (environment variables set in this way do not persist between terminal sessions) + +* Change to the repo's **source/** directory +* *Optional.* First step for CMake is now to run VCPKG and install the remaining dependencies as per `source/vcpkg.json`. You can run this step manually via `vcpkg install` on its own to check if it works, or *skip to the next step*. + +If this step throws errors, Fedora probably still lacks some packages not listed explicitly before. Read error messages to identify these packages, find them via [Fedora Packages](https://packages.fedoraproject.org/) and install with DNF. What you need most of the time is the package itself as well as its -devel and -static subpackages. +* *Optional.* Next, we can ask CMake to assemble instructions for linux build without actually running them. The instructions generated will be stored under **build/linux-release**. To do that, run `cmake --preset=linux-release` or *skip to the next step*. +* Run `cmake --build --preset=linux-release` to build. It includes previous two steps, so if any of them throw errors, you will have problems. If that's the case, run and debug them separately as described earlier, as CMake itself can just throw `Error: could not load cache` without specifying the exact problem. In case of major changes (example: you've reinstalled VCPKG to a different location and need to regenerate path to it for CMake) purge CMake cache by deleting **source/CMakeCache.txt**. + +Building will take some time, be patient ;) + +
+Specific problem: If your VCPKG can't build meson for libsystemd +
+ +Diagnosed by + +>ERROR: Value "plain" (of type "string") for combo option "Optimization level" is not one of the choices. Possible choices are (as string): "0", "g", "1", "2", "3", "s". + +error in meson building logs when building libsystemd. + +Fix for VCPKG is pretty fresh (May 2024) and can be found [here](https://github.com/microsoft/vcpkg/issues/37393). + +
+ +* The built binaries will be in **dist/**. Copy the the .so libs from **lib/linux/** and **sbinit.config** (see beginning of this section) into **dist/** so the game can run. Sample sbinit.config can be found in **scripts/linux/**. +* From the root dir of the repo, you can run the assembly script which is used by the GitHub Action: `scripts/ci/linux/assemble.sh`. This packs the game assets and copies the built binaries, premade sbinit configs & required libs into **client_distribution/** & **server_distribution/**. + +Next you need to copy original Starbound assets at **assets/packed.pak** of the Starbound copy that you own into **assets/** of either client or server dir (depending on what you're going to run). + +The game now can be run by executing **client_distribution/linux/run-client.sh** (or the corresponding server bash script) from terminal. + +
+Fedora-specific problem with OSS (dsp: No such audio device) +
+ +Diagnosed by this error message when launching *client*: + +>Couldn't initialize SDL Audio: dsp: No such audio device + +The reason is outlined on [StackEx](https://stackoverflow.com/questions/9248131/failed-to-open-audio-device-dev-dsp/9248166#9248166): + +> Most new Linux distributions don't provide the OSS (open sound system) compatibility layer, because access to the OSS sound device /dev/dsp was exclusive to one program at time only. + +The same answer has the solution: use `padsp` to emulate dev/dsp. + +* `dnf install pulseaudio-utils` to install padsp util +* execute `padsp bash run-client.sh` instead of running sh directly. To avoid doing it every time you can edit run-client.sh, replacing + +`#!/bin/sh +cd "`dirname \"$0\"`" +LD_LIBRARY_PATH="$LD_LIBRARY_PATH:./" ./starbound "$@"` + +with + +`#!/bin/sh +cd "`dirname \"$0\"`" +LD_LIBRARY_PATH="$LD_LIBRARY_PATH:./" padsp ./starbound "$@"` + +
+ ### macOS To be written. From 248a22fb7bee2af7572c83999e96663ffd2afe9a Mon Sep 17 00:00:00 2001 From: Kilkenni Date: Thu, 25 Apr 2024 13:40:48 +0300 Subject: [PATCH 3/4] typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bf15935..d21aa73 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ Starbound in general is built from the ground up, with its own engine written in 2. `sudo dnf install cmake` 3. `cmake --version` to verify -* You will need at least the same dependencies ("basic libraries") as for Linux. Some packages have different names or contents between Linux builds. Namely, Fedora uses "-devel" instead of "-dev" for development packages. +* You will need at least the same dependencies ("basic libraries") as for Ubuntu. Some packages have different names or contents between Linux builds. Namely, Fedora uses "-devel" instead of "-dev" for development packages. 1. `sudo dnf install` [pkg-config](## "will install pkgconf-pkg-config") libXmu-devel libXi-devel [libGL-devel](## "will install mesa-libGL-devel") mesa-libGLU-devel SDL2-devel python3-jinja2 ninja-build 2. If you find out that you need any other dependencies not listed here, try finding them via [Fedora Packages](https://packages.fedoraproject.org/) first. And, preferably, improve this instruction. From eeff5a74243915bd07a84630149b2b63ffac5ce0 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Fri, 26 Apr 2024 06:57:06 +1000 Subject: [PATCH 4/4] Move build instructions into openable sections [skip ci] --- README.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d21aa73..ff24695 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Note: Not every function from [StarExtensions](https://github.com/StarExtensions Note: Some of these [texts](## "hi :3") are just tooltips rather than links.
-template sbinit.config for dist/ after build +template sbinit.config for dist/ after build
```json @@ -63,8 +63,9 @@ Note: Some of these [texts](## "hi :3") are just tooltips rather than links. ```
- -### Windows +
+Windows + * Install [vcpkg](https://github.com/microsoft/vcpkg?tab=readme-ov-file#quick-start-windows) *globally*. * vcpkg recommends a short directory, such as `C:\src\vcpkg` or `C:\dev\vcpkg`. * If you're using Visual Studio, don't forget to run `vcpkg integrate install`! @@ -76,7 +77,11 @@ Note: Some of these [texts](## "hi :3") are just tooltips rather than links. * If you're using an IDE, it should detect the correct preset and allow you to build from within. * Otherwise, build manually by running CMake in the **source/** directory: `cmake --build --preset=windows-release` * The built binaries will be in **dist/**. Copy the DLLs from **lib/windows/** and the **sbinit.config** above into **dist/** so the game can run. -### Linux (Ubuntu) + +
+
+Linux (Ubuntu) + * Make sure you're using CMake 3.19 or newer - you may need to [add Kitware's APT repo](https://apt.kitware.com/) to install a newer version. * Install dependencies: * `sudo apt-get install pkg-config libxmu-dev libxi-dev libgl-dev libglu1-mesa-dev libsdl2-dev python3-jinja2 ninja-build` @@ -87,8 +92,11 @@ Note: Some of these [texts](## "hi :3") are just tooltips rather than links. * The built binaries will be in **dist/**. Copy the the .so libs from **lib/linux/** and the **sbinit.config** above into **dist/** so the game can run. * From the root dir of the repo, you can run the assembly script which is used by the GitHub Action: `scripts/ci/linux/assemble.sh` * This packs the game assets and copies the built binaries, premade sbinit configs & required libs into **client/** & **server/**. + +
-### Linux (Fedora) +
+Linux (Fedora) Starbound in general is built from the ground up, with its own engine written in C++ on top of some basic libraries. @@ -170,5 +178,7 @@ LD_LIBRARY_PATH="$LD_LIBRARY_PATH:./" padsp ./starbound "$@"`
+ + ### macOS To be written.