Skip to content

Commit a140a47

Browse files
committed
Add Visual Studio 2026 build and update libs
- OpenSSL 3.5.6 - xmlsec1 1.3.11 - zlib 1.3.2 IB-8886, IB-8845 Signed-off-by: Raul Metsma <raul@metsma.ee>
1 parent 68ec5bf commit a140a47

20 files changed

Lines changed: 346 additions & 273 deletions

.github/workflows/build.yml

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ jobs:
1414
runs-on: macos-latest
1515
strategy:
1616
matrix:
17-
target: [macos, iphoneos, iphonesimulator]
17+
include:
18+
- target: macos
19+
- target: iphoneos
20+
triplet: arm64-ios
21+
- target: iphonesimulator
22+
triplet: arm64-x64-ios-simulator
1823
steps:
1924
- name: Checkout
2025
uses: actions/checkout@v6
@@ -29,39 +34,50 @@ jobs:
2934
sudo rm -rf /Library/Frameworks/Python.framework/Versions/3.13
3035
sudo rm -rf /Library/Frameworks/Python.framework/Versions/3.14
3136
- name: Cache
37+
if: matrix.target == 'macos'
3238
uses: actions/cache@v5
3339
id: cache
3440
with:
3541
path: cache
3642
key: ${{ matrix.target }}-${{ hashFiles('prepare_osx_build_environment.sh') }}
43+
- name: Cache vcpkg
44+
if: matrix.target != 'macos'
45+
uses: actions/cache@v5
46+
with:
47+
path: ${{ github.workspace }}/vcpkg_cache
48+
key: vcpkg-${{ matrix.target }}-${{ hashFiles('vcpkg.json') }}
3749
- name: Build openssl
38-
if: steps.cache.outputs.cache-hit != 'true'
50+
if: matrix.target == 'macos' && steps.cache.outputs.cache-hit != 'true'
3951
run: ./prepare_osx_build_environment.sh openssl ${{ matrix.target }}
4052
- name: Build xmlsec
41-
if: steps.cache.outputs.cache-hit != 'true'
53+
if: matrix.target == 'macos' && steps.cache.outputs.cache-hit != 'true'
4254
run: ./prepare_osx_build_environment.sh xmlsec ${{ matrix.target }}
4355
- name: Move to cache
44-
if: steps.cache.outputs.cache-hit != 'true'
56+
if: matrix.target == 'macos' && steps.cache.outputs.cache-hit != 'true'
4557
run: |
4658
mkdir cache
4759
sudo mv /Library/libdigidocpp* cache
48-
- name: Setup cache
49-
run: sudo ln -s $PWD/cache/* /Library/
5060
- name: Build macOS
5161
if: matrix.target == 'macos'
5262
run: |
63+
sudo ln -s $PWD/cache/* /Library/
5364
cmake --preset ${{ matrix.target }} -DCMAKE_BUILD_TYPE=RelWithDebInfo
5465
cmake --build --preset ${{ matrix.target }}
55-
cmake --build --preset ${{ matrix.target }} --target test pkcs11sign embedlibs
66+
cmake --build --preset ${{ matrix.target }} --target test pkcs11sign embedlibs
5667
cmake --build --preset ${{ matrix.target }} --target zipdebug pkgbuild
5768
- name: Build ${{ matrix.target }}
5869
if: matrix.target != 'macos'
70+
env:
71+
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
5972
run: |
73+
export VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT
6074
cmake --preset ${{ matrix.target }} -DCMAKE_BUILD_TYPE=RelWithDebInfo
6175
cmake --build --preset ${{ matrix.target }}
62-
sudo cmake --build --preset ${{ matrix.target }} --target install/strip
63-
cd /Library
64-
zip -q -r ${OLDPWD}/libdigidocpp.${{ matrix.target }}.zip libdigidocpp.*
76+
cmake --build --preset ${{ matrix.target }} --target install/strip
77+
mkdir -p libdigidocpp.${{ matrix.target }}/include
78+
cp build/${{ matrix.target }}/vcpkg_installed/${{ matrix.triplet }}/lib/{libcrypto,libssl}.a libdigidocpp.${{ matrix.target }}/lib/
79+
cp -r build/${{ matrix.target }}/vcpkg_installed/${{ matrix.triplet }}/include/openssl libdigidocpp.${{ matrix.target }}/include/
80+
zip -q -r libdigidocpp.${{ matrix.target }}.zip libdigidocpp.${{ matrix.target }}
6581
- name: Archive artifacts
6682
uses: actions/upload-artifact@v6
6783
with:
@@ -88,14 +104,16 @@ jobs:
88104
uses: actions/cache@v5
89105
with:
90106
path: ${{ github.workspace }}/vcpkg_cache
91-
key: vcpkg-${{ matrix.target }}-${{ hashFiles('vcpkg.json', 'vcpkg-ports/**') }}
107+
key: vcpkg-${{ matrix.target }}-${{ hashFiles('vcpkg.json') }}
92108
- name: Build
93109
env:
94110
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
95111
run: |
96112
export VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT
97113
export ANDROID_NDK_HOME=$ANDROID_NDK_LATEST_HOME
98114
export ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME
115+
git -C $VCPKG_INSTALLATION_ROOT fetch origin f77737496dabd44c63ecc599dc0f4d6cff30d0d5
116+
git -C $VCPKG_INSTALLATION_ROOT reset --hard f77737496dabd44c63ecc599dc0f4d6cff30d0d5
99117
cmake --preset ${{ matrix.target }} "-GUnix Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo
100118
cmake --build --preset ${{ matrix.target }}
101119
cmake --build --preset ${{ matrix.target }} --target install/strip
@@ -151,6 +169,9 @@ jobs:
151169
steps:
152170
- name: Install dependencies
153171
run: |
172+
for f in /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources; do
173+
[ -f "$f" ] && sed -i 's|http://archive.ubuntu.com|http://azure.archive.ubuntu.com|g; s|http://security.ubuntu.com|http://azure.archive.ubuntu.com|g' "$f"
174+
done
154175
echo 'path-exclude=/usr/share/man/*' > /etc/dpkg/dpkg.cfg.d/99-nodocs
155176
echo 'path-exclude=/usr/share/doc/*' >> /etc/dpkg/dpkg.cfg.d/99-nodocs
156177
echo 'path-exclude=/usr/share/doc-base/*' >> /etc/dpkg/dpkg.cfg.d/99-nodocs
@@ -175,10 +196,10 @@ jobs:
175196
path: libdigidocpp*.*
176197
windows:
177198
name: Build on Windows
178-
runs-on: windows-2025
199+
runs-on: windows-2025${{ matrix.toolset == '145' && '-vs2026' || '' }}
179200
strategy:
180201
matrix:
181-
toolset: [143]
202+
toolset: [143, 145]
182203
platform: [x86, x64, arm64]
183204
include:
184205
- platform: x86
@@ -200,7 +221,7 @@ jobs:
200221
uses: actions/cache@v5
201222
with:
202223
path: ${{ github.workspace }}/vcpkg_cache
203-
key: vcpkg-${{ matrix.toolset }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json', 'vcpkg-ports/**') }}
224+
key: vcpkg-${{ matrix.toolset }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json') }}
204225
- name: Install dependencies
205226
run: winget install --silent --accept-source-agreements --accept-package-agreements swig doxygen 9NQ7512CXL7T
206227
- uses: actions/setup-java@v5
@@ -213,8 +234,9 @@ jobs:
213234
run: |
214235
& "$env:LOCALAPPDATA\Microsoft\WindowsApps\py.exe" install --target=.\python\${{ matrix.platform }} 3.13-${{ matrix.python }}
215236
$swig = (Get-Item "$env:LOCALAPPDATA\Microsoft\WinGet\Links\swig.exe").Target
216-
& "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat" ${{ matrix.setenv }} "&&" pwsh build.ps1 `
217-
-vcpkg "C:/vcpkg/vcpkg.exe" `
237+
$vsPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
238+
& "$vsPath\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.setenv }} "&&" pwsh build.ps1 `
239+
-vcpkg "C:/vcpkg" `
218240
-swig $swig `
219241
-doxygen "C:/Program files/doxygen/bin/doxygen.exe" `
220242
-boost `

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ endif()
55
if(POLICY CMP0177)
66
cmake_policy(SET CMP0177 NEW)
77
endif()
8-
project(libdigidocpp VERSION 4.4.0
8+
project(libdigidocpp VERSION 4.5.0
99
DESCRIPTION "C++ library for digital signatures and validation of digitally signed documents"
1010
HOMEPAGE_URL https://github.com/open-eid/libdigidocpp
1111
)

CMakePresets.json

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,24 @@
3636
"inherits": "default",
3737
"installDir": "$env{DEST}",
3838
"environment": {
39-
"DEST": "libdigidocpp$env{DEST_SUFFIX}",
39+
"DEST": "${sourceDir}/libdigidocpp$env{DEST_SUFFIX}",
4040
"DEST_SUFFIX": ".${presetName}"
4141
},
4242
"cacheVariables": {
4343
"CMAKE_DISABLE_FIND_PACKAGE_Boost": "YES",
4444
"CMAKE_DISABLE_FIND_PACKAGE_Doxygen": "YES",
45-
"BUILD_TOOLS": "NO"
45+
"BUILD_TOOLS": "NO",
46+
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
4647
}
4748
},
4849
{
4950
"name": "ios",
5051
"hidden": true,
51-
"inherits": ["macos", "mobile"],
52+
"inherits": ["mobile","macos"],
5253
"cacheVariables": {
5354
"CMAKE_SYSTEM_NAME": "iOS",
5455
"CMAKE_OSX_SYSROOT": "${presetName}",
55-
"CMAKE_OSX_DEPLOYMENT_TARGET": "15.0",
56+
"CMAKE_OSX_DEPLOYMENT_TARGET": "16.0",
5657
"CMAKE_DISABLE_FIND_PACKAGE_SWIG": "YES",
5758
"FRAMEWORK_DESTINATION": "$env{DEST}/lib"
5859
}
@@ -62,20 +63,25 @@
6263
"inherits": "ios",
6364
"description": "This iphoneos build is only available on macOS",
6465
"cacheVariables": {
65-
"CMAKE_OSX_ARCHITECTURES": "arm64"
66+
"CMAKE_OSX_ARCHITECTURES": "arm64",
67+
"VCPKG_TARGET_TRIPLET": "arm64-ios"
6668
}
6769
},
6870
{
6971
"name": "iphonesimulator",
7072
"inherits": "ios",
71-
"description": "This iphonesimulator build is only available on macOS"
73+
"description": "This iphonesimulator build is only available on macOS",
74+
"cacheVariables": {
75+
"VCPKG_TARGET_TRIPLET": "arm64-x64-ios-simulator"
76+
}
7277
},
7378
{
7479
"name": "iphonecatalyst",
7580
"inherits": "ios",
7681
"description": "This iphonecatalyst build is only available on macOS",
7782
"cacheVariables": {
78-
"CMAKE_OSX_SYSROOT": "macosx"
83+
"CMAKE_OSX_SYSROOT": "macosx",
84+
"VCPKG_TARGET_TRIPLET": "arm64-x64-ios-catalyst"
7985
}
8086
},
8187
{
@@ -86,8 +92,7 @@
8692
"CMAKE_SYSTEM_NAME": "Android",
8793
"CMAKE_SYSTEM_VERSION": "30",
8894
"CMAKE_DISABLE_FIND_PACKAGE_Python3": "YES",
89-
"BUILD_SHARED_LIBS": "NO",
90-
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
95+
"BUILD_SHARED_LIBS": "NO"
9196
}
9297
},
9398
{
@@ -116,6 +121,17 @@
116121
"CMAKE_ANDROID_ARCH_ABI": "x86_64",
117122
"VCPKG_TARGET_TRIPLET": "x64-android"
118123
}
124+
},
125+
{
126+
"name": "windows",
127+
"displayName": "Windows",
128+
"binaryDir": "${sourceDir}/build/windows-$env{PLATFORM}",
129+
"cacheVariables": {
130+
"CMAKE_INSTALL_BINDIR": ".",
131+
"CMAKE_INSTALL_LIBDIR": ".",
132+
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
133+
"VCPKG_TARGET_TRIPLET": "$env{PLATFORM}-windows"
134+
}
119135
}
120136
],
121137
"buildPresets":
@@ -147,6 +163,10 @@
147163
{
148164
"name": "androidx86_64",
149165
"configurePreset": "androidx86_64"
166+
},
167+
{
168+
"name": "windows",
169+
"configurePreset": "windows"
150170
}
151171
]
152172
}

build.ps1

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@ param(
33
[string]$libdigidocpp = $PSScriptRoot,
44
[string]$platform = $env:PLATFORM,
55
[string]$build_number = $(if ($null -eq $env:BUILD_NUMBER) {"0"} else {$env:BUILD_NUMBER}),
6-
[string]$msiversion = "4.4.0.$build_number",
6+
[string]$msiversion = (Select-String -Path "$libdigidocpp/CMakeLists.txt" -Pattern 'project\(\w+ VERSION (\S+)').Matches[0].Groups[1].Value + ".$build_number",
77
[string]$msi_name = "libdigidocpp-$msiversion$env:VER_SUFFIX.$platform.msi",
88
[string]$git = "git.exe",
9-
[string]$vcpkg = "vcpkg\vcpkg.exe",
10-
[string]$vcpkg_dir = (split-path -parent $vcpkg),
11-
[string]$vcpkg_installed = $libdigidocpp,
12-
[string]$vcpkg_installed_platform = "$vcpkg_installed\vcpkg_installed_$platform",
9+
[string]$vcpkg = $env:VCPKG_ROOT,
10+
[string]$vcpkg_installed = $null,
11+
[string]$vcpkg_installed_platform = $(if($vcpkg_installed) { "$vcpkg_installed\vcpkg_installed_$platform" } else { "$libdigidocpp\build\windows-$platform\vcpkg_installed" }),
1312
[string]$vcpkg_triplet = "$platform-windows",
13+
[string]$installdir = "$libdigidocpp\build\windows-$platform\install",
1414
[string]$cmake = "cmake.exe",
15-
[string]$generator = "NMake Makefiles",
1615
[string]$swig = $null,
1716
[string]$doxygen = $null,
1817
[switch]$boost = $false,
@@ -29,8 +28,9 @@ Catch {
2928
}
3029

3130
if(!(Test-Path -Path $vcpkg)) {
32-
& $git clone https://github.com/microsoft/vcpkg $vcpkg_dir
33-
& $vcpkg_dir\bootstrap-vcpkg.bat
31+
$vcpkg = "$libdigidocpp\vcpkg"
32+
& $git clone https://github.com/microsoft/vcpkg $vcpkg
33+
& $vcpkg\bootstrap-vcpkg.bat
3434
}
3535

3636
$cmakeext = @()
@@ -54,21 +54,19 @@ if($python) {
5454
$cmakeext += "-DPython3_ROOT_DIR=$python/$platform"
5555
$wixext += "-d", "python=1"
5656
}
57+
if($vcpkg_installed) {
58+
$cmakeext += "-DVCPKG_INSTALLED_DIR=$vcpkg_installed_platform"
59+
}
60+
$env:PLATFORM = $platform
61+
$env:VCPKG_ROOT = $vcpkg
5762

63+
Push-Location $libdigidocpp
64+
& $cmake --fresh --preset windows "-GNinja Multi-Config" $cmakeext "-DCMAKE_INSTALL_PREFIX=$installdir" "-DSIGNCERT=$sign"
5865
foreach($type in @("Debug", "RelWithDebInfo")) {
59-
$buildpath = $platform+$type
60-
& $cmake --fresh -B $buildpath -S $libdigidocpp "-G$generator" $cmakeext `
61-
"-DCMAKE_BUILD_TYPE=$type" `
62-
"-DCMAKE_INSTALL_PREFIX=$platform" `
63-
"-DCMAKE_INSTALL_BINDIR=." `
64-
"-DCMAKE_INSTALL_LIBDIR=." `
65-
"-DCMAKE_TOOLCHAIN_FILE=$vcpkg_dir/scripts/buildsystems/vcpkg.cmake" `
66-
"-DVCPKG_INSTALLED_DIR=$vcpkg_installed_platform" `
67-
"-DVCPKG_TARGET_TRIPLET=$vcpkg_triplet" `
68-
"-DSIGNCERT=$sign"
69-
& $cmake --build $buildpath --target $target
70-
& $cmake --install $buildpath
66+
& $cmake --build --preset windows --config $type --target $target
67+
& $cmake --build --preset windows --config $type --target install
7168
}
69+
Pop-Location
7270

7371
if($sign) {
7472
& signtool.exe sign /a /v /s MY /n "$sign" /fd SHA256 /du http://installer.id.ee `
@@ -77,7 +75,7 @@ if($sign) {
7775
$vcpkg_installed_platform/$vcpkg_triplet/debug/bin/*.dll
7876
}
7977

80-
$docLocation = "$(Get-Location)/$platform/share/doc/libdigidocpp"
78+
$docLocation = "$installdir/share/doc/libdigidocpp"
8179
if (Test-Path -Path $docLocation -PathType Container) {
8280
$wixext += "-d", "docLocation=$docLocation"
8381
}
@@ -88,7 +86,7 @@ if (Test-Path -Path $docLocation -PathType Container) {
8886
-bv "WixUIDialogBmp=$libdigidocpp/dlgbmp.bmp" `
8987
-d "ICON=$libdigidocpp/ID.ico" `
9088
-d "vcpkg=$vcpkg_installed_platform/$vcpkg_triplet" `
91-
-d "libdigidocpp=$(Get-Location)/$platform" `
89+
-d "libdigidocpp=$installdir" `
9290
$libdigidocpp\libdigidocpp.wxs
9391

9492
if($sign) {

0 commit comments

Comments
 (0)