Skip to content
Snippets Groups Projects
Commit 3930be3e authored by Joseph Walton-Rivers's avatar Joseph Walton-Rivers
Browse files

add experimental flatpak build support

parent c78454ad
No related branches found
No related tags found
No related merge requests found
app-id: com.fossgalaxy.fggl.demo
runtime: org.freedesktop.Platform.GL.default
app-id: com.fossgalaxy.fggl.Demo
runtime: org.freedesktop.Platform
runtime-version: '21.08'
sdk: org.freedesktop.Sdk
command: fggl-demo
command: /app/bin/demo
finish-args:
- "--device=dri"
- "--share=ipc"
- "--socket=fallback-x11"
- "--socket=wayland"
modules:
- name: glfw
buildsystem: cmake-ninja
......@@ -13,13 +18,24 @@ modules:
sha256: bbd2c42c660b725e9755eb417e40b373f0d4c03138c9b2e210d02cd308bd99cd
cleanup:
- /include
- /lib/cmake
- /lib/pkgconfig
- '*.a'
- modules/glm-0.9.9.8.json
- shared-modules/glew/glew.json
- modules/fmt.yml
- modules/spdlog.json
# - shared-modules/glew/glew.json
# - modules/googletest.yml
- shared-modules/glu/glu-9.json
- modules/googletest.yml
- modules/yaml-cpp.yml
- modules/assimp.yml
- name: fggl
buildsystem: cmake
builddir: true
sources:
- type: dir
path: ../
cleanup:
- '/include'
- '/cmake'
- '*.a'
name: assimp
buildsystem: cmake
config-opts:
- -DASSIMP_BUILD_ASSIMP_TOOLS=OFF
- -DASSIMP_BUILD_TESTS=OFF
sources:
- type: git
url: https://github.com/assimp/assimp.git
tag: v5.2.4
cleanup:
- '/include'
- '/lib/cmake'
- '/lib/pkgconfig'
name: fmt
buildsystem: cmake
sources:
- type: git
url: https://github.com/fmtlib/fmt.git
tag: 8.1.1
cleanup:
- '/include'
- '/lib/cmake'
- '/lib/pkgconfig'
- '*.a'
......@@ -4,3 +4,8 @@ sources:
- type: archive
url: https://github.com/google/googletest/archive/refs/tags/release-1.11.0.zip
sha256: 353571c2440176ded91c2de6d6cd88ddd41401d14692ec1f99e35d013feda55a
cleanup:
- '/include'
- '/lib/cmake'
- '/lib/pkgconfig'
- '*.a'
{
"name": "spdlog",
"buildsystem": "cmake",
"sources": [
{
"type": "git",
"url": "https://github.com/gabime/spdlog.git",
"tag": "v1.10.0"
}
],
"cleanup": [
"/include",
"/lib/cmake",
"/lib/pkgconfig",
"*.a"
]
}
name: yaml-cpp
buildsystem: cmake
config-opts:
- -DYAML_CPP_BUILD_TESTS=off
sources:
- type: git
url: https://github.com/jbeder/yaml-cpp.git
tag: yaml-cpp-0.7.0
cleanup:
- '/include'
- '/share/cmake'
- '/share/pkgconfig'
- '*.a'
Subproject commit 0534d3276b3966e87abacd163f757454b6fcf724
Subproject commit 1bb53934f105743f84f923693847185dce613cef
......@@ -31,6 +31,12 @@ install(
DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(
DIRECTORY data
DESTINATION ${CMAKE_INSTALL_DATADIR}
DIRECTORY data/
DESTINATION ${CMAKE_INSTALL_DATADIR}/fggl-demo
)
# Linux Desktop Entries
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
install(FILES aux/com.fossgalaxy.fggl.Demo.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications )
install(FILES aux/com.fossgalaxy.fggl.Demo.metainfo.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo )
endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
[Desktop Entry]
Name=FGGL Demo
Exec=demo
Type=Application
Categories=Game
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>com.fossgalaxy.fggl.Demo</id>
<name>FGGL Demo</name>
<summary>An application for testing FGGL features</summary>
<metadata_license>CC-BY-4.0</metadata_license>
<project_license>GPL-3.0-or-later</project_license>
<description>
<p>
Test application for the FOSS Galaxy Game Library (FGGL)
</p>
</description>
<launchable type="desktop-id">com.fossgalaxy.fggl.Demo.desktop</launchable>
</component>
......@@ -19,6 +19,7 @@
#include <cstdlib>
#include "fggl/platform/linux/paths.hpp"
#include "fggl/debug/logging.hpp"
namespace fggl::platform {
......@@ -30,7 +31,7 @@ namespace fggl::platform {
return {fallback};
}
static std::vector<std::filesystem::path> get_path_list(const char* env) {
static std::vector<std::filesystem::path> get_path_list(const char* env, const char* folderName) {
const char* pathList = std::getenv(env);
std::vector<std::filesystem::path> paths;
if (pathList) {
......@@ -42,7 +43,7 @@ namespace fggl::platform {
nextPos = pathListStr.size();
}
std::string path = pathListStr.substr(pos, nextPos - pos);
paths.push_back(std::filesystem::path(path));
paths.push_back(std::filesystem::path(path) / folderName);
pos = nextPos + 1;
}
}
......@@ -50,14 +51,14 @@ namespace fggl::platform {
}
EnginePaths calc_engine_paths(const char* base) {
auto dataDirs = get_path_list(ENV_DATA_DIRS);
auto dataDirs = get_path_list(ENV_DATA_DIRS, base);
if ( dataDirs.empty() ) {
for ( const auto& defaultDir : DEFAULT_DATA_DIRS ) {
dataDirs.push_back(std::filesystem::path(defaultDir) / base );
}
}
auto configDirs = get_path_list(ENV_CONFIG_DIRS);
auto configDirs = get_path_list(ENV_CONFIG_DIRS, base);
if ( configDirs.empty() ) {
for ( const auto& defaultDir : DEFAULT_CONFIG_DIRS ) {
configDirs.push_back(std::filesystem::path(defaultDir) / base );
......@@ -82,6 +83,7 @@ namespace fggl::platform {
// check system paths
for ( const auto& path : paths.dataDirs ) {
auto fullPath = path / relPath;
debug::log(debug::Level::warning, "Checking data path: {}, {}", fullPath.c_str(), std::filesystem::exists(fullPath));
if ( std::filesystem::exists(fullPath) ) {
return fullPath;
}
......
......@@ -20,6 +20,9 @@
#define FGGL_ASSETS_TYPES_HPP
#include <filesystem>
#include <variant>
#include <functional>
#include "fggl/util/safety.hpp"
namespace fggl::assets{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment