Gentoo Archives: gentoo-commits

From: James Le Cuirot <chewi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-util/slade/, games-util/slade/files/
Date: Tue, 16 Aug 2022 12:18:32
Message-Id: 1660652288.1a1fe067379a48c4b329c99db390f75f154a788c.chewi@gentoo
1 commit: 1a1fe067379a48c4b329c99db390f75f154a788c
2 Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
3 AuthorDate: Tue Aug 16 12:18:08 2022 +0000
4 Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 16 12:18:08 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1a1fe067
7
8 games-util/slade: Unbundle fmt library, fixing broken SONAME
9
10 Closes: https://bugs.gentoo.org/859322
11 Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
12
13 .../slade/files/slade-3.2.0-bundled-libs.patch | 176 ++++++++++++++++-----
14 .../{slade-3.2.1.ebuild => slade-3.2.1-r1.ebuild} | 5 +-
15 2 files changed, 141 insertions(+), 40 deletions(-)
16
17 diff --git a/games-util/slade/files/slade-3.2.0-bundled-libs.patch b/games-util/slade/files/slade-3.2.0-bundled-libs.patch
18 index c4eae37f945f..c543f09e3fae 100644
19 --- a/games-util/slade/files/slade-3.2.0-bundled-libs.patch
20 +++ b/games-util/slade/files/slade-3.2.0-bundled-libs.patch
21 @@ -1,17 +1,7 @@
22 -From 5ecc80d27276ba978b8c0268aab722fe8f09b394 Mon Sep 17 00:00:00 2001
23 -From: James Le Cuirot <chewi@g.o>
24 -Date: Sat, 20 Feb 2021 12:22:24 +0000
25 -Subject: [PATCH] Unbundle the DUMB library
26 -
27 ----
28 - src/Application/App.cpp | 2 +-
29 - src/Audio/ModMusic.cpp | 2 +-
30 - src/CMakeLists.txt | 4 +++-
31 - thirdparty/CMakeLists.txt | 1 -
32 - 4 files changed, 5 insertions(+), 4 deletions(-)
33 +https://github.com/sirjuddington/SLADE/pull/1413
34
35 diff --git a/src/Application/App.cpp b/src/Application/App.cpp
36 -index 936a8212..2960ca1d 100644
37 +index dddaf875..ede8d73c 100644
38 --- a/src/Application/App.cpp
39 +++ b/src/Application/App.cpp
40 @@ -60,7 +60,7 @@
41 @@ -21,7 +11,7 @@ index 936a8212..2960ca1d 100644
42 -#include "thirdparty/dumb/dumb.h"
43 +#include <dumb.h>
44 #include <filesystem>
45 -
46 +
47 using namespace slade;
48 diff --git a/src/Audio/ModMusic.cpp b/src/Audio/ModMusic.cpp
49 index cc4b60cf..6d54516d 100644
50 @@ -33,45 +23,126 @@ index cc4b60cf..6d54516d 100644
51 #include "ModMusic.h"
52 -#include "thirdparty/dumb/dumb.h"
53 +#include <dumb.h>
54 -
55 +
56 using namespace slade;
57 using namespace audio;
58 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
59 -index fef3d009..5363802c 100644
60 +index fef3d009..00dbb018 100644
61 --- a/src/CMakeLists.txt
62 +++ b/src/CMakeLists.txt
63 -@@ -107,6 +107,7 @@ if (NOT NO_LUA)
64 - find_package(Lua REQUIRED)
65 - endif()
66 - find_package(MPG123 REQUIRED)
67 -+pkg_check_modules(DUMB REQUIRED dumb>=1.0)
68 - include_directories(
69 - ${FREEIMAGE_INCLUDE_DIR}
70 - ${SFML_INCLUDE_DIR}
71 -@@ -114,9 +115,9 @@ include_directories(
72 - ${FTGL_INCLUDE_DIR}
73 - ${LUA_INCLUDE_DIR}
74 +@@ -116,7 +116,6 @@ include_directories(
75 ${MPG123_INCLUDE_DIR}
76 -+ ${DUMB_INCLUDE_DIRS}
77 .
78 ..
79 - ../thirdparty/dumb
80 ../thirdparty/glad/include
81 ./Application
82 )
83 -@@ -201,6 +202,7 @@ target_link_libraries(slade
84 - ${OPENGL_LIBRARIES}
85 - ${LUA_LIBRARIES}
86 - ${MPG123_LIBRARIES}
87 -+ ${DUMB_LIBRARIES}
88 - )
89 -
90 - if(LINUX)
91 +@@ -235,7 +234,7 @@ else(APPLE)
92 + install(FILES "${SLADE_OUTPUT_DIR}/slade.pk3"
93 + DESTINATION share/slade3
94 + )
95 +-
96 ++
97 + install(FILES "${PROJECT_SOURCE_DIR}/dist/res/logo_icon.png"
98 + DESTINATION share/icons/
99 + RENAME net.mancubus.SLADE.png
100 +diff --git a/src/General/CVar.cpp b/src/General/CVar.cpp
101 +index 460a7852..5e171446 100644
102 +--- a/src/General/CVar.cpp
103 ++++ b/src/General/CVar.cpp
104 +@@ -32,7 +32,7 @@
105 + // -----------------------------------------------------------------------------
106 + #include "Main.h"
107 + #include "Utility/StringUtils.h"
108 +-#include "thirdparty/fmt/include/fmt/format.h"
109 ++#include <fmt/format.h>
110 +
111 + using namespace slade;
112 +
113 +diff --git a/src/General/Log.cpp b/src/General/Log.cpp
114 +index 9ad0718f..8d39f644 100644
115 +--- a/src/General/Log.cpp
116 ++++ b/src/General/Log.cpp
117 +@@ -31,8 +31,8 @@
118 + // -----------------------------------------------------------------------------
119 + #include "Main.h"
120 + #include "App.h"
121 +-#include "thirdparty/fmt/include/fmt/chrono.h"
122 +-#include "thirdparty/fmt/include/fmt/format.h"
123 ++#include <fmt/chrono.h>
124 ++#include <fmt/format.h>
125 + #include <fstream>
126 +
127 + using namespace slade;
128 +diff --git a/src/TextEditor/TextStyle.cpp b/src/TextEditor/TextStyle.cpp
129 +index 09f4e405..ad51ec0a 100644
130 +--- a/src/TextEditor/TextStyle.cpp
131 ++++ b/src/TextEditor/TextStyle.cpp
132 +@@ -43,7 +43,7 @@
133 + #include "Utility/Parser.h"
134 + #include "Utility/StringUtils.h"
135 + #include "Utility/Tokenizer.h"
136 +-#include "thirdparty/fmt/include/fmt/format.h"
137 ++#include <fmt/format.h>
138 +
139 + using namespace slade;
140 +
141 +diff --git a/src/UI/Browser/BrowserItem.cpp b/src/UI/Browser/BrowserItem.cpp
142 +index 89c0f39c..3f056f71 100644
143 +--- a/src/UI/Browser/BrowserItem.cpp
144 ++++ b/src/UI/Browser/BrowserItem.cpp
145 +@@ -126,7 +126,7 @@ void BrowserItem::draw(
146 + // Create text box if needed
147 + if (!text_box_)
148 + text_box_ = std::make_unique<TextBox>(
149 +- fmt::format("{}\n{}", index_, name_.c_str()), font, ui::scalePx(144), ui::scalePx(16));
150 ++ fmt::format("{}\n{}", index_, name_.mb_str()), font, ui::scalePx(144), ui::scalePx(16));
151 +
152 + int top = y;
153 + top += ((size - text_box_->height()) * 0.5);
154 +diff --git a/src/UI/SToolBar/SToolBar.cpp b/src/UI/SToolBar/SToolBar.cpp
155 +index f38710ad..c002bf97 100644
156 +--- a/src/UI/SToolBar/SToolBar.cpp
157 ++++ b/src/UI/SToolBar/SToolBar.cpp
158 +@@ -219,7 +219,7 @@ void SToolBarGroup::hide(bool hide)
159 +
160 + // Update 'hidden toolbars' cvar
161 + string tb_hidden = toolbars_hidden;
162 +- auto name = fmt::format("[{}]", name_.c_str());
163 ++ auto name = fmt::format("[{}]", name_.mb_str());
164 + if (hide)
165 + tb_hidden += name;
166 + else
167 +diff --git a/src/common.h b/src/common.h
168 +index 8c3c4b3b..d66cbc04 100644
169 +--- a/src/common.h
170 ++++ b/src/common.h
171 +@@ -129,7 +129,7 @@
172 + #endif
173 +
174 + // fmt
175 +-#include "thirdparty/fmt/include/fmt/core.h"
176 ++#include <fmt/core.h>
177 +
178 + // Sigslot
179 + #include "thirdparty/sigslot/signal.hpp"
180 diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt
181 -index f84cfc8a..2622852b 100644
182 +index f84cfc8a..6cb9e0af 100644
183 --- a/thirdparty/CMakeLists.txt
184 +++ b/thirdparty/CMakeLists.txt
185 -@@ -10,7 +10,6 @@ set(BZIP2_LIBRARIES ${BZIP2_LIBRARIES} PARENT_SCOPE)
186 +@@ -6,20 +6,33 @@ find_package(BZip2 REQUIRED)
187 + set(ZLIB_LIBRARY ${ZLIB_LIBRARY} PARENT_SCOPE)
188 + set(BZIP2_LIBRARIES ${BZIP2_LIBRARIES} PARENT_SCOPE)
189 +
190 ++option(USE_SYSTEM_DUMB "Use system DUMB library" OFF)
191 ++if(USE_SYSTEM_DUMB)
192 ++ pkg_check_modules(DUMB REQUIRED IMPORTED_TARGET dumb>=1.0)
193 ++else()
194 ++ file(GLOB_RECURSE DUMB_SOURCES dumb/*.c)
195 ++endif()
196 ++
197 + # Roll the rest up into a big ball and compile it by itself
198 set(EXTERNAL_SOURCES
199 )
200 file(GLOB_RECURSE EXTERNAL_SOURCES
201 @@ -79,6 +150,33 @@ index f84cfc8a..2622852b 100644
202 lzma/C/LzmaDec.c
203 mus2mid/mus2mid.cpp
204 zreaders/*.cpp
205 ---
206 -2.34.1
207 + glad/src/*.c
208 ++ ${DUMB_SOURCES}
209 + ${SLADE_HEADERS}
210 + )
211 +
212 + # Add fmt
213 +-add_subdirectory(fmt)
214 ++option(USE_SYSTEM_FMT "Use system fmt library" OFF)
215 ++if(USE_SYSTEM_FMT)
216 ++ find_package(fmt REQUIRED)
217 ++else()
218 ++ add_subdirectory(fmt)
219 ++ target_include_directories(fmt INTERFACE ${CMAKE_CURRENT_LIST_DIR}/fmt/include)
220 ++endif()
221 +
222 + # Add lunasvg
223 + add_library(lunasvg STATIC)
224 +@@ -29,5 +42,11 @@ add_subdirectory(lunasvg/3rdparty/software)
225 + add_subdirectory(lunasvg/3rdparty/plutovg)
226
227 + add_library(external STATIC ${EXTERNAL_SOURCES})
228 +-target_link_libraries(external ${ZLIB_LIBRARY} lunasvg fmt ${CMAKE_DL_LIBS})
229 ++target_link_libraries(external ${ZLIB_LIBRARY} lunasvg fmt::fmt ${CMAKE_DL_LIBS})
230 + set(EXTERNAL_LIBRARIES external PARENT_SCOPE)
231 ++
232 ++if(USE_SYSTEM_DUMB)
233 ++ target_link_libraries(external PkgConfig::DUMB)
234 ++else()
235 ++ target_include_directories(external PUBLIC ${CMAKE_CURRENT_LIST_DIR}/dumb)
236 ++endif()
237
238 diff --git a/games-util/slade/slade-3.2.1.ebuild b/games-util/slade/slade-3.2.1-r1.ebuild
239 similarity index 93%
240 rename from games-util/slade/slade-3.2.1.ebuild
241 rename to games-util/slade/slade-3.2.1-r1.ebuild
242 index e68c8e1e1a4e..285ef98db6f9 100644
243 --- a/games-util/slade/slade-3.2.1.ebuild
244 +++ b/games-util/slade/slade-3.2.1-r1.ebuild
245 @@ -54,7 +54,7 @@ src_prepare() {
246 cmake_src_prepare
247
248 # Delete bundled libraries just in case.
249 - rm -r thirdparty/dumb/ || die
250 + rm -r thirdparty/dumb/ thirdparty/fmt/ || die
251
252 }
253
254 @@ -66,9 +66,12 @@ src_configure() {
255 -DLua_FIND_VERSION_MINOR=$(ver_cut 2 "${luav}")
256 -DLua_FIND_VERSION_COUNT=2
257 -DLua_FIND_VERSION_EXACT=ON
258 + -DNO_COTIRE=ON
259 -DNO_FLUIDSYNTH=$(usex fluidsynth OFF ON)
260 -DNO_WEBVIEW=$(usex webkit OFF ON)
261 -DUSE_SFML_RENDERWINDOW=ON
262 + -DUSE_SYSTEM_DUMB=ON
263 + -DUSE_SYSTEM_FMT=ON
264 -DWX_GTK3=ON
265 )