Skip to content

Commit c178518

Browse files
committed
Build windows Arm64 binaries
IB-6662 Signed-off-by: Raul Metsma <[email protected]>
1 parent a3955d7 commit c178518

File tree

10 files changed

+127
-119
lines changed

10 files changed

+127
-119
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
with:
5050
version: 6.10.1
5151
arch: clang_64
52+
cache: true
5253
- name: Build
5354
run: |
5455
cmake "-GNinja" -B build -S . -DCMAKE_BUILD_TYPE=RelWithDebInfo \
@@ -70,7 +71,7 @@ jobs:
7071
container: ubuntu:${{ matrix.container }}
7172
strategy:
7273
matrix:
73-
container: ['22.04', '24.04', '25.04', '25.10']
74+
container: ['22.04', '24.04', '25.10']
7475
arch: ['amd64', 'arm64']
7576
env:
7677
DEBIAN_FRONTEND: noninteractive
@@ -140,10 +141,11 @@ jobs:
140141
path: build/qdigidoc4*.rpm
141142
windows:
142143
name: Build on Windows
143-
runs-on: windows-2025
144+
runs-on: ${{ matrix.platform == 'arm64' && 'windows-11-arm' || 'windows-2025' }}
144145
strategy:
145146
matrix:
146147
vcver: [143]
148+
platform: [x64, arm64]
147149
env:
148150
VER_SUFFIX: .VS${{ matrix.vcver }}
149151
steps:
@@ -153,7 +155,7 @@ jobs:
153155
with:
154156
workflow: build.yml
155157
branch: master
156-
name: msi_${{ matrix.vcver }}_x64
158+
name: msi_${{ matrix.vcver }}_${{ matrix.platform }}
157159
path: ./
158160
repo: open-eid/libdigidocpp
159161
- name: Install artifact
@@ -164,39 +166,34 @@ jobs:
164166
uses: actions/cache@v4
165167
with:
166168
path: ${{ github.workspace }}/vcpkg_cache
167-
key: vcpkg-${{ matrix.vcver }}-${{ hashFiles('vcpkg.json') }}
168-
- name: Prepare vcpkg
169-
uses: lukka/run-vcpkg@v11
170-
with:
171-
vcpkgJsonGlob: ./vcpkg.json
172-
runVcpkgInstall: true
173-
env:
174-
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
175-
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/build/vcpkg_installed
169+
key: vcpkg-${{ matrix.vcver }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json') }}
176170
- name: Install Qt
177171
uses: jurplel/install-qt-action@v4
178172
with:
179173
version: 6.10.1
180-
arch: win64_msvc2022_64
174+
arch: ${{ matrix.platform == 'arm64' && 'win64_msvc2022_arm64' || 'win64_msvc2022_64' }}
175+
cache: true
181176
- name: Setup dev env
182177
uses: ilammy/msvc-dev-cmd@v1
183178
with:
184-
arch: x64
179+
arch: ${{ matrix.platform }}
185180
- name: Install WiX
186181
run: |
187182
dotnet tool install -g wix --version 6.0.2
188183
wix extension -g add WixToolset.UI.wixext/6.0.2
189184
- name: Build
185+
env:
186+
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
190187
run: |
191188
cmake "-GNinja" -B build -S . -DCMAKE_BUILD_TYPE=RelWithDebInfo `
192-
-DCMAKE_TOOLCHAIN_FILE=${{ env.RUNVCPKG_VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake
189+
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
193190
cmake --build build --target msi
194191
cmake --build build --target msishellext
195192
cmake --build build --target appx
196193
- name: Archive artifacts
197194
uses: actions/upload-artifact@v5
198195
with:
199-
name: msi_${{ matrix.vcver }}_x64
196+
name: msi_${{ matrix.vcver }}_${{ matrix.platform }}
200197
path: |
201198
build/*.msi
202199
build/*.appx

client/Application.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ class Application::Private
292292
std::unique_ptr<MacMenuBar> bar;
293293
QSigner *signer {};
294294

295-
QTranslator appTranslator, commonTranslator, qtTranslator;
295+
QTranslator appTranslator, qtTranslator;
296296
QString lang;
297297
QTimer lastWindowTimer;
298298
volatile bool ready = false;
@@ -411,7 +411,6 @@ Application::Application( int &argc, char **argv )
411411
});
412412

413413
installTranslator( &d->appTranslator );
414-
installTranslator( &d->commonTranslator );
415414
installTranslator( &d->qtTranslator );
416415
loadTranslation(Settings::LANGUAGE);
417416

@@ -665,7 +664,6 @@ void Application::loadTranslation( const QString &lang )
665664
else QLocale::setDefault(QLocale(QLocale::Estonian, QLocale::Estonia));
666665

667666
void(d->appTranslator.load(QLatin1String(":/translations/%1.qm").arg(lang)));
668-
void(d->commonTranslator.load(QLatin1String(":/translations/common_%1.qm").arg(lang)));
669667
void(d->qtTranslator.load(QLatin1String(":/translations/qtbase_%1.qm").arg(lang)));
670668
if( d->closeAction ) d->closeAction->setText( tr("Close Window") );
671669
if( d->newClientAction ) d->newClientAction->setText( tr("New Window") );

client/CMakeLists.txt

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
get_target_property(qtCore_install_prefix Qt6::qmake IMPORTED_LOCATION)
2-
get_filename_component(qtCore_install_prefix ${qtCore_install_prefix} DIRECTORY)
31
get_filename_component(TSL_FILENAME ${TSL_URL} NAME_WLE)
42
set(TSL_LIST ${TSL_FILENAME} ${TSL_INCLUDE})
53
list(TRANSFORM TSL_LIST APPEND .xml)
@@ -9,14 +7,11 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${TSL_FILENAME}.xml)
97
else()
108
set(TSL_DIR ${CMAKE_CURRENT_BINARY_DIR})
119
list(TRANSFORM TSL_LIST PREPEND ${TSL_DIR}/)
12-
add_executable(TSLDownload TSLDownload.cpp)
13-
target_link_libraries(TSLDownload Qt6::Network)
14-
set_target_properties(TSLDownload PROPERTIES AUTOMOC OFF)
10+
find_package(Python REQUIRED)
1511
add_custom_command(
1612
OUTPUT ${TSL_LIST}
17-
DEPENDS TSLDownload
18-
COMMAND $<TARGET_FILE:TSLDownload> ${CMAKE_CURRENT_BINARY_DIR} ${TSL_URL} ${TSL_INCLUDE}
19-
WORKING_DIRECTORY ${qtCore_install_prefix}
13+
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/download_tsl.py
14+
COMMAND ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/download_tsl.py ${CMAKE_CURRENT_BINARY_DIR} ${TSL_URL} ${TSL_INCLUDE}
2015
)
2116
endif()
2217

@@ -96,12 +91,10 @@ qt_add_translations(${PROJECT_NAME} TS_FILES
9691
translations/en.ts
9792
translations/et.ts
9893
translations/ru.ts
99-
../common/translations/common_en.ts
100-
../common/translations/common_et.ts
101-
../common/translations/common_ru.ts
10294
../common/translations/qtbase_et.ts
10395
../common/translations/qtbase_ru.ts
10496
RESOURCE_PREFIX /translations
97+
LUPDATE_OPTIONS -locations none
10598
)
10699
qt_add_resources(${PROJECT_NAME} tsl BASE ${TSL_DIR} PREFIX /TSL FILES ${TSL_LIST})
107100

@@ -241,10 +234,11 @@ elseif(WIN32)
241234
${CMAKE_SOURCE_DIR}/common/WelcomeDlg.wxs
242235
${CMAKE_SOURCE_DIR}/common/WixUI_Minimal.wxs
243236
)
237+
get_filename_component(QT_BASE_DIR "${Qt6_DIR}/../../.." ABSOLUTE)
244238
add_custom_target(msi DEPENDS ${PROJECT_NAME}
245239
COMMAND ${WIX_CMD} -o "${MSI_FILE}.msi"
246240
#Build MSI with QT
247-
COMMAND ${WIX_CMD} -d qt_path=${qtCore_install_prefix} -o "${MSI_FILE}.qt.msi"
241+
COMMAND ${WIX_CMD} -d qt_path=${QT_BASE_DIR}/bin -o "${MSI_FILE}.qt.msi"
248242
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
249243
)
250244
if(SIGNCERT)
@@ -261,10 +255,10 @@ elseif(WIN32)
261255
endif()
262256
set(PLATFORM $ENV{PLATFORM})
263257
configure_file(${CMAKE_SOURCE_DIR}/AppxManifest.xml.cmake ${CMAKE_BINARY_DIR}/AppxManifest.xml)
264-
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
265-
set(OPENSSL_SUFFIX "-x64")
266-
else()
258+
if(${PLATFORM} STREQUAL "x86")
267259
set(OPENSSL_SUFFIX "")
260+
else()
261+
set(OPENSSL_SUFFIX "-${PLATFORM}")
268262
endif()
269263
add_custom_target(appx DEPENDS ${PROJECT_NAME}
270264
COMMAND ${CMAKE_COMMAND} -E remove ${MSI_FILE}.appx

client/TSLDownload.cpp

Lines changed: 0 additions & 79 deletions
This file was deleted.

client/download_tsl.py

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import sys
2+
import shutil
3+
import os
4+
import xml.etree.ElementTree as ET
5+
import urllib.request
6+
import urllib.error
7+
import urllib.parse
8+
9+
def download_tsl_file(url, output_path, filename):
10+
output_file = os.path.join(output_path, filename)
11+
print(f"Downloading TSL list from: {url}")
12+
try:
13+
with urllib.request.urlopen(url) as response, open(output_file, 'wb') as f:
14+
shutil.copyfileobj(response, f)
15+
print(f"Saved to: {output_file}")
16+
return output_file
17+
except (urllib.error.HTTPError, urllib.error.URLError) as e:
18+
print(f"Error downloading TSL list: {e}")
19+
sys.exit(1)
20+
except IOError as e:
21+
print(f"Error saving TSL list {output_file}: {e}")
22+
sys.exit(1)
23+
24+
def download_tsl_files(output_path, list_url, territories):
25+
master_list_filename = os.path.basename(urllib.parse.urlparse(list_url).path)
26+
if not master_list_filename:
27+
master_list_filename = "eu-lotl.xml" # Fallback filename
28+
file = download_tsl_file(list_url, output_path, master_list_filename)
29+
try:
30+
root = ET.parse(file)
31+
ns = {'tsl': "http://uri.etsi.org/02231/v2#"}
32+
for pointer in root.findall('.//tsl:OtherTSLPointer', ns):
33+
territory = pointer.find('.//tsl:SchemeTerritory', ns)
34+
if territory is None or territory.text not in territories:
35+
continue
36+
37+
mime = pointer.find('.//tslx:MimeType', {'tslx': 'http://uri.etsi.org/02231/v2/additionaltypes#'})
38+
if mime is None or mime.text != 'application/vnd.etsi.tsl+xml':
39+
continue
40+
41+
location = pointer.find('.//tsl:TSLLocation', ns)
42+
if location is not None:
43+
download_tsl_file(location.text, output_path, f"{territory.text}.xml")
44+
45+
except ET.ParseError as e:
46+
print(f"Error parsing XML: {e}")
47+
sys.exit(1)
48+
49+
if __name__ == "__main__":
50+
if len(sys.argv) < 4:
51+
print("Usage: python download_tsl.py <output_path> <url> <territory1> [territory2] ...")
52+
sys.exit(1)
53+
54+
output_path = sys.argv[1]
55+
url = sys.argv[2]
56+
territories_to_download = sys.argv[3:]
57+
58+
if not os.path.isdir(output_path):
59+
print(f"Error: Output path '{output_path}' is not a directory.")
60+
sys.exit(1)
61+
62+
download_tsl_files(output_path, url, territories_to_download)
63+
print("TSL download process finished.")

client/translations/en.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,17 @@
443443
<translation>Cannot connect to certificate status service!</translation>
444444
</message>
445445
</context>
446+
<context>
447+
<name>Configuration</name>
448+
<message>
449+
<source>The configuration file located on the server cannot be validated.</source>
450+
<translation>The configuration file located on the server cannot be validated.</translation>
451+
</message>
452+
<message>
453+
<source>Your computer&apos;s configuration file is later than the server has.</source>
454+
<translation>Your computer&apos;s configuration file is later than the server has.</translation>
455+
</message>
456+
</context>
446457
<context>
447458
<name>ContainerPage</name>
448459
<message>

client/translations/et.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,17 @@
443443
<translation>Kehtivuskinnitusteenus ei ole kättesaadav!</translation>
444444
</message>
445445
</context>
446+
<context>
447+
<name>Configuration</name>
448+
<message>
449+
<source>The configuration file located on the server cannot be validated.</source>
450+
<translation>Serveris olev konfiguratsioonifail ei valideeru.</translation>
451+
</message>
452+
<message>
453+
<source>Your computer&apos;s configuration file is later than the server has.</source>
454+
<translation>Sinu arvutis on uuem konfiguratsioonifail kui serveris.</translation>
455+
</message>
456+
</context>
446457
<context>
447458
<name>ContainerPage</name>
448459
<message>

client/translations/ru.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,17 @@
443443
<translation>Услуга подтверждения действительности не доступна!</translation>
444444
</message>
445445
</context>
446+
<context>
447+
<name>Configuration</name>
448+
<message>
449+
<source>The configuration file located on the server cannot be validated.</source>
450+
<translation>Находящийся на сервере конфигурационный файл не валидируется.</translation>
451+
</message>
452+
<message>
453+
<source>Your computer&apos;s configuration file is later than the server has.</source>
454+
<translation>Находящийся на Вашем компьютере конфигурационный файл новее файла на сервере.</translation>
455+
</message>
456+
</context>
446457
<context>
447458
<name>ContainerPage</name>
448459
<message>

0 commit comments

Comments
 (0)