New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: [Actions / CMake] support for generic linux builds #8641
Conversation
These bundles can be opened on any "modern" Linux machine with a driver that SDL2 supports. Machines needs at least glibc 2.15, which was released 10 years ago. It is build with CentOS 7 as base, and only assumes the following libraries are available on the system: - libc - libdl - libgcc_s - libpthread - librt - libstdc++ All other libraries the game depends on are bundled together with the game, so users don't need any library installed to use this bundle. The downside of course is that this increases the binary size a bit: 30 MiB of libraries are in this bundle. RPATH is used to make ld-linux find the folder libraries are stored in; however, system libraries are always used before these, in the assumption libraries on the user system are more up-to-date. Using -DOPTION_PACKAGE_DEPENDENCIES=ON switches on packaging of libraries in the "lib" folder. This requires CMake 3.16 to be installed; otherwise it will fail.
599f242
to
401d3e7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simple and smart solution
# The yum variant of fluidsynth depends on all possible audio drivers. | ||
# This is not really useful for us, as that would require a user to | ||
# have them all before he can start OpenTTD. Instead, compile a | ||
# version that can only use SDL2. As OpenTTD does sound via SDL2, | ||
# this simply means we either have sound and music, or have none. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect. OpenTTD does not depend on fluidsynth having output via a sound driver at all. The fluidsynth music driver sets up fluidsynth to call an internal callback to deliver samples, which are then mixed by our own sound mixer. If it's possible to build fluidsynth without any output drivers at all, you may as well do that.
OpenTTD/src/music/fluidsynth.cpp
Lines 68 to 71 in a667ed9
/* Install the music render routine and set up the samplerate */ | |
uint32 samplerate = MxSetMusicSource(RenderMusicStream); | |
fluid_settings_setnum(_midi.settings, "synth.sample-rate", samplerate); | |
DEBUG(driver, 1, "Fluidsynth: samplerate %.0f", (float)samplerate); |
nielsmh nicely correct us in OpenTTD#8641, pointing out the old comment is not telling a complete truth. The result, is the same, but it is better to not mislead future-us.
Motivation / Problem
For Steam we would like to have a Linux release too. As we didn't build a generic linux build yet, this was a bit of a challenge ;)
Description
Limitations
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.