Skip to content

Commit 986b317

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 986b317

18 files changed

Lines changed: 320 additions & 247 deletions

.github/workflows/build.yml

Lines changed: 50 additions & 15 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,56 @@ 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') }}
49+
- name: Fetch vcpkg baseline
50+
if: matrix.target != 'macos'
51+
run: |
52+
export VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT
53+
cd $VCPKG_ROOT
54+
git fetch origin f77737496dabd44c63ecc599dc0f4d6cff30d0d5
3755
- name: Build openssl
38-
if: steps.cache.outputs.cache-hit != 'true'
56+
if: matrix.target == 'macos' && steps.cache.outputs.cache-hit != 'true'
3957
run: ./prepare_osx_build_environment.sh openssl ${{ matrix.target }}
4058
- name: Build xmlsec
41-
if: steps.cache.outputs.cache-hit != 'true'
59+
if: matrix.target == 'macos' && steps.cache.outputs.cache-hit != 'true'
4260
run: ./prepare_osx_build_environment.sh xmlsec ${{ matrix.target }}
4361
- name: Move to cache
44-
if: steps.cache.outputs.cache-hit != 'true'
62+
if: matrix.target == 'macos' && steps.cache.outputs.cache-hit != 'true'
4563
run: |
4664
mkdir cache
4765
sudo mv /Library/libdigidocpp* cache
48-
- name: Setup cache
49-
run: sudo ln -s $PWD/cache/* /Library/
5066
- name: Build macOS
5167
if: matrix.target == 'macos'
5268
run: |
69+
sudo ln -s $PWD/cache/* /Library/
5370
cmake --preset ${{ matrix.target }} -DCMAKE_BUILD_TYPE=RelWithDebInfo
5471
cmake --build --preset ${{ matrix.target }}
55-
cmake --build --preset ${{ matrix.target }} --target test pkcs11sign embedlibs
72+
cmake --build --preset ${{ matrix.target }} --target test pkcs11sign embedlibs
5673
cmake --build --preset ${{ matrix.target }} --target zipdebug pkgbuild
5774
- name: Build ${{ matrix.target }}
5875
if: matrix.target != 'macos'
76+
env:
77+
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
5978
run: |
79+
export VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT
6080
cmake --preset ${{ matrix.target }} -DCMAKE_BUILD_TYPE=RelWithDebInfo
6181
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.*
82+
cmake --build --preset ${{ matrix.target }} --target install/strip
83+
mkdir -p libdigidocpp.${{ matrix.target }}/include
84+
cp build/${{ matrix.target }}/vcpkg_installed/${{ matrix.triplet }}/lib/{libcrypto,libssl}.a libdigidocpp.${{ matrix.target }}/lib/
85+
cp -r build/${{ matrix.target }}/vcpkg_installed/${{ matrix.triplet }}/include/openssl libdigidocpp.${{ matrix.target }}/include/
86+
zip -q -r libdigidocpp.${{ matrix.target }}.zip libdigidocpp.${{ matrix.target }}
6587
- name: Archive artifacts
6688
uses: actions/upload-artifact@v6
6789
with:
@@ -88,7 +110,12 @@ jobs:
88110
uses: actions/cache@v5
89111
with:
90112
path: ${{ github.workspace }}/vcpkg_cache
91-
key: vcpkg-${{ matrix.target }}-${{ hashFiles('vcpkg.json', 'vcpkg-ports/**') }}
113+
key: vcpkg-${{ matrix.target }}-${{ hashFiles('vcpkg.json') }}
114+
- name: Fetch vcpkg baseline
115+
run: |
116+
export VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT
117+
cd $VCPKG_ROOT
118+
git fetch origin f77737496dabd44c63ecc599dc0f4d6cff30d0d5
92119
- name: Build
93120
env:
94121
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
@@ -151,6 +178,9 @@ jobs:
151178
steps:
152179
- name: Install dependencies
153180
run: |
181+
for f in /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources; do
182+
[ -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"
183+
done
154184
echo 'path-exclude=/usr/share/man/*' > /etc/dpkg/dpkg.cfg.d/99-nodocs
155185
echo 'path-exclude=/usr/share/doc/*' >> /etc/dpkg/dpkg.cfg.d/99-nodocs
156186
echo 'path-exclude=/usr/share/doc-base/*' >> /etc/dpkg/dpkg.cfg.d/99-nodocs
@@ -175,10 +205,10 @@ jobs:
175205
path: libdigidocpp*.*
176206
windows:
177207
name: Build on Windows
178-
runs-on: windows-2025
208+
runs-on: windows-2025${{ matrix.toolset == '145' && '-vs2026' || '' }}
179209
strategy:
180210
matrix:
181-
toolset: [143]
211+
toolset: [143, 145]
182212
platform: [x86, x64, arm64]
183213
include:
184214
- platform: x86
@@ -200,7 +230,11 @@ jobs:
200230
uses: actions/cache@v5
201231
with:
202232
path: ${{ github.workspace }}/vcpkg_cache
203-
key: vcpkg-${{ matrix.toolset }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json', 'vcpkg-ports/**') }}
233+
key: vcpkg-${{ matrix.toolset }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json') }}
234+
- name: Fetch vcpkg baseline
235+
run: |
236+
cd C:\vcpkg
237+
git fetch origin f77737496dabd44c63ecc599dc0f4d6cff30d0d5
204238
- name: Install dependencies
205239
run: winget install --silent --accept-source-agreements --accept-package-agreements swig doxygen 9NQ7512CXL7T
206240
- uses: actions/setup-java@v5
@@ -213,7 +247,8 @@ jobs:
213247
run: |
214248
& "$env:LOCALAPPDATA\Microsoft\WindowsApps\py.exe" install --target=.\python\${{ matrix.platform }} 3.13-${{ matrix.python }}
215249
$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 `
250+
$vsPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
251+
& "$vsPath\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.setenv }} "&&" pwsh build.ps1 `
217252
-vcpkg "C:/vcpkg/vcpkg.exe" `
218253
-swig $swig `
219254
-doxygen "C:/Program files/doxygen/bin/doxygen.exe" `

CMakePresets.json

Lines changed: 14 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
{

examples/android/app/build.gradle

Lines changed: 52 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
apply plugin: 'com.android.application'
22

3-
def libsPath = '/Library/libdigidocpp'
3+
def projectRoot = rootDir.parentFile.parentFile.absolutePath
4+
def cmakeInstall = "${projectDir}/build/cmake"
5+
6+
def localProps = new Properties()
7+
def localPropsFile = rootDir.toPath().resolve('local.properties').toFile()
8+
if (localPropsFile.exists()) localProps.load(localPropsFile.newDataInputStream())
9+
def cmake = localProps.getProperty('cmake') ?: {
10+
def sdkCmake = new File(localProps.getProperty('sdk.dir', ''), 'cmake')
11+
sdkCmake.listFiles()?.collect { new File(it, 'bin/cmake') }?.find { it.exists() }?.absolutePath ?: 'cmake'
12+
}()
413

514
android {
615
compileSdk = 36
@@ -14,7 +23,6 @@ android {
1423
versionCode Integer.parseInt(System.getenv("BUILD_NUMBER"))
1524
versionName "1.0." + System.getenv("BUILD_NUMBER")
1625
}
17-
setProperty("archivesBaseName", "libdigidocpp-android-$versionName")
1826
}
1927
buildTypes {
2028
release {
@@ -26,33 +34,59 @@ android {
2634
targetCompatibility JavaVersion.VERSION_17
2735
sourceCompatibility JavaVersion.VERSION_17
2836
}
29-
sourceSets.main.java.srcDirs += [libsPath + '.androidarm64/include']
37+
sourceSets.main.java.srcDirs += ["${cmakeInstall}/androidarm64/include"]
3038
namespace 'ee.ria.libdigidocpp'
3139
}
3240

41+
def versionNameValue = System.getenv("BUILD_NUMBER") ? "1.0.${System.getenv('BUILD_NUMBER')}" : "1.0"
42+
43+
androidComponents {
44+
onVariants(selector().all()) { variant ->
45+
variant.outputs.forEach { output ->
46+
output.outputFileName.set("libdigidocpp-android-${versionNameValue}.apk")
47+
}
48+
}
49+
}
50+
51+
[[preset: 'androidarm', jniDir: 'armeabi-v7a'],
52+
[preset: 'androidarm64', jniDir: 'arm64-v8a'],
53+
[preset: 'androidx86_64', jniDir: 'x86_64']].each { cfg ->
54+
55+
def configureTask = tasks.register("cmakeConfigure_${cfg.preset}", Exec) {
56+
inputs.files("${projectRoot}/CMakePresets.json", "${projectRoot}/CMakeLists.txt", "${projectRoot}/vcpkg.json")
57+
outputs.dir("${projectRoot}/build/${cfg.preset}")
58+
workingDir projectRoot
59+
commandLine cmake, '--preset', cfg.preset,
60+
'-DCMAKE_BUILD_TYPE=RelWithDebInfo',
61+
"-DCMAKE_INSTALL_PREFIX=${cmakeInstall}/${cfg.preset}"
62+
}
63+
64+
tasks.register("cmakeBuild_${cfg.preset}", Exec) {
65+
dependsOn configureTask
66+
inputs.dir("${projectRoot}/build/${cfg.preset}")
67+
outputs.dir("${cmakeInstall}/${cfg.preset}")
68+
workingDir projectRoot
69+
commandLine cmake, '--build', '--preset', cfg.preset, '--target', 'install'
70+
}
71+
72+
tasks.register("copyLib_${cfg.preset}", Copy) {
73+
dependsOn "cmakeBuild_${cfg.preset}"
74+
from "${cmakeInstall}/${cfg.preset}/lib/libdigidoc_java.so"
75+
into "src/main/jniLibs/${cfg.jniDir}"
76+
}
77+
}
78+
3379
tasks.register('schemaZip', Zip) {
34-
println "Create schema zip"
35-
from(libsPath + '.androidarm/etc/digidocpp/schema/') {
80+
dependsOn 'cmakeBuild_androidarm'
81+
from("${cmakeInstall}/androidarm/etc/digidocpp/schema/") {
3682
include '*'
3783
}
3884
destinationDirectory = file('src/main/res/raw/')
3985
archiveFileName = 'schema.zip'
4086
}
4187

4288
tasks.register('copyLibs') {
43-
println "Copy jniLibs"
44-
copy {
45-
from libsPath + '.androidarm/lib/libdigidoc_java.so'
46-
into 'src/main/jniLibs/armeabi-v7a'
47-
}
48-
copy {
49-
from libsPath + '.androidarm64/lib/libdigidoc_java.so'
50-
into 'src/main/jniLibs/arm64-v8a'
51-
}
52-
copy {
53-
from libsPath + '.androidx86_64/lib/libdigidoc_java.so'
54-
into 'src/main/jniLibs/x86_64'
55-
}
89+
dependsOn 'copyLib_androidarm', 'copyLib_androidarm64', 'copyLib_androidx86_64'
5690
}
5791

5892
preBuild.dependsOn schemaZip, copyLibs

examples/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
mavenCentral()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:8.13.0'
8+
classpath 'com.android.tools.build:gradle:9.1.1'
99
}
1010
}
1111

examples/android/gradle.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,7 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
1717
android.useAndroidX=true
1818
org.gradle.unsafe.configuration-cache=true
1919
android.nonTransitiveRClass=true
20-
android.nonFinalResIds=true
20+
android.nonFinalResIds=true
21+
android.uniquePackageNames=false
22+
android.dependency.useConstraints=true
23+
android.r8.strictFullModeForKeepRules=false
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#This file is generated by updateDaemonJvm
2+
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/56a19bc915b9ba2eb62ba7554c61b919/redirect
3+
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/398ffe3949748bfb1d5636f023d228fd/redirect
4+
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/56a19bc915b9ba2eb62ba7554c61b919/redirect
5+
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/398ffe3949748bfb1d5636f023d228fd/redirect
6+
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/e99bae143b75f9a10ead10248f02055e/redirect
7+
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/04e088f8677de3b384108493cc9481d0/redirect
8+
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/56a19bc915b9ba2eb62ba7554c61b919/redirect
9+
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/398ffe3949748bfb1d5636f023d228fd/redirect
10+
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/e55dccbfe27cb97945148c61a39c89c5/redirect
11+
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/dbd05c4936d573642f94cd149e1356c8/redirect
12+
toolchainVendor=JETBRAINS
13+
toolchainVersion=21

examples/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-all.zip

examples/android/settings.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
plugins {
2+
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.10.0'
3+
}
14
dependencyResolutionManagement {
25
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
36
repositories {

examples/ios/README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@
33
### macOS
44

55
1. Install dependencies see [README.md](../../README.md#macOS)
6-
2. Build example
6+
2. Build example and run on simulator
77

8-
xcodebuild -project libdigidocpp.xcodeproj
9-
10-
3. Execute
11-
12-
Open Xcode project and run on simulator
8+
xcodebuild -project libdigidocpp.xcodeproj -sdk iphonesimulator
139

10+
Or open the Xcode project and run on a simulator or device directly.
1411

1512
AppDelegate.mm contains how to override digidoc::XmlConf to point right cache folder for TSL lists.

0 commit comments

Comments
 (0)