Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Python bindings for [libdigidocpp](https://github.com/open-eid/libdigidocpp) via

## Architecture

- `libdigidocpp/` — upstream C++ library as a git submodule (pinned to v4.3.0)
- `libdigidocpp/` — upstream C++ library as a git submodule (pinned to master)
- `CMakeLists.txt` — builds upstream statically, then builds SWIG Python module
- `swig/pydigidoc.i` — thin wrapper: `%rename` for snake_case + `%include "libdigidocpp.i"`
- `src/pydigidoc/__init__.py` — re-exports SWIG symbols, wraps `initialize()` to use bundled schema files
Expand All @@ -13,8 +13,8 @@ Python bindings for [libdigidocpp](https://github.com/open-eid/libdigidocpp) via
## Key decisions

- **Static linking** (`BUILD_SHARED_LIBS=OFF`) — self-contained wheels, LGPL-2.1 compliance via RELINKING.md + sdist source
- **`ANDROID=TRUE` hack** in CMake — skips upstream `install(EXPORT)` which fails with static builds
- **Symlinks** (`etc/`, `cmake/`) created at configure time — upstream uses `CMAKE_SOURCE_DIR` which points to our root, not the submodule
- **`install()` override hack** — suppresses upstream install rules that fail on Windows static builds due to `$<TARGET_PDB_FILE:...>` on static targets. Remove when [#722](https://github.com/open-eid/libdigidocpp/pull/722) is merged.
- **`digidocpp_EXPORTS` hack** — defines `digidocpp_EXPORTS` on static targets so `Exports.h` doesn't default to `__declspec(dllimport)` on Windows. Remove when [#723](https://github.com/open-eid/libdigidocpp/pull/723) is merged.
- **SWIG `%rename` before `%include`** — order matters, upstream `.i` declares `%module(directors="1") digidoc`

## Test
Expand Down
23 changes: 0 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,6 @@ set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

# Upstream uses CMAKE_SOURCE_DIR for paths to etc/ and cmake/modules/.
# When included via add_subdirectory(), CMAKE_SOURCE_DIR is our root,
# not the submodule root. Create symlinks (or copies on Windows) so
# those references resolve.
foreach(_DIR etc cmake)
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/${_DIR})
if(WIN32)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/libdigidocpp/${_DIR}
DESTINATION ${CMAKE_SOURCE_DIR})
else()
file(CREATE_LINK
libdigidocpp/${_DIR}
${CMAKE_SOURCE_DIR}/${_DIR}
SYMBOLIC)
endif()
endif()
endforeach()

# Suppress upstream's SWIG/tools/framework/docs builds
set(CMAKE_DISABLE_FIND_PACKAGE_SWIG TRUE)
set(CMAKE_DISABLE_FIND_PACKAGE_Doxygen TRUE)
Expand All @@ -31,10 +13,6 @@ set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
set(BUILD_TOOLS OFF CACHE BOOL "" FORCE)
set(FRAMEWORK OFF CACHE BOOL "" FORCE)

# Skip upstream install(EXPORT) — fails with static builds because minizip
# and digidocpp_priv aren't in the export set. We don't need the export config.
set(ANDROID TRUE)

# On macOS, prefer Homebrew's libxml2 over Xcode SDK to avoid ABI mismatches.
# Homebrew xmlsec1 links Homebrew libxml2 2.15+, but CMake finds SDK libxml2 2.9;
# the ABI difference causes segfaults at runtime. Homebrew libxml2 is keg-only,
Expand Down Expand Up @@ -72,7 +50,6 @@ if(WIN32 AND NOT BUILD_SHARED_LIBS)
target_compile_definitions(digidocpp_util PUBLIC digidocpp_EXPORTS)
endif()

unset(ANDROID)
set(CMAKE_DISABLE_FIND_PACKAGE_SWIG FALSE)

# Verify upstream SWIG interface has the expected module declaration
Expand Down
2 changes: 1 addition & 1 deletion libdigidocpp
Submodule libdigidocpp updated 77 files
+56 −61 .github/workflows/build.yml
+14 −12 CMakeLists.txt
+19 −0 RELEASE-NOTES.md
+7 −4 build.ps1
+186 −69 etc/Doxyfile.in
+22 −22 etc/tl-mp3.crt
+39 −39 etc/tl-mp4.crt
+39 −39 etc/tl-mp5.crt
+44 −41 etc/tl-mp6.crt
+0 −45 etc/tl-mp7.crt
+0 −1 examples/CMakeLists.txt
+4 −4 examples/android/app/build.gradle
+1 −1 examples/android/build.gradle
+2 −2 libdigidocpp.wxs
+3 −5 prepare_osx_build_environment.sh
+13 −15 src/ASiC_E.cpp
+1 −1 src/ASiC_E.h
+6 −3 src/ASiC_S.cpp
+3 −45 src/ASiContainer.cpp
+1 −4 src/ASiContainer.h
+40 −31 src/CMakeLists.txt
+17 −6 src/Conf.cpp
+12 −5 src/Container.cpp
+45 −5 src/DataFile.cpp
+23 −15 src/DataFile_p.h
+8 −1 src/Exception.cpp
+45 −46 src/SiVaContainer.cpp
+1 −1 src/SiVaContainer.h
+75 −3 src/Signature.cpp
+1 −1 src/SignatureCAdES_B.cpp
+3 −18 src/SignatureTST.cpp
+0 −2 src/SignatureTST.h
+8 −5 src/SignatureXAdES_B.cpp
+1 −1 src/SignatureXAdES_B.h
+27 −46 src/SignatureXAdES_LTA.cpp
+2 −4 src/SignatureXAdES_LTA.h
+1 −1 src/SignatureXAdES_T.cpp
+47 −23 src/XMLDocument.h
+101 −4 src/XmlConf.cpp
+2 −2 src/crypto/Connect.cpp
+2 −1 src/crypto/Connect.h
+2 −23 src/crypto/Digest.cpp
+0 −1 src/crypto/Digest.h
+7 −6 src/crypto/OCSP.cpp
+7 −3 src/crypto/OpenSSLHelpers.h
+30 −19 src/crypto/PKCS11Signer.cpp
+4 −5 src/crypto/PKCS12Signer.cpp
+5 −0 src/crypto/Signer.cpp
+53 −56 src/crypto/TSL.cpp
+4 −5 src/crypto/TSL.h
+1 −0 src/crypto/WinSigner.cpp
+135 −46 src/crypto/X509Cert.cpp
+1 −0 src/crypto/X509Cert.h
+21 −15 src/crypto/X509CertStore.cpp
+3 −2 src/crypto/X509CertStore.h
+1 −2 src/crypto/X509Crypto.cpp
+7 −0 src/digidoc-tool.1.cmake
+18 −3 src/digidoc-tool.cpp
+16 −20 src/util/File.cpp
+0 −1 src/util/File.h
+41 −40 src/util/ZipSerialize.cpp
+41 −32 src/util/ZipSerialize.h
+1 −0 src/util/log.h
+5 −5 test/CMakeLists.txt
+11 −11 test/data/EE_T-no_QCStatement.xml
+19 −2 test/libdigidocpp_boost.cpp
+0 −168 vcpkg-ports/xmlsec/CMakeLists.txt
+0 −21 vcpkg-ports/xmlsec/pkgconfig_fixes.patch
+0 −34 vcpkg-ports/xmlsec/portfile.cmake
+0 −4 vcpkg-ports/xmlsec/unofficial-xmlsec-config.cmake
+0 −17 vcpkg-ports/xmlsec/usage
+0 −25 vcpkg-ports/xmlsec/vcpkg.json
+0 −10 vcpkg-ports/xmlsec/xmlsec-config.cmake
+0 −326 vcpkg-ports/xmlsec/xmlsec1-1.3.7.ecdsa-sig.patch
+0 −194 vcpkg-ports/xmlsec/xmlsec1-1.3.7.rsapss.patch
+11 −3 vcpkg.json
+0 −0 xmlsec1-1.3.5.legacy.patch
Loading