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

IB-7906, IB-7909

Signed-off-by: Raul Metsma <raul@metsma.ee>
  • Loading branch information
metsma committed Nov 30, 2023
1 parent 8a28362 commit 8dd1c61
Show file tree
Hide file tree
Showing 16 changed files with 68 additions and 45 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
4 changes: 2 additions & 2 deletions prepare_osx_build_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ XERCES_DIR=xerces-c-3.2.4
XALAN_DIR=xalan_c-1.12
XMLSEC_DIR=xml-security-c-2.0.4
XSD=xsd-4.0.0-i686-macosx
OPENSSL_DIR=openssl-3.0.11
OPENSSL_DIR=openssl-3.0.12
LIBXML2_DIR=libxml2-2.11.5
ANDROID_NDK=android-ndk-r26
ANDROID_NDK=android-ndk-r26b
FREETYPE_DIR=freetype-2.10.1
FONTCONFIG_DIR=fontconfig-2.13.1
PODOFO_DIR=podofo-0.9.4
Expand Down
3 changes: 0 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ if(NOT MINIZIP_FOUND)
target_compile_options(minizip PRIVATE $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-unused-parameter -Wno-unused-value>)
set_target_properties(minizip PROPERTIES COMPILE_DEFINITIONS "NOUNCRYPT;NOCRYPT" POSITION_INDEPENDENT_CODE YES)
target_link_libraries(minizip ZLIB::ZLIB)
if(ANDROID)
set_property(SOURCE minizip/ioapi.c APPEND PROPERTY COMPILE_DEFINITIONS IOAPI_NO_64)
endif()
else()
add_library(minizip INTERFACE)
target_link_libraries(minizip INTERFACE PkgConfig::MINIZIP)
Expand Down
4 changes: 2 additions & 2 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "libdigidocpp",
"version": "3.16.0",
"version": "3.17.0",
"dependencies": [
"xml-security-c",
"zlib"
],
"features": {
"tests": { "description": "Build tests", "dependencies": ["boost-test"] }
},
"builtin-baseline": "6a349fe1fbea1e5fcda2e0775f555d829a5e82df",
"builtin-baseline": "8161f655436492669adc8eb6f269dc41392ffa70",
"vcpkg-configuration": {
"overlay-triplets": ["./patches/vcpkg-triplets"],
"overlay-ports": [
Expand Down

0 comments on commit 8dd1c61

Please sign in to comment.