commit: 267cab4d7b6bc1d9eb1dc5c69ae8b4e3551f9695 Author: Nguyen Dinh Dang Duong <dangduong31205 <AT> gmail <DOT> com> AuthorDate: Thu Jul 10 22:12:45 2025 +0000 Commit: Nguyen Dinh Dang Duong <dangduong31205 <AT> gmail <DOT> com> CommitDate: Thu Jul 10 22:15:59 2025 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=267cab4d
dev-libs/vera: new package, add 20240804-r1 Signed-off-by: Nguyen Dinh Dang Duong <dangduong31205 <AT> gmail.com> .../vera/files/0001-Bump-cmake-min-version.patch | 22 ++ .../0002-Remove-hardcoded-installation-dir.patch | 27 ++ .../vera/files/0003-Use-dev-libs-stb-package.patch | 76 ++++++ .../vera/files/0004-Change-include-lines.patch | 46 ++++ .../vera/files/0005-Remove-some-bundled-deps.patch | 107 ++++++++ .../files/0006-Fix-in-class-initialization.patch | 274 +++++++++++++++++++++ dev-libs/vera/files/vera.pc.in | 9 + dev-libs/vera/metadata.xml | 11 + dev-libs/vera/vera-20240804-r1.ebuild | 82 ++++++ 9 files changed, 654 insertions(+) diff --git a/dev-libs/vera/files/0001-Bump-cmake-min-version.patch b/dev-libs/vera/files/0001-Bump-cmake-min-version.patch new file mode 100644 index 0000000000..df44248d65 --- /dev/null +++ b/dev-libs/vera/files/0001-Bump-cmake-min-version.patch @@ -0,0 +1,22 @@ +From 74d6dffc30ebaf4046954901e8605c8600edb488 Mon Sep 17 00:00:00 2001 +From: Nguyen Dinh Dang Duong <[email protected]> +Date: Wed, 9 Jul 2025 21:23:51 +0700 +Subject: [PATCH 1/6] Bump cmake min version + +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f82abad..c29116c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.2) ++cmake_minimum_required(VERSION 3.5) + + project(vera CXX) + +-- +2.50.0 + diff --git a/dev-libs/vera/files/0002-Remove-hardcoded-installation-dir.patch b/dev-libs/vera/files/0002-Remove-hardcoded-installation-dir.patch new file mode 100644 index 0000000000..0d521ad035 --- /dev/null +++ b/dev-libs/vera/files/0002-Remove-hardcoded-installation-dir.patch @@ -0,0 +1,27 @@ +From 6d4b10f540f951abb42c1a6d62e93ebbb6fca36d Mon Sep 17 00:00:00 2001 +From: Nguyen Dinh Dang Duong <[email protected]> +Date: Thu, 10 Jul 2025 01:35:06 +0700 +Subject: [PATCH 2/6] Remove hardcoded installation dir + +--- + src/CMakeLists.txt | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 981ff16..8021914 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -302,7 +302,9 @@ target_include_directories(vera PUBLIC ${INCLUDE_DEPS_FOLDERS} ${INCLUDE_FOLDER} + + if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) + +- install(TARGETS ${PROJECT_NAME} DESTINATION lib) ++ install(TARGETS ${PROJECT_NAME} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(FILES ${ROOT_HEADER} DESTINATION include/vera) + install(FILES ${GL_HEADER} DESTINATION include/vera/gl) + install(FILES ${IO_HEADER} DESTINATION include/vera/io) +-- +2.50.0 + diff --git a/dev-libs/vera/files/0003-Use-dev-libs-stb-package.patch b/dev-libs/vera/files/0003-Use-dev-libs-stb-package.patch new file mode 100644 index 0000000000..da39a08034 --- /dev/null +++ b/dev-libs/vera/files/0003-Use-dev-libs-stb-package.patch @@ -0,0 +1,76 @@ +From 68dbfb61d2557b11412a579abc7bc032d0202072 Mon Sep 17 00:00:00 2001 +From: Nguyen Dinh Dang Duong <[email protected]> +Date: Thu, 10 Jul 2025 00:53:04 +0700 +Subject: [PATCH 3/6] Use dev-libs/stb package + +--- + src/CMakeLists.txt | 1 + + src/io/gltf.cpp | 5 ----- + src/ops/pixel.cpp | 5 +---- + src/stb_impl.cpp | 5 +++++ + 4 files changed, 7 insertions(+), 9 deletions(-) + create mode 100644 src/stb_impl.cpp + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 8021914..74b00c0 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -36,6 +36,7 @@ set(VERA_SOURCES + ${DEPS_FOLDER}/stb/stb_image.cpp + ${SOURCE_FOLDER}/app.cpp + ${SOURCE_FOLDER}/window.cpp ++ ${SOURCE_FOLDER}/stb_impl.cpp + ${SOURCE_FOLDER}/gl/gl.cpp + ${SOURCE_FOLDER}/gl/fbo.cpp + ${SOURCE_FOLDER}/gl/vbo.cpp +diff --git a/src/io/gltf.cpp b/src/io/gltf.cpp +index fcc25b7..2c08f43 100644 +--- a/src/io/gltf.cpp ++++ b/src/io/gltf.cpp +@@ -20,11 +20,6 @@ + #include "glm/gtc/type_ptr.hpp" + #include "glm/gtx/quaternion.hpp" + +-#define TINYGLTF_IMPLEMENTATION +-#define STB_IMAGE_IMPLEMENTATION +-#define STB_IMAGE_WRITE_IMPLEMENTATION +-// #define TINYGLTF_NOEXCEPTION +-// #define JSON_NOEXCEPTION + #include "tiny_gltf.h" + + #define BUFFER_OFFSET(i) ((char *)NULL + (i)) +diff --git a/src/ops/pixel.cpp b/src/ops/pixel.cpp +index e57b84f..58ef78e 100644 +--- a/src/ops/pixel.cpp ++++ b/src/ops/pixel.cpp +@@ -3,9 +3,6 @@ + #include "vera/ops/pixel.h" + #include "vera/ops/fs.h" + +-#define STB_IMAGE_WRITE_IMPLEMENTATION +-#define STB_IMAGE_IMPLEMENTATION +- + #include "stb_image.h" + #include "stb_image_write.h" + #include "extract_depthmap.h" +@@ -191,4 +188,4 @@ void freePixels(void *pixels) { + stbi_image_free(pixels); + } + +-} +\ No newline at end of file ++} +diff --git a/src/stb_impl.cpp b/src/stb_impl.cpp +new file mode 100644 +index 0000000..82928fa +--- /dev/null ++++ b/src/stb_impl.cpp +@@ -0,0 +1,5 @@ ++#define STB_IMAGE_IMPLEMENTATION ++#include "stb_image.h" ++ ++#define STB_IMAGE_WRITE_IMPLEMENTATION ++#include "stb_image_write.h" +-- +2.50.0 + diff --git a/dev-libs/vera/files/0004-Change-include-lines.patch b/dev-libs/vera/files/0004-Change-include-lines.patch new file mode 100644 index 0000000000..7048985c05 --- /dev/null +++ b/dev-libs/vera/files/0004-Change-include-lines.patch @@ -0,0 +1,46 @@ +From 7cc9a85c6a656d72abbbe74ee9b70a21a015ca21 Mon Sep 17 00:00:00 2001 +From: Nguyen Dinh Dang Duong <[email protected]> +Date: Thu, 10 Jul 2025 00:53:09 +0700 +Subject: [PATCH 4/6] Change include lines + +--- + src/gl/textureStreamAudio.cpp | 2 +- + src/xr/holoPlay.cpp | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/gl/textureStreamAudio.cpp b/src/gl/textureStreamAudio.cpp +index ae886b5..59c23b6 100644 +--- a/src/gl/textureStreamAudio.cpp ++++ b/src/gl/textureStreamAudio.cpp +@@ -17,7 +17,7 @@ + extern "C" { + #include <libavcodec/avfft.h> + #include <libavutil/mem.h> +-#include "miniaudio.h" ++#include <miniaudio/miniaudio.h> + } + + ma_device_config a_deviceConfig; +diff --git a/src/xr/holoPlay.cpp b/src/xr/holoPlay.cpp +index 012e1e0..b43d087 100644 +--- a/src/xr/holoPlay.cpp ++++ b/src/xr/holoPlay.cpp +@@ -5,7 +5,7 @@ + + #include <fstream> + +-#include "json.hpp" ++#include <nlohmann/json.hpp> + + namespace vera { + +@@ -299,4 +299,4 @@ void feedLenticularUniforms(Shader& _shader) { + _shader.setUniform("u_lenticularRB", float(lenticular.ri), float(lenticular.bi)); + } + +-} +\ No newline at end of file ++} +-- +2.50.0 + diff --git a/dev-libs/vera/files/0005-Remove-some-bundled-deps.patch b/dev-libs/vera/files/0005-Remove-some-bundled-deps.patch new file mode 100644 index 0000000000..34ec4a836a --- /dev/null +++ b/dev-libs/vera/files/0005-Remove-some-bundled-deps.patch @@ -0,0 +1,107 @@ +From 8a275ff1cc0a892113f0d3dcc23c6396deaa8c31 Mon Sep 17 00:00:00 2001 +From: Nguyen Dinh Dang Duong <[email protected]> +Date: Thu, 10 Jul 2025 01:24:44 +0700 +Subject: [PATCH 5/6] Remove some bundled deps + +--- + deps/CMakeLists.txt | 18 +----------------- + src/CMakeLists.txt | 22 ++++++++++++++-------- + 2 files changed, 15 insertions(+), 25 deletions(-) + +diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt +index 45d1e48..8ca12fd 100644 +--- a/deps/CMakeLists.txt ++++ b/deps/CMakeLists.txt +@@ -1,31 +1,15 @@ + ## GLFW + if (NOT NO_X11 AND NOT FORCE_GBM AND NOT EMSCRIPTEN) +- # Configure GLFW to build only the library. +- set(GLFW_BUILD_DOCS OFF CACHE BOOL "") +- set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "") +- set(GLFW_BUILD_TESTS OFF CACHE BOOL "") +- set(GLFW_INSTALL OFF CACHE BOOL "") +- add_subdirectory(glfw) +- +- if(APPLE) +- target_compile_options(glfw PRIVATE "-Wno-deprecated-declarations") +- endif() +- + if(NOT DEFINED OpenGL_GL_PREFERENCE) + # set(OpenGL_GL_PREFERENCE "LEGACY") + set(OPENGL_GL_PREFERENCE "GLVND") + endif() + set(OpenGL_GL_PREFERENCE ${OPENGL_GL_PREFERENCE}) + find_package(OpenGL REQUIRED) +- + message(STATUS "OPENGL_LIBRARIES: ${OPENGL_LIBRARIES}") + message(STATUS "OPENGL_opengl_LIBRARY: ${OPENGL_opengl_LIBRARY}") + endif() + +-if (WIN32) +- add_subdirectory(glew) +-endif (WIN32) +- + if (EMSCRIPTEN) + add_subdirectory(emscripten-webxr) +-endif (EMSCRIPTEN) +\ No newline at end of file ++endif (EMSCRIPTEN) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 74b00c0..0289ee3 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -3,17 +3,12 @@ set(SOURCE_FOLDER "${PROJECT_SOURCE_DIR}/src") + set(DEPS_FOLDER "${PROJECT_SOURCE_DIR}/deps") + set(INCLUDE_FOLDER "${PROJECT_SOURCE_DIR}/include") + set(INCLUDE_DEPS_FOLDERS +- "${PROJECT_SOURCE_DIR}/deps/glm" +- "${PROJECT_SOURCE_DIR}/deps/stb" + "${PROJECT_SOURCE_DIR}/deps/glob" + "${PROJECT_SOURCE_DIR}/deps/skymodel" + "${PROJECT_SOURCE_DIR}/deps/fontstash" +- "${PROJECT_SOURCE_DIR}/deps/miniaudio" + "${PROJECT_SOURCE_DIR}/deps/phonedepth" +- "${PROJECT_SOURCE_DIR}/deps/tinygltf" + "${PROJECT_SOURCE_DIR}/deps/tinyobjloader" + "${PROJECT_SOURCE_DIR}/deps/tinyply" +- "${PROJECT_SOURCE_DIR}/deps/miniz" + "${PROJECT_SOURCE_DIR}/deps/tinyexr" + ) + +@@ -28,12 +23,9 @@ file(GLOB XR_HEADER "${INCLUDE_FOLDER}/vera/xr/*.h") + + # SOURCE files + set(VERA_SOURCES +- ${DEPS_FOLDER}/miniz/miniz.cpp + ${DEPS_FOLDER}/glob/glob.cpp + ${DEPS_FOLDER}/phonedepth/extract_depthmap.cpp + ${DEPS_FOLDER}/skymodel/ArHosekSkyModel.cpp +- ${DEPS_FOLDER}/stb/stb_image_write.cpp +- ${DEPS_FOLDER}/stb/stb_image.cpp + ${SOURCE_FOLDER}/app.cpp + ${SOURCE_FOLDER}/window.cpp + ${SOURCE_FOLDER}/stb_impl.cpp +@@ -91,6 +83,20 @@ set(VERA_SOURCES + # + add_library(vera ${VERA_SOURCES}) + ++find_package(PkgConfig) ++ ++# miniaudio package just install header files to /usr/include, just patch miniaudio.h -> miniaudio/miniaudio.h ++ ++pkg_check_modules(STB stb REQUIRED) ++target_include_directories(vera PUBLIC ${STB_INCLUDE_DIRS}) ++ ++find_library(TINYGLTF_LIB tinygltf REQUIRED) ++target_link_libraries(vera PUBLIC ${TINYGLTF_LIB}) ++ ++pkg_check_modules(MINIZ_LIB miniz REQUIRED) ++target_include_directories(vera PUBLIC ${MINIZ_LIB_INCLUDE_DIRS}) ++target_link_libraries(vera PUBLIC ${MINIZ_LIB_LIBRARIES}) ++ + set_target_properties(vera PROPERTIES + CXX_STANDARD 11 + CXX_STANDARD_REQUIRED ON +-- +2.50.0 + diff --git a/dev-libs/vera/files/0006-Fix-in-class-initialization.patch b/dev-libs/vera/files/0006-Fix-in-class-initialization.patch new file mode 100644 index 0000000000..622c7c198b --- /dev/null +++ b/dev-libs/vera/files/0006-Fix-in-class-initialization.patch @@ -0,0 +1,274 @@ +From df04be674dec037e4dd2442a0fc791589ded2019 Mon Sep 17 00:00:00 2001 +From: Nguyen Dinh Dang Duong <[email protected]> +Date: Thu, 10 Jul 2025 22:01:48 +0700 +Subject: [PATCH 6/6] Fix in-class initialization + +--- + include/vera/app.h | 4 +++- + include/vera/gl/textureStream.h | 4 +++- + include/vera/gl/textureStreamAudio.h | 2 +- + include/vera/types/sky.h | 3 ++- + include/vera/window.h | 5 ++++- + include/vera/xr/holoPlay.h | 3 ++- + src/CMakeLists.txt | 4 +++- + src/app.cpp | 4 +++- + src/gl/textureStream.cpp | 6 ++++++ + src/gl/textureStreamAudio.cpp | 1 + + src/gl/textureStreamMMAL.cpp | 3 ++- + src/types/sky.cpp | 5 +++++ + src/window.cpp | 4 ++++ + src/xr/holoPlay.cpp | 2 +- + 14 files changed, 40 insertions(+), 10 deletions(-) + create mode 100644 src/gl/textureStream.cpp + create mode 100644 src/types/sky.cpp + +diff --git a/include/vera/app.h b/include/vera/app.h +index 16d4b80..df909c1 100644 +--- a/include/vera/app.h ++++ b/include/vera/app.h +@@ -16,6 +16,8 @@ namespace vera { + class App { + public: + ++ App(); ++ + void run(WindowProperties _properties = WindowProperties()); + + virtual void setup() {}; +@@ -90,4 +92,4 @@ protected: + #endif + }; + +-} +\ No newline at end of file ++} +diff --git a/include/vera/gl/textureStream.h b/include/vera/gl/textureStream.h +index 3964089..d2d4cbf 100644 +--- a/include/vera/gl/textureStream.h ++++ b/include/vera/gl/textureStream.h +@@ -2,6 +2,7 @@ + + #include "texture.h" + ++#include <GL/glext.h> + #include <vector> + #include <iostream> + +@@ -10,6 +11,7 @@ namespace vera { + class TextureStream : public Texture { + public: + ++ TextureStream(); + virtual ~TextureStream() {} + + virtual void setSpeed( float _speed ) {}; +@@ -86,7 +88,7 @@ protected: + } + std::vector<GLuint> m_idPrevs; + +- bool m_play = true; ++ bool m_play; + }; + + } +diff --git a/include/vera/gl/textureStreamAudio.h b/include/vera/gl/textureStreamAudio.h +index 3f24205..236b7e6 100644 +--- a/include/vera/gl/textureStreamAudio.h ++++ b/include/vera/gl/textureStreamAudio.h +@@ -16,7 +16,7 @@ public: + private: + static const int m_buf_len = 1024; + std::vector<uint8_t> m_buffer_wr, m_buffer_re, m_texture; +- float* m_dft_buffer = nullptr; ++ float* m_dft_buffer; + }; + + +diff --git a/include/vera/types/sky.h b/include/vera/types/sky.h +index 1e03460..49eabb3 100644 +--- a/include/vera/types/sky.h ++++ b/include/vera/types/sky.h +@@ -7,6 +7,7 @@ namespace vera { + // SKY BOX GENERATOR + // -------------------------------------------------------------- + struct SkyData { ++ SkyData(); + glm::vec3 groundAlbedo = glm::vec3(0.25f); + float elevation = 0.3f; + float azimuth = 0.0f; +@@ -14,4 +15,4 @@ struct SkyData { + bool change = false; + }; + +-} +\ No newline at end of file ++} +diff --git a/include/vera/window.h b/include/vera/window.h +index 21f754a..deebbd9 100644 +--- a/include/vera/window.h ++++ b/include/vera/window.h +@@ -20,6 +20,9 @@ enum WindowStyle { + }; + + struct WindowProperties { ++ ++ WindowProperties(); ++ + WindowStyle style = REGULAR; + size_t major = 2; + size_t minor = 0; +@@ -138,4 +141,4 @@ void setMouseDragCallback(std::function<void(float, float, int)>); + void setScrollCallback(std::function<void(float)>); + void setDropCallback(std::function<void(int, const char**)>); + +-} +\ No newline at end of file ++} +diff --git a/include/vera/xr/holoPlay.h b/include/vera/xr/holoPlay.h +index 376004e..b258cd3 100644 +--- a/include/vera/xr/holoPlay.h ++++ b/include/vera/xr/holoPlay.h +@@ -42,6 +42,7 @@ void renderQuilt(std::function<void(const QuiltProperties&, glm::vec4&, int&)> _ + // in order to render correctly make sure this values match your calibration file on your device + // + struct LenticularProperties { ++ LenticularProperties() = default; + float dpi = 324.0; + float pitch = 52.58737671470091; + float slope = -7.196136200157333; +@@ -55,4 +56,4 @@ void setLenticularProperties(const std::string& _path); + std::string getLenticularFragShader(size_t _versionNumber = 100); + void feedLenticularUniforms(Shader& _shader); + +-} +\ No newline at end of file ++} +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 0289ee3..0db75c0 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -41,6 +41,7 @@ set(VERA_SOURCES + ${SOURCE_FOLDER}/gl/textureBump.cpp + ${SOURCE_FOLDER}/gl/textureCube.cpp + ${SOURCE_FOLDER}/gl/textureProps.cpp ++ ${SOURCE_FOLDER}/gl/textureStream.cpp + ${SOURCE_FOLDER}/gl/textureStreamAV.cpp + ${SOURCE_FOLDER}/gl/textureStreamOMX.cpp + ${SOURCE_FOLDER}/gl/textureStreamMMAL.cpp +@@ -74,6 +75,7 @@ set(VERA_SOURCES + ${SOURCE_FOLDER}/types/node.cpp + ${SOURCE_FOLDER}/types/scene.cpp + ${SOURCE_FOLDER}/types/triangle.cpp ++ ${SOURCE_FOLDER}/types/sky.cpp + ${SOURCE_FOLDER}/shaders/defaultShaders.cpp + ${SOURCE_FOLDER}/xr/holoPlay.cpp + ${SOURCE_FOLDER}/xr/xr.cpp +@@ -81,7 +83,7 @@ set(VERA_SOURCES + + # C++ LIBRAY + # +-add_library(vera ${VERA_SOURCES}) ++add_library(vera SHARED ${VERA_SOURCES}) + + find_package(PkgConfig) + +diff --git a/src/app.cpp b/src/app.cpp +index 008080b..abe7eff 100644 +--- a/src/app.cpp ++++ b/src/app.cpp +@@ -13,6 +13,8 @@ + + namespace vera { + ++App::App() = default; ++ + #if defined(__EMSCRIPTEN__) + EM_BOOL App::loop (double _time, void* _userData) { + App* _app = (App*)_userData; +@@ -299,4 +301,4 @@ void App::orbitControl() { + cam->setVirtualOffset(1.5, getQuiltCurrentViewIndex(), getQuiltTotalViews()); + } + +-} +\ No newline at end of file ++} +diff --git a/src/gl/textureStream.cpp b/src/gl/textureStream.cpp +new file mode 100644 +index 0000000..d45b5c3 +--- /dev/null ++++ b/src/gl/textureStream.cpp +@@ -0,0 +1,6 @@ ++#include "vera/gl/textureStream.h" ++ ++namespace vera { ++ TextureStream::TextureStream() = default; ++} ++ +diff --git a/src/gl/textureStreamAudio.cpp b/src/gl/textureStreamAudio.cpp +index 59c23b6..8a52cbb 100644 +--- a/src/gl/textureStreamAudio.cpp ++++ b/src/gl/textureStreamAudio.cpp +@@ -53,6 +53,7 @@ TextureStreamAudio::TextureStreamAudio(): TextureStream() { + m_dft_buffer = (float*)av_malloc_array(sizeof(float), m_buf_len); + m_buffer_wr.resize(m_buf_len, 0); + m_buffer_re.resize(m_buf_len, 0); ++ m_dft_buffer = nullptr; + } + + TextureStreamAudio::~TextureStreamAudio() { +diff --git a/src/gl/textureStreamMMAL.cpp b/src/gl/textureStreamMMAL.cpp +index ff8b184..e515164 100644 +--- a/src/gl/textureStreamMMAL.cpp ++++ b/src/gl/textureStreamMMAL.cpp +@@ -615,7 +615,8 @@ TextureStreamMMAL::TextureStreamMMAL() : + camera_component(NULL), + m_fbo_id(0), m_old_fbo_id(0), + m_egl_img(0), +- m_vbo(nullptr) { ++ m_vbo(nullptr), ++ camera_component(NULL) { + #ifndef DRIVER_BROADCOM + // bcm_host is initialated on the creation of the window in LEGACY + bcm_host_init(); +diff --git a/src/types/sky.cpp b/src/types/sky.cpp +new file mode 100644 +index 0000000..1bfa0c6 +--- /dev/null ++++ b/src/types/sky.cpp +@@ -0,0 +1,5 @@ ++#include "vera/types/sky.h" ++ ++namespace vera { ++ SkyData::SkyData() = default; ++} +diff --git a/src/window.cpp b/src/window.cpp +index 35f2249..90d295b 100644 +--- a/src/window.cpp ++++ b/src/window.cpp +@@ -49,6 +49,10 @@ static float yScroll = 0.0f; + static bool bShift = false; + static bool bControl = false; + ++namespace vera { ++ WindowProperties::WindowProperties() = default; ++} ++ + #if defined(DRIVER_GLFW) + + #if defined(__APPLE__) +diff --git a/src/xr/holoPlay.cpp b/src/xr/holoPlay.cpp +index b43d087..b8862eb 100644 +--- a/src/xr/holoPlay.cpp ++++ b/src/xr/holoPlay.cpp +@@ -15,7 +15,7 @@ static Shader quilt_shader; + static int currentViewIndex = 0; + + // QUILT +-QuiltProperties::QuiltProperties() {}; ++QuiltProperties::QuiltProperties() = default; + QuiltProperties::QuiltProperties(int _width, int _height, int _cols, int _rows) { + width = _width; + height = _height; +-- +2.50.0 + diff --git a/dev-libs/vera/files/vera.pc.in b/dev-libs/vera/files/vera.pc.in new file mode 100644 index 0000000000..35fabc22aa --- /dev/null +++ b/dev-libs/vera/files/vera.pc.in @@ -0,0 +1,9 @@ +prefix=/usr +includedir=${prefix}/include/ +libdir=${prefix}/@LIBDIR@ + +Name: Vera +Description: C++/WASM GL Framework +Version: @VERSION@ +Libs: -L${libdir} -lvera +Cflags: -I${includedir} diff --git a/dev-libs/vera/metadata.xml b/dev-libs/vera/metadata.xml new file mode 100644 index 0000000000..bfb9f2f85c --- /dev/null +++ b/dev-libs/vera/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>[email protected]</email> + <name>Nguyen Dinh Dang Duong</name> + </maintainer> + <upstream> + <remote-id type="github">patriciogonzalezvivo/vera</remote-id> + </upstream> +</pkgmetadata> diff --git a/dev-libs/vera/vera-20240804-r1.ebuild b/dev-libs/vera/vera-20240804-r1.ebuild new file mode 100644 index 0000000000..f4722b5d8c --- /dev/null +++ b/dev-libs/vera/vera-20240804-r1.ebuild @@ -0,0 +1,82 @@ +# Copyright 2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake git-r3 + +DESCRIPTION="C++/WASM GL Framework" +HOMEPAGE="https://github.com/patriciogonzalezvivo/vera" +EGIT_REPO_URI="https://github.com/patriciogonzalezvivo/vera/" +EGIT_COMMIT="cb117806d14ab2c31db86d5b8cab5c58b791dd6c" + +LICENSE="Prosperity-3.0.0" +SLOT="0" +IUSE="X wayland" + +DEPEND=" + dev-cpp/nlohmann_json + media-libs/glm + dev-libs/miniz + dev-cpp/tinygltf + dev-libs/stb + dev-libs/miniaudio + media-video/ffmpeg + media-libs/libsdl2 + dev-libs/glib + media-libs/libpulse + virtual/opengl + virtual/glu + + media-libs/glfw + + X? ( + x11-libs/libX11 + x11-libs/libXrandr + x11-libs/libXcursor + x11-libs/libXi + x11-libs/libXxf86vm + ) + + wayland? ( + dev-libs/wayland + gui-libs/libdecor + x11-libs/libxkbcommon + ) +" +RDEPEND="${DEPEND}" + +PATCHES=( + "${FILESDIR}/0001-Bump-cmake-min-version.patch" + "${FILESDIR}/0002-Remove-hardcoded-installation-dir.patch" + "${FILESDIR}/0003-Use-dev-libs-stb-package.patch" + "${FILESDIR}/0004-Change-include-lines.patch" + "${FILESDIR}/0005-Remove-some-bundled-deps.patch" + "${FILESDIR}/0006-Fix-in-class-initialization.patch" +) + +src_prepare() { + cmake_src_prepare + local libdir=$(get_libdir) + rm -rf "${S}/deps"{glew,glfw,glm,miniaudio,miniz,stb,tinygltf} || die "delete bundled deps failed" + sed \ + -e "s|@LIBDIR@|${libdir%/}/|g" \ + -e "s|@VERSION@|${PV}|g" \ + "${FILESDIR}/vera.pc.in" > vera.pc || die "sed failed" +} + +src_configure() { + local libdir=$(get_libdir) + local args=( + -DCMAKE_INSTALL_PREFIX=/usr + -DCMAKE_INSTALL_LIBDIR=${libdir} + -DNO_X11="$(usex X OFF ON)" + ) + cmake_src_configure +} + +src_install() { + cmake_src_install + insinto /usr/$(get_libdir)/pkgconfig + doins vera.pc +}
