Skip to content

CMakeLists.txt proposed fixes for building on Gentoo Linux - #85

Open
Anoncheg1 wants to merge 1 commit into
Try:masterfrom
Anoncheg1:pr-cmakel-gentoo-ebuild
Open

CMakeLists.txt proposed fixes for building on Gentoo Linux #85
Anoncheg1 wants to merge 1 commit into
Try:masterfrom
Anoncheg1:pr-cmakel-gentoo-ebuild

Conversation

@Anoncheg1

@Anoncheg1 Anoncheg1 commented Jul 28, 2026

Copy link
Copy Markdown

Hi! I created Ebuild file for Gentoo Linu with instruction to compile package from sources.

https://github.com/Anoncheg1/anonch-overlay/blob/main/dev-games/tempest/tempest-20251214.ebuild

it is for 2025-12-14 58477f3

In this ebuild I use system Gentoo packages, instead of built-in, with partial success (for libsquish built-in include headers .h still used)

  • media-libs/libpng
  • media-libs/libsquish
  • sys-libs/zlib

I tested it with working OpenGothic

https://github.com/Anoncheg1/anonch-overlay/blob/main/games-engines/opengothic/opengothic-1.0.3549.ebuild

Suggested improvements for CMakeLists.txt file:

  • Use GNUInstallDirs for Installation Paths
    Replace hardcoded lib and include destinations in the install() directive with ${CMAKE_INSTALL_LIBDIR} and ${CMAKE_INSTALL_INCLUDEDIR}. This ensures correct multilib directory handling (e.g., installing to lib64 on Gentoo/Arch systems) without requiring downstream patches.

  • Remove Hardcoded macOS Tool Paths
    Change find_program(GLSLANGVALIDATOR glslangValidator "/opt/homebrew/bin") to find_program(GLSLANGVALIDATOR glslangValidator REQUIRED). This allows the system's standard PATH resolution to work correctly on all platforms, rather than forcing a macOS-specific fallback that can cause confusion or failures on Linux.

  • Adopt Standard CMake Vulkan Find Module
    Replace manual $ENV{VULKAN_SDK} path injections and direct vulkan / vulkan-1 linking with the standard find_package(Vulkan REQUIRED) and the modern imported target Vulkan::Vulkan. This is more robust, cross-platform, and respects system-wide Vulkan SDK installations managed by distribution package managers.

  • Add Options for System Third-Party Libraries
    Introduce CMake options (e.g., TEMPEST_USE_SYSTEM_ZLIB, TEMPEST_USE_SYSTEM_LIBPNG, TEMPEST_USE_SYSTEM_SQUISH). When enabled, these should use find_package() and expose the expected target names (zlibstatic, png_static, squish-tempest) as INTERFACE libraries.
    Why this matters: Downstream packagers prefer using system libraries for security and deduplication. By providing INTERFACE targets with the same names, internal target_link_libraries calls remain intact, and we avoid CMake errors caused by applying PRIVATE compile options to system/INTERFACE targets.

  • Fix Relative Includes in Public Headers
    Update public headers in include/Tempest/ that currently use #include "../" to use #include "./" or #include "Tempest/". When headers are installed to a system directory (e.g., /usr/include/Tempest/), a ../ relative path points outside the valid include root, causing compilation failures for downstream users.

Benefits to the Project:

  • 📦 Easier Packaging: Distributions can package Tempest without maintaining fragile, version-breaking patch files.
  • 🛡️ Security & Stability: Encourages the use of system-managed, patched, and audited third-party dependencies (zlib, libpng, squish).
  • 🧹 Cleaner CMake: Aligns the project with modern CMake best practices (imported targets, GNUInstallDirs, proper find_package usage), making the codebase easier to maintain.

@Anoncheg1 Anoncheg1 changed the title PR with experince after Gentoo Ebuild comilation CMakeLists.txt fixed after Gentoo Ebuild comilation Jul 28, 2026
@Anoncheg1 Anoncheg1 changed the title CMakeLists.txt fixed after Gentoo Ebuild comilation CMakeLists.txt fixed after Gentoo Ebuild compilation Jul 28, 2026
@Anoncheg1 Anoncheg1 changed the title CMakeLists.txt fixed after Gentoo Ebuild compilation CMakeLists.txt proposed fixes after Gentoo Ebuild compilation Jul 28, 2026
@Anoncheg1 Anoncheg1 changed the title CMakeLists.txt proposed fixes after Gentoo Ebuild compilation CMakeLists.txt proposed fixes for Gentoo Linux compilation Jul 28, 2026
@Anoncheg1 Anoncheg1 changed the title CMakeLists.txt proposed fixes for Gentoo Linux compilation CMakeLists.txt proposed fixes for building on Gentoo Linux Jul 28, 2026
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.

1 participant