Skip to content

Commit

Permalink
Upgrade libs
Browse files Browse the repository at this point in the history
- OpenSSL 3.0.12
- Android NDK n26b
- xerces-c 3.2.5
- nlohmann/json 3.11.3

IB-7906, IB-7909, IB-7936, IB-7937

Signed-off-by: Raul Metsma <raul@metsma.ee>
  • Loading branch information
metsma committed Jan 1, 2024
1 parent 8a28362 commit 3f58ef6
Show file tree
Hide file tree
Showing 24 changed files with 1,241 additions and 790 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ jobs:
run: |
brew update
brew install doxygen boost xsd || brew link --overwrite xsd
brew unlink xerces-c python@3.10 python@3.11
brew unlink xerces-c
brew unlink python@3.10 || true
brew unlink python@3.11 || true
brew unlink python@3.12 || true
- name: Cache
uses: actions/cache@v3
id: cache
Expand Down Expand Up @@ -83,8 +86,7 @@ jobs:
- name: Install Deps
run: |
dnf install -y --setopt=install_weak_deps=False \
git gcc-c++ cmake rpm-build xml-security-c-devel zlib-devel vim-common doxygen boost-test swig python3-devel java-1.8.0-openjdk-devel \
https://www.codesynthesis.com/download/xsd/4.0/linux-gnu/x86_64/xsd-4.0.0-1.x86_64.rpm
git gcc-c++ cmake rpm-build xml-security-c-devel zlib-devel vim-common doxygen boost-test swig python3-devel java-1.8.0-openjdk-devel xsd
- name: Checkout
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -165,7 +167,7 @@ jobs:
- name: Prepare vcpkg X64
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: 6a349fe1fbea1e5fcda2e0775f555d829a5e82df
vcpkgGitCommitId: 8161f655436492669adc8eb6f269dc41392ffa70
vcpkgJsonGlob: ${{ steps.path.outputs.value }}/vcpkg.json
runVcpkgInstall: true
runVcpkgFormatString: "[`install`, `--recurse`, `--clean-after-build`, `--x-install-root`, `$[env.VCPKG_INSTALLED_DIR]`, `--triplet`, `$[env.VCPKG_DEFAULT_TRIPLET]`, `--x-feature`, `tests`]"
Expand All @@ -175,7 +177,7 @@ jobs:
- name: Prepare vcpkg X86
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: 6a349fe1fbea1e5fcda2e0775f555d829a5e82df
vcpkgGitCommitId: 8161f655436492669adc8eb6f269dc41392ffa70
vcpkgJsonGlob: ${{ steps.path.outputs.value }}/vcpkg.json
runVcpkgInstall: true
runVcpkgFormatString: "[`install`, `--recurse`, `--clean-after-build`, `--x-install-root`, `$[env.VCPKG_INSTALLED_DIR]`, `--triplet`, `$[env.VCPKG_DEFAULT_TRIPLET]`, `--x-feature`, `tests`]"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Ubuntu
sudo apt install cmake xxd libxml-security-c-dev xsdcxx libssl-dev zlib1g-dev
# Fedora
sudo dnf install cmake gcc-c++ openssl-devel xerces-c-devel xml-security-c-devel zlib-devel vim-common https://www.codesynthesis.com/download/xsd/4.0/linux-gnu/x86_64/xsd-4.0.0-1.x86_64.rpm
sudo dnf install cmake gcc-c++ openssl-devel xerces-c-devel xml-security-c-devel xsd zlib-devel vim-common

* doxygen - Optional, for API documentation
* libboost-test-dev - Optional, for unittests
Expand Down
4 changes: 2 additions & 2 deletions examples/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ apply plugin: 'com.android.application'
def libsPath = '/Library/libdigidocpp'

