惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
aimingoo的专栏
aimingoo的专栏
爱范儿
爱范儿
D
Docker
I
InfoQ
Microsoft Security Blog
Microsoft Security Blog
G
Google Developers Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Vercel News
Vercel News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
Tailwind CSS Blog
D
DataBreaches.Net
月光博客
月光博客
N
Netflix TechBlog - Medium
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
Visual Studio Blog
MyScale Blog
MyScale Blog
B
Blog
阮一峰的网络日志
阮一峰的网络日志
L
LangChain Blog
Recent Announcements
Recent Announcements
Microsoft Azure Blog
Microsoft Azure Blog
WordPress大学
WordPress大学

PBS activity

Draft: Make capypdf a submodule to enable it in the PPA (!7987) · Merge requests · Inkscape / inkscape · GitLab a7a272aeb209d29b500adb09d575af1d89645ffe to f9f9d913e36b14250122d9bc43911b5bb84e958c · PBS / Inkscape · GitLab Make capypdf a submodule (12ee5f11) · Commits · Inkscape / inkscape · GitLab Commits · launchpad-staging · Inkscape / inkscape · GitLab Commits · unmeson · PBS / Inkscape · GitLab Objects can't be moved using arrows keys (#6226) · Issues · Inkscape / inkscape · GitLab Down, left, right arrow keys don't work to move objects (#13628) · Issues · Inkscape / Inbox · GitLab Down, left, right arrow keys don't work to move objects (#13628) · Issues · Inkscape / Inbox · GitLab Draft: Expand tests for boolean operations on paths (!7980) · Merge requests · Inkscape / inkscape · GitLab 1.5-dev: cannot create/open documents after closing window on macOS (#5981) · Issues · Inkscape / inkscape · GitLab Use new Modifiers system for the arc tool (!7961) · Merge requests · Inkscape / inkscape · GitLab Remove dependency on deprecated appdirs module (!730) · Merge requests · Inkscape / extensions · GitLab Commits · appdirs · PBS / extensions · GitLab 1.5-dev: Unable to open the Extension Manager (#6202) · Issues · Inkscape / inkscape · GitLab PBS pushed to project branch capypdf-static at PBS / Inkscape PBS pushed to project branch capypdf-static at PBS / Inkscape Make internal capypdf static (!7947) · Merge requests · Inkscape / inkscape · GitLab Shape builder tool does not detect the interior region (#4477) · Issues · Inkscape / inkscape · GitLab Make (most) tests build and run on Windows (!7940) · Merge requests · Inkscape / inkscape · GitLab Generate AppImage with quick-sharun (a465f4ce) · Commits · PBS / Inkscape · GitLab Commits · sharun · PBS / Inkscape · GitLab 1.5-dev: Split mode state is incorrect in the menu when opening a new document (#6135) · Issues · Inkscape / inkscape · GitLab PBS deleted project branch deadlock-win at PBS / Inkscape 1.5-dev: (Windows) Deadlock on quit, process not exiting sometimes (#6003) · Issues · Inkscape / inkscape · GitLab Fix dark mode on gtk 4.20 (!7932) · Merge requests · Inkscape / inkscape · GitLab Fix some resizing issues on Windows by not setting GTK_CSD (!7931) · Merge requests · Inkscape / inkscape · GitLab Draft: Fix AppImage crashing during save on older distros (!7922) · Merge requests · Inkscape / inkscape · GitLab 19086deebf770c8932b403ee536c8f8562a376f9 to 55362ef7d4c363d9613d70ac7194de7e8e323a34 · PBS / Inkscape · GitLab c74f78ca23ff302b7b59175490b870f1a616b778 to 19086deebf770c8932b403ee536c8f8562a376f9 · PBS / Inkscape · GitLab acf9cb2511a84e64f6009a1f23078da8ff51485a to c74f78ca23ff302b7b59175490b870f1a616b778 · PBS / Inkscape · GitLab
Make capypdf a submodule (7f9465b6) · Commits · Inkscape ...
PBS · 2026-06-19 · via PBS activity
Commit 7f9465b6 authored by PBS's avatar PBS Committed by PBS
Browse files

Make capypdf a submodule

And build it with CMake to dodge its unreasonably new meson requirement.

These two changes in combination allow building Inkscape with capypdf
support on Launchpad.
Original line number Diff line number Diff line
@@ -20,3 +20,6 @@
[submodule "src/3rdparty/libuemf"]
	path = src/3rdparty/libuemf
	url = https://gitlab.com/inkscape/devel/libuemf.git
[submodule "src/3rdparty/capypdf"]
	path = src/3rdparty/capypdf
	url = https://github.com/jpakkane/capypdf
Original line number Diff line number Diff line
@@ -112,6 +112,7 @@ option(WITH_INTERNAL_UEMF "Prefer internal copy of libuemf" OFF)
option(WITH_INTERNAL_DEPIXELIZE "Prefer internal copy of libdepixelize" OFF)
option(WITH_INTERNAL_AUTOTRACE "Prefer internal copy of autotrace" OFF)
option(WITH_INTERNAL_ADAPTAGRAMS "Prefer internal copy of adaptagrams" OFF)
option(WITH_INTERNAL_CAPYPDF "Prefer internal copy of capypdf" OFF)
option(WITH_CROSSINK "Cross-compiling with Crossroads" OFF)
if(WIN32)
    option(TESTS_WITH_ASAN "Compile unit tests with Clang's AddressSanitizer" OFF)
@@ -277,6 +278,7 @@ message("WITH_INTERNAL_UEMF: ${WITH_INTERNAL_UEMF}")
message("WITH_INTERNAL_DEPIXELIZE:    ${WITH_INTERNAL_DEPIXELIZE}")
message("WITH_INTERNAL_AUTOTRACE:     ${WITH_INTERNAL_AUTOTRACE}")
message("WITH_INTERNAL_ADAPTAGRAMS:   ${WITH_INTERNAL_ADAPTAGRAMS}")
message("WITH_INTERNAL_CAPYPDF:       ${WITH_INTERNAL_CAPYPDF}")

message("WITH_PROFILING:              ${WITH_PROFILING}")
message("BUILD_TESTING:               ${BUILD_TESTING}")
Original line number Diff line number Diff line
@@ -193,73 +193,15 @@ if(NOT WITH_INTERNAL_ADAPTAGRAMS)
endif()

if(WITH_CAPYPDF)
  pkg_check_modules(CAPYPDF IMPORTED_TARGET capypdf>=0.21)
    if(NOT WITH_INTERNAL_CAPYPDF)
        pkg_check_modules(CAPYPDF QUIET IMPORTED_TARGET capypdf>=0.21)
        if(CAPYPDF_FOUND)
            add_library(Inkscape::CapyPDF ALIAS PkgConfig::CAPYPDF)
        else()
    if(NOT DEFINED CAPYPDF_SUPPORTED)
      try_compile(CAPYPDF_SUPPORTED
        SOURCE_FROM_CONTENT capypdf-support-check.cpp [[
          #include <version>
          #if defined(__cpp_lib_expected)
          #else
            #error
          #endif
          int main() {}
        ]]
        CXX_STANDARD 23
        CXX_STANDARD_REQUIRED TRUE
      )
      if(NOT CAPYPDF_SUPPORTED)
        message(STATUS "CapyPDF disabled, requires C++23")
      else()
        execute_process(COMMAND meson --version OUTPUT_VARIABLE MESON_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
        if(MESON_VERSION VERSION_LESS 1.10)
          message(STATUS "CapyPDF disabled, requires meson>=1.10")
          set(CAPYPDF_SUPPORTED 0 CACHE INTERNAL "Test CAPYPDF_SUPPORTED")
        endif()
      endif()
    endif()
    if(NOT CAPYPDF_SUPPORTED)
      set(WITH_CAPYPDF OFF)
    else()
      set(CAPY_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/deps)
      set(CAPY_LIBDIR ${CAPY_PREFIX}/${CMAKE_INSTALL_LIBDIR})
      if(APPLE)
        set(SED_INPLACE "-i ''")
      else()
        set(SED_INPLACE "-i")
      endif()
      include(ExternalProject)
      ExternalProject_Add(capypdf
          URL https://github.com/jpakkane/capypdf/releases/download/0.21.0/capypdf-0.21.0.tar.xz
          URL_HASH SHA256=b269a7361252b737f47b744f5329ba63f29af5bd3c46acbf7d4a4e074661f8a1
          DOWNLOAD_EXTRACT_TIMESTAMP TRUE
          PATCH_COMMAND sed ${SED_INPLACE} -e "/subdir('benchmark')/d" -e "/subdir('test')/d" ../capypdf/meson.build
          CONFIGURE_COMMAND meson setup . ../capypdf --libdir=${CAPY_LIBDIR} --prefix=${CAPY_PREFIX} --buildtype release --default-library static
          BUILD_COMMAND meson compile
          INSTALL_COMMAND meson install
          INSTALL_BYPRODUCTS "${CAPY_LIBDIR}/libcapypdf.a"
      )
      add_library(CapyPDF_LIB STATIC IMPORTED GLOBAL)
      set_target_properties(CapyPDF_LIB PROPERTIES IMPORTED_LOCATION "${CAPY_LIBDIR}/libcapypdf.a")
      find_package(PNG REQUIRED)
      find_package(JPEG REQUIRED)
      find_package(ZLIB REQUIRED)
      find_package(TIFF REQUIRED)
      find_package(Freetype REQUIRED)
      pkg_check_modules(CAPY_DEPS REQUIRED IMPORTED_TARGET lcms2)
      target_link_libraries(CapyPDF_LIB INTERFACE PNG::PNG JPEG::JPEG ZLIB::ZLIB TIFF::TIFF Freetype::Freetype PkgConfig::CAPY_DEPS)
      add_library(CapyPDF_LIB2 INTERFACE)
      target_link_libraries(CapyPDF_LIB2 INTERFACE CapyPDF_LIB)
      target_include_directories(CapyPDF_LIB2 INTERFACE "${CAPY_PREFIX}/include/capypdf-0")
      add_dependencies(CapyPDF_LIB2 capypdf)
      add_library(Inkscape::CapyPDF ALIAS CapyPDF_LIB2)
            message(STATUS "CapyPDF not found, using internal copy in src/3rdparty/capypdf")
            set(WITH_INTERNAL_CAPYPDF ON CACHE BOOL "Prefer internal copy of capypdf" FORCE)
        endif()
    endif()
endif()
if(WITH_CAPYPDF)
  list(APPEND INKSCAPE_LIBS Inkscape::CapyPDF)
    add_definitions(-DWITH_CAPYPDF)
endif()

Original line number Diff line number Diff line
@@ -22,3 +22,67 @@ endif()
if(WITH_INTERNAL_AUTOTRACE)
    add_subdirectory(autotrace)
endif()

if(WITH_CAPYPDF AND WITH_INTERNAL_CAPYPDF)
    add_library(capypdf_LIB STATIC)
    set_property(TARGET capypdf_LIB PROPERTY CXX_STANDARD 23)

    find_package(PNG REQUIRED)
    find_package(JPEG REQUIRED)
    find_package(ZLIB REQUIRED)
    find_package(TIFF REQUIRED)
    find_package(Freetype REQUIRED)
    pkg_check_modules(CAPY_DEPS REQUIRED IMPORTED_TARGET lcms2)
    target_link_libraries(capypdf_LIB PUBLIC PNG::PNG JPEG::JPEG ZLIB::ZLIB TIFF::TIFF Freetype::Freetype PkgConfig::CAPY_DEPS)

    set(SRC capypdf/src)
    target_sources(capypdf_LIB PRIVATE
        ${SRC}/pdfcommon.cpp
        ${SRC}/generator.cpp
        ${SRC}/drawcontext.cpp
        ${SRC}/document.cpp
        ${SRC}/imagefileops.cpp
        ${SRC}/utils.cpp
        ${SRC}/colorconverter.cpp
        ${SRC}/fontsubsetter.cpp
        ${SRC}/ft_subsetter.cpp
        ${SRC}/cffsubsetter.cpp
        ${SRC}/bitfiddling.cpp
        ${SRC}/capi.cpp
        ${SRC}/errorhandling.cpp
        ${SRC}/pdfwriter.cpp
        ${SRC}/objectformatter.cpp
        ${SRC}/commandstreamformatter.cpp
        ${SRC}/mmapper.cpp
        ${SRC}/xmlformatter.cpp
    )

    set(CAPYPDF_VERSION_MAJOR 0)
    set(CAPYPDF_VERSION_MINOR 21)
    set(CAPYPDF_VERSION_MICRO 0)

    string(CONCAT CAPYPDF_HEADER_REGEX
        "s/^#mesondefine CAPYPDF_VERSION_STR$$/#define CAPYPDF_VERSION_STR \\\"${CAPYPDF_VERSION_MAJOR}.${CAPYPDF_VERSION_MINOR}.${CAPYPDF_VERSION_MICRO}\\\"/;"
        "s/^#mesondefine CAPYPDF_VERSION_MAJOR$$/#define CAPYPDF_VERSION_MAJOR ${CAPYPDF_VERSION_MAJOR}/;"
        "s/^#mesondefine CAPYPDF_VERSION_MINOR$$/#define CAPYPDF_VERSION_MINOR ${CAPYPDF_VERSION_MINOR}/;"
        "s/^#mesondefine CAPYPDF_VERSION_MICRO$$/#define CAPYPDF_VERSION_MICRO ${CAPYPDF_VERSION_MICRO}/;"
        "s/^#mesondefine CAPYPDF_STATIC$$/#define CAPYPDF_STATIC 1/"
    )

    add_custom_target(capypdf_HEADER
        COMMAND sed "'${CAPYPDF_HEADER_REGEX}'" "${CMAKE_CURRENT_SOURCE_DIR}/capypdf/include/capypdf.h.in" > "${CMAKE_CURRENT_BINARY_DIR}/capypdf.h"
        DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/capypdf/include/capypdf.h.in"
    )

    add_dependencies(capypdf_LIB capypdf_HEADER)

    target_include_directories(capypdf_LIB
        PRIVATE
            capypdf/src
        PUBLIC
            capypdf/include # for capypdf.hpp
            ${CMAKE_CURRENT_BINARY_DIR} # for generated capypdf.h
    )

    add_library(Inkscape::CapyPDF ALIAS capypdf_LIB)
endif()
Original line number Diff line number Diff line
Subproject commit d789f48b43518bcd190e9d845c943e3978014f61