games-emulation/libretro-dolphin: use more system libraries

Signed-off-by: Pavel Sobolev <contact@paveloom.dev>
This commit is contained in:
Pavel Sobolev
2026-05-17 16:54:13 +03:00
parent f9a4a6d4f4
commit 09cc0b8b8a
3 changed files with 50 additions and 23 deletions

View File

@@ -1,8 +1,5 @@
DIST cpp-ipc-ab4e5bd18e554aaa4503a0c6f6174d9bbfb11b42.tar.gz 663636 BLAKE2B 039b6f2c05ebe59612b73658f59eae571dd45c3f3e960c75135e06281a99f55dcf1eef41b330eca0fe2460b35c75776de730c81600936fe2bf58eba3362bec7d SHA512 e6c2b8b5cc89ccb49706e87d0c4e5b8b9def855ed94419de76c4295ad3231af91e3cab2653009dc1159bc1e2871993086876ed6227bd6a1c1ae1b66938bf5fbf
DIST cpp-optparse-2265d647232249a53a03b411099863ceca35f0d3.tar.gz 13010 BLAKE2B 5a23625b98bb45c6e32174de47eb793ab9627e97df4935cdf0d3bfe43fe328488d2db0fa7987030778e03f17b9220a7990a5193e3728f1df4e9923173025979c SHA512 6b99478738980df3186b8487a33c96ee80107ed35fdd36cf615a53f58e9b1e72ab6099c2081e3622fa374f338609e747a1aa0c6c1295f2f71dea1ed17dbc6cf2
DIST imgui-45acd5e0e82f4c954432533ae9985ff0e1aad6d5.tar.gz 1934859 BLAKE2B bbd1824f98716ef7ae09811817e014882a194cbf3cdf5e9efe924c8b722920493ca9776771880310e73740ab88b1498e10ca84bdfad6fc3e47e3fd7041ed01ac SHA512 76fd04305cb48cf6bfa5c5dc884738137bd5c08f2ce12dfd77c1fc9b9294e6c592739d3ec4ceab7d65226775c3be5076710b58bcc40b8abed7da3620db3be511
DIST implot-3da8bd34299965d3b0ab124df743fe3e076fa222.tar.gz 141430 BLAKE2B 5fde32ccb24a8ceaa125e188fce9faf087fa5d2294379fc6bb31071878c4b63adb998aa0100dc48ed7a379d2b1cd49e109a150bec5ebf521f70d661673b4e4a8 SHA512 8a95f76ae4a14adf6f3bcd798d2334d8282ff7b50fc7def6308c0556adcc1dbd151c0a36aa676a82e10e1ae80d1ecc1ac54e705180650eed46d0a609611c73c5
DIST libretro-dolphin-0.0.1_pre20250517.tar.gz 41706321 BLAKE2B 6659875008484ef9427e16b944ccb1cbb17051ff59da8c4a50c5d32716b386539e6d4d87cad77dfaae8e3476bccd2c601be2d3a6a2cd0a19370d716252fc523e SHA512 0ddd7c799f97b753275742f5c539e1f353a4b63ddccda3dbd2d5384dd54004f7bc194fc76edfcdda41b7108a2c3fd16c853338d41ab7eda437a2d92beb68a58f
DIST libretro-dolphin-0.0.1_pre20260409.tar.gz 17682542 BLAKE2B 75d46e48d848e086877ee357ee726e63156ea3539d5a3e2554d55b3baf2b3e22bbc98e3f8f2a4477735b4b046a1ec9e4911ebf4658230457a28a34b69540b054 SHA512 9ec6e25640dd9edba6958a3941a7f3eb3737dc9b1e7455d3a97b092879523818f274a0940c95d6b19f7ddb5bbe7765c673a45192daff12edd15869ec00593b41
DIST tinygltf-c5641f2c22d117da7971504591a8f6a41ece488b.tar.gz 5903179 BLAKE2B 0ef4b36cf26f3a5a544d0c739317b8cce041121b1dec58d1d9dbc3bbc892df284d80aa4c45ec1ebc332ba96b151230a5b0dbf95b95aefcf86ee7878c393eda5d SHA512 486bcf32be137dea5746117074dc51bc978290698de7831e1c4bbaa4acb56ed99fc34c38e69878a955b3e5f10f43eab07b0637164f822beae0fddd099aa0c56d
DIST watcher-06f84a1314be18f5e697ebbf28c0fab2d17c9c39.tar.gz 175878 BLAKE2B 9181cb539afdfa9ee0bae3eb392a048ab7253a3f09449a0250b7a0740a58cdfd165a236534f9777efe5625c6c2b08832731d4a2b9b3231a05adf2ab7681a4561 SHA512 5ae81ab622b11f875e4fb6141beeb9d69275b7bd2345ae1907bcb9cd71379d4dba74083c7c1440781aed60718babfb4c61887eed9c84898e977df74b025d41e4

View File

