From df865034554c792cc535ecd710355f25e5f6a55c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Thu, 7 Aug 2025 05:35:45 +0700 Subject: [PATCH] inkscape: build with std::filesystem --- srcpkgs/inkscape/patches/std-filesystem.patch | 85 +++++++++++++++++++ srcpkgs/inkscape/template | 6 +- 2 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/inkscape/patches/std-filesystem.patch diff --git a/srcpkgs/inkscape/patches/std-filesystem.patch b/srcpkgs/inkscape/patches/std-filesystem.patch new file mode 100644 index 00000000000..5804952bbd2 --- /dev/null +++ b/srcpkgs/inkscape/patches/std-filesystem.patch @@ -0,0 +1,85 @@ +--- a/CMakeScripts/DefineDependsandFlags.cmake ++++ b/CMakeScripts/DefineDependsandFlags.cmake +@@ -308,7 +308,6 @@ elseif(APPLE) + find_package(Boost 1.19.0 REQUIRED COMPONENTS filesystem stacktrace_basic) + list(APPEND INKSCAPE_CXX_FLAGS "-D_GNU_SOURCE") + else() +- find_package(Boost 1.19.0 REQUIRED COMPONENTS filesystem) + # The package stacktrace_backtrace may not be available on all distros. + find_package(Boost 1.19.0 COMPONENTS stacktrace_backtrace) + if (BOOST_FOUND) +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -417,8 +417,6 @@ else() + set_target_properties(inkscape_base PROPERTIES INSTALL_RPATH "@loader_path/..") + endif() + +-target_link_libraries(inkscape_base PUBLIC Boost::filesystem) +- + # Link the inkscape_base library against all external dependencies + target_link_libraries(inkscape_base + PRIVATE +--- a/src/io/file-export-cmd.cpp ++++ b/src/io/file-export-cmd.cpp +@@ -51,13 +51,8 @@ + // Temporary dependency : once all compilers we want to support have support for + // C++17 std::filesystem (with #include ) then we drop this dep + // (Dev meeting, 2020-09-25) +-#ifdef G_OS_WIN32 + #include + namespace filesystem = std::filesystem; +-#else +-#include +-namespace filesystem = boost::filesystem; +-#endif + + InkFileExportCmd::InkFileExportCmd() + : export_overwrite(false) +--- a/src/ui/dialog/dialog-manager.cpp ++++ b/src/ui/dialog/dialog-manager.cpp +@@ -10,14 +10,8 @@ + #include + #include + +-#ifdef G_OS_WIN32 + #include + namespace filesystem = std::filesystem; +-#else +-// Waiting for compiler on MacOS to catch up to C++x17 +-#include +-namespace filesystem = boost::filesystem; +-#endif // G_OS_WIN32 + + #include "io/resource.h" + #include "inkscape-application.h" +--- a/src/ui/widget/canvas/framecheck.cpp ++++ b/src/ui/widget/canvas/framecheck.cpp +@@ -2,9 +2,9 @@ + #include + #include + #include +-#include // Using boost::filesystem instead of std::filesystem due to broken C++17 on MacOS. + #include "framecheck.h" +-namespace fs = boost::filesystem; ++#include ++namespace fs = std::filesystem; + + namespace Inkscape::FrameCheck { + +--- a/src/util/font-discovery.cpp ++++ b/src/util/font-discovery.cpp +@@ -23,14 +23,8 @@ + #include + #include + +-#ifdef G_OS_WIN32 + #include + namespace filesystem = std::filesystem; +-#else +-// Waiting for compiler on MacOS to catch up to C++x17 +-#include +-namespace filesystem = boost::filesystem; +-#endif // G_OS_WIN32 + + namespace Inkscape { + diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template index 68b25009046..8cbaf3f047a 100644 --- a/srcpkgs/inkscape/template +++ b/srcpkgs/inkscape/template @@ -1,7 +1,7 @@ # Template file for 'inkscape' pkgname=inkscape version=1.4.2 -revision=1 +revision=2 build_style=cmake make_check_target="check" hostmakedepends="automake gettext glib-devel intltool libgraphicsmagick-devel @@ -32,6 +32,10 @@ else configure_args+=" -DBUILD_TESTING=OFF" fi +if [ "$XBPS_TARGET_LIBC" != musl ]; then + makedepends+=" libbacktrace" +fi + post_patch() { if [ "$XBPS_TARGET_LIBC" = musl ]; then # disable errors for missing sentinels in glib variadic functions,