From ee87dd9f21e0dcd5a2f3a78586e5ae5d2ba592d5 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 22 Jun 2026 08:34:39 +0800 Subject: Flatpak support Still uses prebuilt GLU, could be improved by using the glu shared module. Still uses prebuilt OpenAL, could be improved by separating the ALUT dependency (which isn't available on the runtime) from it, so we could use runtime's OpenAL. Still uses prebuilt LibXML2, could be improved by separating the Minizip & ColladaDOM from it (which aren't available on the runtime) from it, so we could use runtime's LibXML2 but have ColladaDOM built against it (and a still non-runtime Minizip). Still uses FLTK 1.3, when I tried using 1.4, it still had linking errors (might need to just add Cairo libraries to the target_link_libraries). VLC plugins are installed in vlc/plugins path relative to the vlc & vlccore libraries, the way they are in the distro I got the binaries from (Debian), cause I think it's the libraries that are compiled with that path. Still uses prebuilt dependencies in general, could be improved by having them as modules to be built. _FORTIFY_SOURCE needs to be skipped to avoid redefinition cause Flatpak build system already defines it. The conditionals for deciding installation paths need to be reorganised to accomodate installation that doesn't require an encapsulating namespace (because the installed files are already encapsulated in the app sandbox). The library directory naming scheme used here is lib64. The libGLESv2.so & libvulkan.so.1 installed are still copies, not links yet, because I'm still not familiar yet with the runtime hierarchies (they might reside just in /usr/lib/x86_64-linux-gnu). --- indra/cmake/UnixInstall.cmake | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'indra/cmake/UnixInstall.cmake') diff --git a/indra/cmake/UnixInstall.cmake b/indra/cmake/UnixInstall.cmake index b82cbbcc2f..65170b5744 100644 --- a/indra/cmake/UnixInstall.cmake +++ b/indra/cmake/UnixInstall.cmake @@ -6,23 +6,25 @@ set(INSTALL OFF CACHE BOOL "Generate install target.") if (INSTALL) - if (CMAKE_SYSTEM_NAME MATCHES FreeBSD) + if (USE_FLATPAK OR CMAKE_SYSTEM_NAME MATCHES FreeBSD) set(INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "Top-level installation directory.") - else (CMAKE_SYSTEM_NAME MATCHES FreeBSD) + else () set(INSTALL_PREFIX /usr CACHE PATH "Top-level installation directory.") - endif (CMAKE_SYSTEM_NAME MATCHES FreeBSD) + endif () - if (${LINUX_DISTRO} MATCHES debian OR (${LINUX_DISTRO} MATCHES ubuntu)) - set(_LIB lib/${ARCH}-linux-gnu) - elseif (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed) OR (${LINUX_DISTRO} MATCHES gentoo)) + if (USE_FLATPAK) set(_LIB lib${ADDRESS_SIZE}) + elseif (${LINUX_DISTRO} MATCHES debian OR (${LINUX_DISTRO} MATCHES ubuntu)) + set(_LIB lib/${ARCH}-linux-gnu/${VIEWER_BINARY_NAME}) + elseif (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed) OR (${LINUX_DISTRO} MATCHES gentoo)) + set(_LIB lib${ADDRESS_SIZE}/${VIEWER_BINARY_NAME}) else () - set(_LIB lib) + set(_LIB lib/${VIEWER_BINARY_NAME}) endif () - set(INSTALL_LIBRARY_DIR ${INSTALL_PREFIX}/${_LIB}/${VIEWER_BINARY_NAME} CACHE PATH + set(INSTALL_LIBRARY_DIR ${INSTALL_PREFIX}/${_LIB} CACHE PATH "Installation directory for dynamic library files and their resources.") set(INSTALL_SHARE_DIR ${INSTALL_PREFIX}/share CACHE PATH @@ -35,13 +37,17 @@ if (INSTALL) set(APP_SHARE_DIR ${INSTALL_SHARE_DIR}/${VIEWER_BINARY_NAME} CACHE PATH "Installation directory for read-only data files.") - if (${LINUX_DISTRO} MATCHES arch) + if (USE_FLATPAK) + set(APP_LIBEXEC_DIR ${INSTALL_PREFIX}/libexec + CACHE PATH + "Installation directory for non-manual executables.") + elseif (${LINUX_DISTRO} MATCHES arch) set(APP_LIBEXEC_DIR ${INSTALL_PREFIX}/lib/${VIEWER_BINARY_NAME} CACHE PATH "Installation directory for non-manual executables.") - else (${LINUX_DISTRO} MATCHES arch) + else () set(APP_LIBEXEC_DIR ${INSTALL_PREFIX}/libexec/${VIEWER_BINARY_NAME} CACHE PATH "Installation directory for non-manual executables.") - endif (${LINUX_DISTRO} MATCHES arch) + endif () endif (INSTALL) -- cgit v1.3