@@ -0,0 +1,43 @@
From: Pavel Sobolev <contact@paveloom.dev>
Subject: [PATCH] Use more system libraries.
Signed-off-by: Pavel Sobolev <contact@paveloom.dev>
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -695,8 +695,8 @@ dolphin_find_optional_system_library_pkgconfig(FMT
fmt>=10.1 fmt::fmt Externals/fmt
)
-add_subdirectory(Externals/imgui)
-add_subdirectory(Externals/implot)
+dolphin_find_optional_system_library_pkgconfig(imgui imgui imgui Externals/imgui)
+dolphin_find_optional_system_library_pkgconfig(implot implot implot Externals/implot)
dolphin_find_optional_system_library(glslang Externals/glslang DOLPHIN_TRY_VERSIONS 15 16)
@@ -705,7 +705,12 @@ dolphin_find_optional_system_library(glslang Externals/glslang DOLPHIN_TRY_VERSI
if(WIN32 OR APPLE)
add_subdirectory(Externals/spirv_cross)
endif()
-add_subdirectory(Externals/tinygltf)
+
+dolphin_find_optional_system_library(TinyGLTF Externals/tinygltf)
+target_compile_definitions(tinygltf::tinygltf INTERFACE TINYGLTF_NOEXCEPTION)
+target_compile_definitions(tinygltf::tinygltf INTERFACE TINYGLTF_NO_EXTERNAL_IMAGE)
+target_compile_definitions(tinygltf::tinygltf INTERFACE TINYGLTF_USE_CPP14)
+dolphin_alias_library(tinygltf tinygltf::tinygltf)
if(ENABLE_VULKAN)
add_definitions(-DHAS_VULKAN)
--- a/Source/Core/VideoCommon/Assets/MeshAsset.cpp
+++ b/Source/Core/VideoCommon/Assets/MeshAsset.cpp
@@ -6,7 +6,7 @@
#include <array>
#include <utility>
-#include <tinygltf/tiny_gltf.h>
+#include <tiny_gltf.h>
#include "Common/IOFile.h"
#include "Common/Logging/Log.h"

View File

@@ -17,9 +17,6 @@ HOMEPAGE="https://github.com/libretro/dolphin"
CPPIPC_COMMIT="ab4e5bd18e554aaa4503a0c6f6174d9bbfb11b42" # v1.4.1
CPPOPTPARSE_COMMIT="2265d647232249a53a03b411099863ceca35f0d3"
IMGUI_COMMIT="45acd5e0e82f4c954432533ae9985ff0e1aad6d5" # v1.92.2b
IMPLOT_COMMIT="3da8bd34299965d3b0ab124df743fe3e076fa222"
TINYGLTF_COMMIT="c5641f2c22d117da7971504591a8f6a41ece488b"
WATCHER_COMMIT="06f84a1314be18f5e697ebbf28c0fab2d17c9c39" #v0.14.5
SRC_URI="
https://github.com/libretro/dolphin/archive/${LIBRETRO_COMMIT_SHA}.tar.gz -> ${P}.tar.gz
@@ -27,12 +24,6 @@ SRC_URI="
-> cpp-ipc-${CPPIPC_COMMIT}.tar.gz
https://github.com/weisslj/cpp-optparse/archive/${CPPOPTPARSE_COMMIT}.tar.gz
-> cpp-optparse-${CPPOPTPARSE_COMMIT}.tar.gz
https://github.com/ocornut/imgui/archive/${IMGUI_COMMIT}.tar.gz
-> imgui-${IMGUI_COMMIT}.tar.gz
https://github.com/epezent/implot/archive/${IMPLOT_COMMIT}.tar.gz
-> implot-${IMPLOT_COMMIT}.tar.gz
https://github.com/syoyo/tinygltf/archive/${TINYGLTF_COMMIT}.tar.gz
-> tinygltf-${TINYGLTF_COMMIT}.tar.gz
https://github.com/e-dant/watcher/archive/${WATCHER_COMMIT}.tar.gz
-> watcher-${WATCHER_COMMIT}.tar.gz
"
@@ -57,6 +48,8 @@ RDEPEND="
dev-util/glslang:=
games-emulation/libretro-info
media-libs/cubeb
>=media-libs/imgui-1.92
media-libs/implot:0/0.17
>=media-libs/libsfml-3.0:=
media-libs/libspng
net-libs/enet
@@ -76,6 +69,7 @@ RDEPEND="
"
DEPEND="
${RDEPEND}
dev-cpp/tinygltf
dev-util/vulkan-headers
media-libs/VulkanMemoryAllocator
egl? ( media-libs/libglvnd )
@@ -84,14 +78,15 @@ BDEPEND="
virtual/pkgconfig
"
PATCHES=(
"${FILESDIR}/${PN}-0.0.1_pre20260409-use-more-system-libraries.patch"
)
# [directory]=license
declare -A KEEP_BUNDLED=(
# Please keep this list in `CMakeLists.txt` order
[Bochs_disasm]=LGPL-2.1+
[cpp-optparse]=MIT
[imgui]=MIT
[implot]=MIT
[tinygltf]=MIT
[FreeSurround]=GPL-2+
[curl]=curl # Intentionally static for Libretro
[picojson]=BSD-2
@@ -112,18 +107,10 @@ add_bundled_licenses
src_prepare() {
mv -T "${WORKDIR}/cpp-ipc-${CPPIPC_COMMIT}" "Externals/cpp-ipc/cpp-ipc" || die
mv -T "${WORKDIR}/cpp-optparse-${CPPOPTPARSE_COMMIT}" "Externals/cpp-optparse/cpp-optparse" || die
mv -T "${WORKDIR}/imgui-${IMGUI_COMMIT}" "Externals/imgui/imgui" || die
mv -T "${WORKDIR}/implot-${IMPLOT_COMMIT}" "Externals/implot/implot" || die
mv -T "${WORKDIR}/tinygltf-${TINYGLTF_COMMIT}" "Externals/tinygltf/tinygltf" || die
mv -T "${WORKDIR}/watcher-${WATCHER_COMMIT}" "Externals/watcher/watcher" || die
# Avoid QA notices about CMake compatibility
rm -rf "Externals/cpp-ipc/cpp-ipc/3rdparty/gtest" || die
rm -rf "Externals/imgui/imgui/examples" || die
rm -rf "Externals/implot/implot/.github" || die
rm -rf "Externals/tinygltf/tinygltf/examples" || die
sed -i "s/\(cmake_minimum_required\).*/\1(VERSION 3.10)/" \
"Externals/tinygltf/tinygltf/CMakeLists.txt" || die
cmake_src_prepare