Skip to content

Make the application installable in Linux File Hierarchy Standard#24

Draft
ekohl wants to merge 6 commits intoteddych:masterfrom
ekohl:for-fedora-build
Draft

Make the application installable in Linux File Hierarchy Standard#24
ekohl wants to merge 6 commits intoteddych:masterfrom
ekohl:for-fedora-build

Conversation

@ekohl
Copy link
Contributor

@ekohl ekohl commented Jan 9, 2026

This is still a work in progress, but a step for #19: I want to install the binary to /usr/bin and data files to /usr/share/railcontrol, while still maintaining support for the "all in the same directory"-build.

To do so I've introduced an abstraction layer. After doing so I also noticed it creates log files, but with systemd logging to stdout is probably better anyway so in the service I'll likely disable that altogether.

The abstraction layer uses std::filesystem which is introduced in C++17 so I also updated the codebase to be compiled with it, but didn't go back to all code to use it.

@ekohl ekohl mentioned this pull request Jan 9, 2026
@ekohl
Copy link
Contributor Author

ekohl commented Jan 9, 2026

I wrote this before 6a93548 was merged so this doesn't write the docs to /usr/share/doc yet. One of the reasons it's still a draft.

@teddych
Copy link
Owner

teddych commented Jan 9, 2026

I have three change requests:

  1. I would like to name the new files Utils/Path.[cpp,h] (without the s), according to Utils/Interger.[cpp,h].
  2. I would like that you always use { and } in the if and else branch even if there is only one line.
  3. I would like that you do not make assignments within the condition statement of an if statement.

@ekohl
Copy link
Contributor Author

ekohl commented Jan 13, 2026

I haven't made changes on what I think is still needed to implement this, but does this address your code style concerns?

@teddych
Copy link
Owner

teddych commented Jan 13, 2026

You understood what I wanted to say.
On Path.cpp:61/63 the brackets are still missing. All the rest you have implemented as requested.

Comment on lines 60 to 66
if (env_p)
std::filesystem::path dir(env_p);
else
std::filesystem::path dir(".");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self when I continue:

Suggested change
if (env_p)
std::filesystem::path dir(env_p);
else
std::filesystem::path dir(".");
if (env_p)
{
std::filesystem::path dir(env_p);
}
else
{
std::filesystem::path dir(".");
}

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly!

ekohl added 6 commits January 21, 2026 12:52
In a4b339f the file VERSION was renamed
to VERSION_RAILCONTROL but the .gitattributes file wasn't which broke
git archive exports.

Fixes: a4b339f ("Fix compile problems on MacOS")
This creates Utils::Paths that holds the definitions for where data is
stored. This can differ per OS and makes it easy to change.
C++20 has deprecated the ++ and -- operations on volatile and C++26 is
looking at removing them. This replaces them with an explicit update.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants