Skip to content

Commit 530a204

Browse files
authored
Update libxml2 to 2.13.5 (#651)
IB-8259 Signed-off-by: Raul Metsma <[email protected]>
1 parent a708f24 commit 530a204

File tree

13 files changed

+43
-83
lines changed

13 files changed

+43
-83
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
- name: Prepare vcpkg
8585
uses: lukka/run-vcpkg@v11
8686
with:
87-
vcpkgGitCommitId: e2edf52610d2c94d2038fe30b247ea5a26964e1b
87+
vcpkgGitCommitId: e4644bd15436d406bba71928d086c809e5c9ca45
8888
vcpkgJsonGlob: ./vcpkg.json
8989
runVcpkgInstall: true
9090
env:
@@ -100,7 +100,6 @@ jobs:
100100
with:
101101
name: ${{ matrix.target }}
102102
path: |
103-
build/macos/libdigidocpp*.*
104103
libdigidocpp*.zip
105104
fedora:
106105
name: Build on Fedora ${{ matrix.container }}
@@ -187,7 +186,7 @@ jobs:
187186
- name: Prepare vcpkg
188187
uses: lukka/run-vcpkg@v11
189188
with:
190-
vcpkgGitCommitId: e2edf52610d2c94d2038fe30b247ea5a26964e1b
189+
vcpkgGitCommitId: e4644bd15436d406bba71928d086c809e5c9ca45
191190
vcpkgJsonGlob: ./vcpkg.json
192191
runVcpkgInstall: true
193192
runVcpkgFormatString: "[`install`, `--recurse`, `--clean-after-build`, `--x-install-root`, `$[env.VCPKG_INSTALLED_DIR]`, `--triplet`, `$[env.VCPKG_DEFAULT_TRIPLET]`, `--x-feature`, `tests`]"

build.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ if($swig) {
4141
}
4242
if($doxygen) {
4343
$cmakeext += "-DDOXYGEN_EXECUTABLE=$doxygen"
44-
$wixext += "-d", "docLocation=$(Get-Location)/$platform/share/doc/libdigidocpp"
4544
}
4645
if($platform -eq "arm64" -and $env:VSCMD_ARG_HOST_ARCH -ne "arm64") {
4746
$cmakeext += "-DCMAKE_DISABLE_FIND_PACKAGE_Python3=yes"
@@ -74,6 +73,11 @@ if($sign) {
7473
$vcpkg_installed_platform/$vcpkg_triplet/debug/bin/*.dll
7574
}
7675

76+
$docLocation = "$(Get-Location)/$platform/share/doc/libdigidocpp"
77+
if (Test-Path -Path $docLocation -PathType Container) {
78+
$wixext += "-d", "docLocation=$docLocation"
79+
}
80+
7781
& wix build -nologo -arch $platform -out $msi_name $wixext `
7882
-ext WixToolset.UI.wixext `
7983
-bv "WixUIBannerBmp=$libdigidocpp/banner.bmp" `

libdigidocpp.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
2222
xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
2323
<Package Name="Libdigidocpp $(sys.BUILDARCH)" UpgradeCode="$(var.UpgradeCode)"
24-
Language="1033" Version="!(bind.FileVersion.digidocpp)" Manufacturer="RIA" InstallerVersion="500">
24+
Language="1033" Version="!(bind.FileVersion.digidocpp)" Manufacturer="RIA">
2525
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
2626
<Icon Id="ID.ico" SourceFile="$(var.ICON)" />
2727
<Property Id="ARPPRODUCTICON" Value="ID.ico" />

src/CMakeLists.txt

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ else()
1717
set(BUILD_VER 0)
1818
endif()
1919

20-
add_definitions(
21-
-DMAJOR_VER=${PROJECT_VERSION_MAJOR}
22-
-DMINOR_VER=${PROJECT_VERSION_MINOR}
23-
-DRELEASE_VER=${PROJECT_VERSION_PATCH}
24-
-DBUILD_VER=${BUILD_VER}
25-
)
2620
set(VERSION ${PROJECT_VERSION}.${BUILD_VER})
2721

2822
configure_file( libdigidocpp.pc.cmake libdigidocpp.pc @ONLY )
@@ -63,14 +57,20 @@ set( CRYPTO_HEADER
6357
)
6458

6559
add_library(digidocpp_ver INTERFACE)
60+
target_compile_definitions(digidocpp_ver INTERFACE
61+
VERSION_STR="${VERSION}"
62+
$<$<PLATFORM_ID:Windows>:VERSION=${PROJECT_VERSION_MAJOR},${PROJECT_VERSION_MINOR},${PROJECT_VERSION_PATCH},${BUILD_VER}>
63+
$<$<PLATFORM_ID:Windows>:TARGET_NAME="$<TARGET_PROPERTY:NAME>">
64+
$<$<PLATFORM_ID:Windows>:$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:APP>>
65+
)
6666
target_sources(digidocpp_ver INTERFACE libdigidocpp.rc)
6767

6868
add_library(digidocpp_util STATIC
6969
util/File.cpp
7070
util/log.cpp
7171
)
7272

73-
target_link_libraries(digidocpp_util PRIVATE $<$<OR:$<PLATFORM_ID:Darwin>,$<PLATFORM_ID:iOS>>:-framework\ CoreFoundation>)
73+
target_link_libraries(digidocpp_util PUBLIC digidocpp_ver PRIVATE $<$<OR:$<PLATFORM_ID:Darwin>,$<PLATFORM_ID:iOS>>:-framework\ CoreFoundation>)
7474

7575
add_library(digidocpp_priv STATIC
7676
crypto/Connect.cpp
@@ -149,18 +149,17 @@ set_target_properties(digidocpp PROPERTIES
149149
MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${PROJECT_VERSION}
150150
MACOSX_FRAMEWORK_BUNDLE_VERSION ${BUILD_VER}
151151
MACOSX_RPATH YES
152-
COMPILE_DEFINITIONS TARGET_NAME="$<TARGET_NAME:digidocpp>"
153152
POSITION_INDEPENDENT_CODE YES
154153
)
155154

156155
target_include_directories(digidocpp
157156
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
158157
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
159158
)
160-
target_link_libraries(digidocpp PRIVATE ${CMAKE_DL_LIBS} minizip digidocpp_priv digidocpp_ver)
159+
target_link_libraries(digidocpp PRIVATE ${CMAKE_DL_LIBS} minizip digidocpp_priv)
161160

162161
if( BUILD_TOOLS )
163-
add_executable(digidoc-tool digidoc-tool.rc digidoc-tool.cpp)
162+
add_executable(digidoc-tool digidoc-tool.cpp)
164163
target_link_libraries(digidoc-tool digidocpp digidocpp_priv Threads::Threads)
165164
configure_file( digidoc-tool.1.cmake digidoc-tool.1 )
166165
endif()
@@ -181,8 +180,7 @@ if(SWIG_FOUND)
181180
set(CMAKE_SWIG_OUTDIR ${CMAKE_CURRENT_BINARY_DIR}/java)
182181
swig_add_library(digidoc_java LANGUAGE java SOURCES ../libdigidocpp.i)
183182
target_include_directories(digidoc_java PRIVATE ${JAVA_INCLUDE_PATH} $<$<BOOL:${JAVA_INCLUDE_PATH2}>:${JAVA_INCLUDE_PATH2}>)
184-
target_compile_definitions(digidoc_java PRIVATE TARGET_NAME="$<TARGET_NAME:digidoc_java>")
185-
target_link_libraries(digidoc_java digidocpp digidocpp_util digidocpp_ver)
183+
target_link_libraries(digidoc_java digidocpp digidocpp_util)
186184
set_target_properties(digidoc_java PROPERTIES
187185
INSTALL_RPATH $<$<PLATFORM_ID:Darwin>:/Library/Frameworks>
188186
SWIG_COMPILE_DEFINITIONS $<$<PLATFORM_ID:Windows>:SWIGWIN>
@@ -197,8 +195,7 @@ if(SWIG_FOUND)
197195
set(CMAKE_SWIG_FLAGS -py3)
198196
set(CMAKE_SWIG_OUTDIR ${CMAKE_CURRENT_BINARY_DIR})
199197
swig_add_library(digidoc_python LANGUAGE python SOURCES ../libdigidocpp.i)
200-
target_compile_definitions(digidoc_python PRIVATE TARGET_NAME="$<TARGET_NAME:digidoc_python>")
201-
target_link_libraries(digidoc_python digidocpp digidocpp_util digidocpp_ver)
198+
target_link_libraries(digidoc_python digidocpp digidocpp_util)
202199
if(TARGET Python3::SABIModule)
203200
target_compile_definitions(digidoc_python PRIVATE Py_LIMITED_API=0x03090000)
204201
target_link_libraries(digidoc_python Python3::SABIModule)
@@ -225,8 +222,7 @@ if(SWIG_FOUND)
225222
set(CMAKE_SWIG_FLAGS -namespace digidoc)
226223
set(CMAKE_SWIG_OUTDIR ${CMAKE_CURRENT_BINARY_DIR}/csharp)
227224
swig_add_library(digidoc_csharp LANGUAGE csharp SOURCES ../libdigidocpp.i)
228-
target_compile_definitions(digidoc_csharp PRIVATE TARGET_NAME="$<TARGET_NAME:digidoc_csharp>")
229-
target_link_libraries(digidoc_csharp digidocpp digidocpp_util digidocpp_ver)
225+
target_link_libraries(digidoc_csharp digidocpp digidocpp_util)
230226
set_target_properties(digidoc_csharp PROPERTIES
231227
SWIG_COMPILE_DEFINITIONS $<$<PLATFORM_ID:Windows>:SWIGWIN>
232228
INSTALL_RPATH $<$<PLATFORM_ID:Darwin>:/Library/Frameworks>

src/Container.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ string digidoc::userAgent() { return m_userAgent; }
7373
* Returns libdigidocpp library version
7474
*/
7575
string digidoc::version() {
76-
return FILE_VER_STR;
76+
return VERSION_STR;
7777
}
7878

7979
/**
@@ -121,7 +121,7 @@ void digidoc::initialize(const string &appInfo, const string &userAgent, initCal
121121

122122
INFO("Libxml2 version: %s", LIBXML_DOTTED_VERSION);
123123
INFO("Xmlsec1 version: %s", XMLSEC_VERSION);
124-
INFO("digidocpp version: %s", FILE_VER_STR);
124+
INFO("digidocpp version: %s", VERSION_STR);
125125

126126
if(!Conf::instance())
127127
Conf::init(new XmlConfCurrent);

src/SignatureXAdES_LT.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ void SignatureXAdES_LT::validate(const string &policy) const
112112
try {
113113
auto revocationValues = unsignedSignatureProperties()/"RevocationValues";
114114
if(!revocationValues)
115-
THROW_MAIN(exception, "RevocationValues object is missing")
115+
THROW("RevocationValues object is missing");
116116
if(revocationValues + 1)
117-
THROW_MAIN(exception, "More than one RevocationValues object is not supported")
117+
THROW("More than one RevocationValues object is not supported");
118118
auto ocspValues = revocationValues/"OCSPValues";
119119
if(!ocspValues)
120-
THROW_MAIN(exception, "OCSPValues is missing")
120+
THROW("OCSPValues is missing");
121121

122122
/*
123123
* Find OCSP response that matches with signingCertificate.

src/crypto/Connect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ Connect::Connect(const string &_url, string _method, int _timeout, const vector<
197197
else
198198
addHeader("Host", host + ':' + port);
199199
if(const auto &agent = userAgentData.empty() ? userAgent() : userAgentData; !agent.empty())
200-
addHeader("User-Agent", "LIB libdigidocpp/" FILE_VER_STR " (" TARGET_ARCH ") APP " + agent);
200+
addHeader("User-Agent", "LIB libdigidocpp/" VERSION_STR " (" TARGET_ARCH ") APP " + agent);
201201
if(usessl == 0)
202202
sendProxyAuth();
203203
}

src/digidoc-tool.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -995,13 +995,13 @@ static int tslcmd(int /*argc*/, char* /*argv*/[])
995995
int main(int argc, char *argv[]) try
996996
{
997997
printf("Version\n");
998-
printf(" digidoc-tool version: %s\n", FILE_VER_STR);
998+
printf(" digidoc-tool version: %s\n", VERSION_STR);
999999
printf(" libdigidocpp version: %s\n", version().c_str());
10001000

10011001
ToolConfig *conf = nullptr;
10021002
Conf::init(conf = new ToolConfig(argc, argv));
10031003
stringstream info;
1004-
info << "digidoc-tool/" << FILE_VER_STR << " (";
1004+
info << "digidoc-tool/" << VERSION_STR << " (";
10051005
#ifdef _WIN32
10061006
info << "Windows";
10071007
#elif __APPLE__

src/digidoc-tool.rc

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

src/libdigidocpp.rc

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
#include <winver.h>
22

3-
#define VER_STR_HELPER(x) #x
4-
#define VER_STR(x) VER_STR_HELPER(x)
5-
63
VS_VERSION_INFO VERSIONINFO
7-
FILEVERSION MAJOR_VER,MINOR_VER,RELEASE_VER,BUILD_VER
8-
PRODUCTVERSION MAJOR_VER,MINOR_VER,RELEASE_VER,BUILD_VER
4+
FILEVERSION VERSION
5+
PRODUCTVERSION VERSION
96
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
107
#ifdef _DEBUG
118
FILEFLAGS VS_FF_DEBUG
129
#else
1310
FILEFLAGS 0x0L
1411
#endif
1512
FILEOS VOS_NT_WINDOWS32
13+
#ifdef APP
14+
FILETYPE VFT_APP
15+
#else
1616
FILETYPE VFT_DLL
17+
#endif
1718
FILESUBTYPE VFT_UNKNOWN
1819
BEGIN
1920
BLOCK "StringFileInfo"
@@ -22,12 +23,16 @@ BEGIN
2223
BEGIN
2324
VALUE "CompanyName", "RIA"
2425
VALUE "FileDescription", TARGET_NAME
25-
VALUE "FileVersion", VER_STR(MAJOR_VER.MINOR_VER.RELEASE_VER.BUILD_VER)
26+
VALUE "FileVersion", VERSION_STR
2627
VALUE "InternalName", TARGET_NAME
2728
VALUE "LegalCopyright", "(C) 2009-2024 Estonian Information System Authority"
29+
#ifdef APP
30+
VALUE "OriginalFilename", TARGET_NAME ".exe"
31+
#else
2832
VALUE "OriginalFilename", TARGET_NAME ".dll"
33+
#endif
2934
VALUE "ProductName", TARGET_NAME
30-
VALUE "ProductVersion", VER_STR(MAJOR_VER.MINOR_VER.RELEASE_VER.BUILD_VER)
35+
VALUE "ProductVersion", VERSION_STR
3136
END
3237
END
3338
BLOCK "VarFileInfo"

0 commit comments

Comments
 (0)