android {
compileSdk 33
compileSdk 34
defaultConfig {
applicationId "ee.ria.libdigidocpp"
minSdk 28
targetSdk 33
targetSdk 34
versionCode 1
versionName "1.0"
if (System.getenv("BUILD_NUMBER")) {
Expand Down
2 changes: 1 addition & 1 deletion examples/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.1.2'
classpath 'com.android.tools.build:gradle:8.2.0'
}
}

Expand Down
2 changes: 1 addition & 1 deletion examples/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip
8 changes: 4 additions & 4 deletions patches/vcpkg-ports/openssl/disable-install-docs.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
index 110ba06..5b6b1c7 100644
index a48fae5..c82c086 100644
--- a/Configurations/unix-Makefile.tmpl
+++ b/Configurations/unix-Makefile.tmpl
@@ -611,7 +611,7 @@ install_sw: install_dev install_engines install_modules install_runtime
Expand All @@ -10,12 +10,12 @@ index 110ba06..5b6b1c7 100644
+install_docs:

uninstall_docs: uninstall_man_docs uninstall_html_docs
$(RM) -r $(DESTDIR)$(DOCDIR)
$(RM) -r "$(DESTDIR)$(DOCDIR)"
diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl
index d054431..b5c1c88 100644
index 9250b98..2b63c85 100644
--- a/Configurations/windows-makefile.tmpl
+++ b/Configurations/windows-makefile.tmpl
@@ -487,7 +487,7 @@ install_sw: install_dev install_engines install_modules install_runtime
@@ -493,7 +493,7 @@ install_sw: install_dev install_engines install_modules install_runtime

uninstall_sw: uninstall_runtime uninstall_modules uninstall_engines uninstall_dev

Expand Down
2 changes: 1 addition & 1 deletion patches/vcpkg-ports/openssl/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO openssl/openssl
REF "openssl-${VERSION}"
SHA512 4dd485720a335879bd52d0045edf65fd8397b6f6b6afb3e2c756230937304975b3bd95f67933cadde175cae81d420a692fcf7e96b9f9d2b059ea387a8d9ac305
SHA512 8eb6141c1f3d43aa7dd5a5570c99302910feae0d25ab872c58432e5d11d3e330a069715fd4a0cd03234f3fb3e5e9fba38ef59977f7ecf162a2b048476dbb14c6
PATCHES
disable-apps.patch
disable-install-docs.patch
Expand Down
11 changes: 6 additions & 5 deletions patches/vcpkg-ports/openssl/unix/move-openssldir.patch
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
index dd96254..c4458ca 100644
index c82c086..6c5402d 100644
--- a/Configurations/unix-Makefile.tmpl
+++ b/Configurations/unix-Makefile.tmpl
@@ -689,6 +689,10 @@ install_ssldirs:
cp $(SRCDIR)/apps/ct_log_list.cnf $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf; \
chmod 644 $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf; \
@@ -690,6 +690,11 @@ install_ssldirs:
chmod 644 "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf"; \
fi

+ $(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)$(OPENSSLDIR)
+ for I in $(DESTDIR)$(OPENSSLDIR)/*; do \
+ mv $$I $(DESTDIR)$(INSTALLTOP)$(OPENSSLDIR)/; \
+ done
+
install_dev: install_runtime_libs
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
@$(ECHO) "*** Installing development files"
10 changes: 5 additions & 5 deletions patches/vcpkg-ports/openssl/unix/no-empty-dirs.patch
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
index 5b6b1c7..4c8c916 100644
index 6c5402d..fc982df 100644
--- a/Configurations/unix-Makefile.tmpl
+++ b/Configurations/unix-Makefile.tmpl
@@ -818,7 +818,7 @@ _install_modules_deps: install_runtime_libs build_modules
@@ -823,7 +823,7 @@ _install_modules_deps: install_runtime_libs build_modules

install_engines: _install_modules_deps
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
- @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(ENGINESDIR)/
- @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(ENGINESDIR)/"
+ @[ -z "$(INSTALL_ENGINES)" ] || $(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(ENGINESDIR)/
@$(ECHO) "*** Installing engines"
@set -e; for e in dummy $(INSTALL_ENGINES); do \
if [ "$$e" = "dummy" ]; then continue; fi; \
@@ -842,7 +842,7 @@ uninstall_engines:
@@ -847,7 +847,7 @@ uninstall_engines:

install_modules: _install_modules_deps
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
- @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(MODULESDIR)/
- @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(MODULESDIR)/"
+ @[ -z "$(INSTALL_MODULES)" ] || $(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(MODULESDIR)/
@$(ECHO) "*** Installing modules"
@set -e; for e in dummy $(INSTALL_MODULES); do \
Expand Down
10 changes: 5 additions & 5 deletions patches/vcpkg-ports/openssl/unix/no-static-libs-for-shared.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
index 4c8c916..dd96254 100644
index fc982df..10f1c54 100644
--- a/Configurations/unix-Makefile.tmpl
+++ b/Configurations/unix-Makefile.tmpl
@@ -708,6 +708,7 @@ install_dev: install_runtime_libs
@@ -713,6 +713,7 @@ install_dev: install_runtime_libs
done
@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(libdir)
@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(libdir)"
@set -e; for l in $(INSTALL_LIBS); do \
+ if [ -n "$(INSTALL_SHLIBS)" ] ; then continue ; fi ; \
+ if [ -n "$(INSTALL_SHLIBS)" ] ; then continue ; fi ; \
fn=`basename $$l`; \
$(ECHO) "install $$l -> $(DESTDIR)$(libdir)/$$fn"; \
cp $$l $(DESTDIR)$(libdir)/$$fn.new; \
cp $$l "$(DESTDIR)$(libdir)/$$fn.new"; \
3 changes: 2 additions & 1 deletion patches/vcpkg-ports/openssl/unix/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ vcpkg_list(SET MAKEFILE_OPTIONS)
if(VCPKG_TARGET_IS_ANDROID)
set(ENV{ANDROID_NDK_ROOT} "${VCPKG_DETECTED_CMAKE_ANDROID_NDK}")
set(OPENSSL_ARCH "android-${VCPKG_DETECTED_CMAKE_ANDROID_ARCH}")
if(VCPKG_DETECTED_CMAKE_ANDROID_ARCH STREQUAL "arm" AND NOT VCPKG_DETECTED_CMAKE_ANDROID_ARM_NEON)
# asm on arm32 NEON is broken, https://github.com/openssl/openssl/pull/21583#issuecomment-1727057735
if(VCPKG_DETECTED_CMAKE_ANDROID_ARCH STREQUAL "arm" #[[AND NOT VCPKG_DETECTED_CMAKE_ANDROID_ARM_NEON]])
vcpkg_list(APPEND CONFIGURE_OPTIONS no-asm)
endif()
elseif(VCPKG_TARGET_IS_LINUX)
Expand Down
2 changes: 1 addition & 1 deletion patches/vcpkg-ports/openssl/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openssl",
"version": "3.0.11",
"version": "3.0.12",
"description": "OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library.",
"homepage": "https://www.openssl.org",
"license": "Apache-2.0",
Expand Down
34 changes: 28 additions & 6 deletions patches/vcpkg-ports/openssl/windows/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,23 @@ vcpkg_find_acquire_program(PERL)
get_filename_component(PERL_EXE_PATH "${PERL}" DIRECTORY)
vcpkg_add_to_path("${PERL_EXE_PATH}")

vcpkg_cmake_get_vars(cmake_vars_file)
include("${cmake_vars_file}")

if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(OPENSSL_ARCH VC-WIN32)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(OPENSSL_ARCH VC-WIN64A)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
set(OPENSSL_ARCH VC-WIN32-ARM)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
set(OPENSSL_ARCH VC-WIN64-ARM)
if(VCPKG_TARGET_IS_UWP)
set(OPENSSL_ARCH VC-WIN64-ARM)
elseif(VCPKG_DETECTED_CMAKE_C_COMPILER_ID MATCHES "Clang")
set(OPENSSL_ARCH VC-CLANG-WIN64-CLANGASM-ARM)
else()
set(OPENSSL_ARCH VC-WIN64-CLANGASM-ARM)
endif()
else()
message(FATAL_ERROR "Unsupported target architecture: ${VCPKG_TARGET_ARCHITECTURE}")
endif()
Expand All @@ -33,17 +42,30 @@ endif()

cmake_path(NATIVE_PATH CURRENT_PACKAGES_DIR NORMALIZE install_dir_native)

vcpkg_cmake_get_vars(cmake_vars_file)
include("${cmake_vars_file}")

# Clang always uses /Z7; Patching /Zi /Fd<Name> out of openssl requires more work.
set(OPENSSL_BUILD_MAKES_PDBS ON)
if (VCPKG_DETECTED_CMAKE_C_COMPILER_ID MATCHES "Clang" OR VCPKG_LIBRARY_LINKAGE STREQUAL "static")
set(OPENSSL_BUILD_MAKES_PDBS OFF)
endif()

cmake_path(NATIVE_PATH NASM NORMALIZE as)
cmake_path(NATIVE_PATH VCPKG_DETECTED_CMAKE_C_COMPILER NORMALIZE cc)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" AND NOT VCPKG_TARGET_IS_UWP)
vcpkg_find_acquire_program(CLANG)
set(clang "${CLANG}")
cmake_path(GET clang PARENT_PATH clang_path)
vcpkg_add_to_path("${clang_path}")

set(as clang-cl)

vcpkg_list(APPEND CONFIGURE_OPTIONS "ASFLAGS=--target=aarch64-win32-msvc")
if(VCPKG_DETECTED_CMAKE_C_COMPILER_ID MATCHES "Clang")
string(APPEND VCPKG_COMBINED_C_FLAGS_DEBUG " --target=aarch64-win32-msvc")
string(APPEND VCPKG_COMBINED_C_FLAGS_RELEASE " --target=aarch64-win32-msvc")
endif()
else()
cmake_path(NATIVE_PATH NASM NORMALIZE as)
cmake_path(NATIVE_PATH VCPKG_DETECTED_CMAKE_C_COMPILER NORMALIZE cc)
endif()

cmake_path(NATIVE_PATH VCPKG_DETECTED_CMAKE_AR NORMALIZE ar)
cmake_path(NATIVE_PATH VCPKG_DETECTED_CMAKE_LINKER NORMALIZE ld)

Expand Down
77 changes: 77 additions & 0 deletions patches/vcpkg-ports/xerces-c/dependencies.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
diff --git a/cmake/XercesNetAccessorSelection.cmake b/cmake/XercesNetAccessorSelection.cmake
index 7a63f1f..22ea65b 100644
--- a/cmake/XercesNetAccessorSelection.cmake
+++ b/cmake/XercesNetAccessorSelection.cmake
@@ -23,7 +23,7 @@ option(network "Network support" ON)

if(network)
find_library(SOCKET_LIBRARY socket)
- find_library(NSL_LIBRARY nsl)
+ set(NSL_LIBRARY "" CACHE INTERNAL "Not used")

# netaccessors in order of preference

diff --git a/cmake/XercesTranscoderSelection.cmake b/cmake/XercesTranscoderSelection.cmake
index 4ff5b16..48e274c 100644
--- a/cmake/XercesTranscoderSelection.cmake
+++ b/cmake/XercesTranscoderSelection.cmake
@@ -25,6 +25,7 @@

if(ICU_FOUND)
list(APPEND transcoders icu)
+ set(TRANSCODER_REQUIRES "icu-uc")
endif()

# MacOS
@@ -41,6 +42,20 @@ endif()

# GNU iconv

+if(NOT transcoder AND NOT transcoders AND NOT WIN32)
+ find_package(Iconv)
+ set(FIND_DEPENDENCY_ICONV "${Iconv_FOUND}")
+ if(Iconv_FOUND AND NOT Iconv_IS_BUILT_IN)
+ list(APPEND libxerces_c_DEPS Iconv::Iconv)
+ set(TRANSCODER_LIBS "-liconv -lcharset")
+ list(APPEND CMAKE_REQUIRED_LIBRARIES Iconv::Iconv)
+ include(CheckSymbolExists)
+ check_symbol_exists(iconv_open "iconv.h" HAVE_ICONV_OPEN)
+ check_symbol_exists(iconv_close "iconv.h" HAVE_ICONV_CLOSE)
+ check_symbol_exists(iconv "iconv.h" HAVE_ICONV)
+ endif()
+endif()
+
check_include_file_cxx(iconv.h HAVE_ICONV_H)
check_include_file_cxx(wchar.h HAVE_WCHAR_H)
check_include_file_cxx(string.h HAVE_STRING_H)
diff --git a/src/XercesCConfig.cmake.in b/src/XercesCConfig.cmake.in
index aa8fc2e..754c425 100644
--- a/src/XercesCConfig.cmake.in
+++ b/src/XercesCConfig.cmake.in
@@ -1,5 +1,14 @@
@PACKAGE_INIT@

+include(CMakeFindDependencyMacro)
+find_dependency(Threads)
+if("@CMAKE_REQUIRE_FIND_PACKAGE_ICU@")
+ find_dependency(ICU COMPONENTS uc data)
+endif()
+if("@FIND_DEPENDENCY_ICONV@")
+ find_dependency(Iconv)
+endif()
+
include(${CMAKE_CURRENT_LIST_DIR}/XercesCConfigInternal.cmake)

add_library(XercesC::XercesC INTERFACE IMPORTED)
diff --git a/xerces-c.pc.in b/xerces-c.pc.in
index 16b18c7..077296b 100644
--- a/xerces-c.pc.in
+++ b/xerces-c.pc.in
@@ -7,5 +7,6 @@ Name: Xerces-C++
Description: Validating XML parser library for C++
Version: @VERSION@
Libs: -L${libdir} -lxerces-c
-Libs.private: @CURL_LIBS@
+Libs.private: @CURL_LIBS@ @TRANSCODER_LIBS@
+Requires.private: @TRANSCODER_REQUIRES@
Cflags: -I${includedir}
21 changes: 21 additions & 0 deletions patches/vcpkg-ports/xerces-c/disable-tests.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4254f89..aa08565 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -175,10 +175,16 @@ install(
COMPONENT "development")

# Process subdirectories
+if(NOT DISABLE_DOC)
add_subdirectory(doc)
+endif()
add_subdirectory(src)
+if(NOT DISABLE_TESTS)
add_subdirectory(tests)
+endif()
+if(NOT DISABLE_SAMPLES)
add_subdirectory(samples)
+endif()

# Display configuration summary
message(STATUS "")
Loading

0 comments on commit 3f58ef6

Please sign in to comment.