nixpkgs/pkgs/by-name/as/aseprite/shared-fmt.patch
vigress8 f6b705d0bf aseprite: 1.3.6 -> 1.3.7
* use clangStdenv
* update deps (pcre -> pcre2, tinyxml -> tinyxml-2)
* add patch to use shared `fmt` dependency
* format with nixfmt
* remove usage of "with lib;"
2024-06-17 13:55:12 +04:00

72 lines
2.2 KiB
Diff

--- a/CMakeLists.txt 2022-01-08 00:37:08.165330523 +0100
+++ b/CMakeLists.txt 2022-01-08 00:52:41.163585173 +0100
@@ -54,6 +54,7 @@
option(USE_SHARED_CMARK "Use your installed copy of cmark" off)
option(USE_SHARED_CURL "Use your installed copy of curl" off)
+option(USE_SHARED_FMT "Use your installed copy of fmt" off)
option(USE_SHARED_GIFLIB "Use your installed copy of giflib" off)
option(USE_SHARED_JPEGLIB "Use your installed copy of jpeglib" off)
option(USE_SHARED_ZLIB "Use your installed copy of zlib" off)
@@ -165,6 +165,7 @@
set(SOURCE_DATA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/data)
set(CMARK_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/cmark)
set(CURL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/curl)
+set(FMT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/fmt)
set(GIFLIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/giflib)
set(LIBJPEG_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/jpeg)
set(LIBPNG_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libpng)
@@ -204,6 +205,15 @@
set(CURL_STATICLIB ON BOOL)
endif()
+if(USE_SHARED_FMT)
+ find_package(FMT REQUIRED)
+ set(FMT_LIBRARIES fmt::fmt)
+else()
+ set(FMT_FOUND)
+ set(FMT_LIBRARIES fmt)
+ # No need to include extra directories, actually
+endif()
+
# zlib
if(USE_SHARED_ZLIB)
find_package(ZLIB REQUIRED)
--- a/src/app/CMakeLists.txt 2022-01-08 00:37:07.378671200 +0100
+++ b/src/app/CMakeLists.txt 2022-01-08 00:53:13.669969512 +0100
@@ -741,7 +741,7 @@ target_link_libraries(app-lib
${HARFBUZZ_LIBRARIES}
json11
archive_static
- fmt
+ ${FMT_LIBRARIES}
tinyexpr
qoi)
if(ENABLE_PSD)
--- a/src/dio/CMakeLists.txt 2022-01-08 00:41:50.712726972 +0100
+++ b/src/dio/CMakeLists.txt 2022-01-08 00:53:39.936408022 +0100
@@ -10,7 +10,7 @@
target_link_libraries(dio-lib
${ZLIB_LIBRARIES}
- fmt
+ ${FMT_LIBRARIES}
flic-lib
laf-base
fixmath-lib
--- a/third_party/CMakeLists.txt 2022-01-08 00:37:08.165330523 +0100
+++ b/third_party/CMakeLists.txt 2022-01-08 00:54:30.455969136 +0100
@@ -106,7 +106,10 @@
endif()
add_subdirectory(simpleini)
-add_subdirectory(fmt)
+
+if(NOT USE_SHARED_FMT)
+ add_subdirectory(fmt)
+endif()
# Add cmark without tests
if(NOT USE_SHARED_CMARK)