mirror of
https://github.com/cemu-project/vcpkg.git
synced 2025-02-23 02:57:09 +01:00
[qca] working on certstore
This commit is contained in:
parent
aa95e7bf39
commit
0f797c7a01
@ -1,4 +1,4 @@
|
||||
Source: qca
|
||||
Version: 2.2.0
|
||||
Description: Qt Cryptographic Api (QCA)
|
||||
Description: Qt Cryptographic Architecture (QCA). Sources: https://cgit.kde.org/qca.git/
|
||||
Build-Depends: qt5
|
||||
|
@ -5,7 +5,7 @@
|
||||
# This script imports LocalMachine certificates into rootcerts.pem
|
||||
# needed by qca.
|
||||
#
|
||||
# PS> .\import-local-certificates.ps1 -certstore Root -outpath C:\src\git\vcpkg\ports\qca
|
||||
# PS> .\import-local-certificates.ps1 [-certstore Root] -outpath C:\src\git\vcpkg\ports\qca
|
||||
#
|
||||
|
||||
param (
|
||||
@ -15,15 +15,22 @@ param (
|
||||
[Parameter(Mandatory=$true)][string]$outpath
|
||||
)
|
||||
|
||||
$certs = (Get-ChildItem -Path 'Cert:\LocalMachine\Root')
|
||||
$outfile = $outpath + "\rootcerts.pem"
|
||||
$certs = (Get-ChildItem -Path 'Cert:\LocalMachine\Root' -EKU "Server Authentication")
|
||||
$outfile = $outpath + "rootcerts.pem"
|
||||
|
||||
Write-Host "Importing: " $certs.Count " certificates ..."
|
||||
|
||||
foreach ($cert in $certs)
|
||||
{
|
||||
$outfile = $outpath + "/" + $cert.Thumbprint + ".cer"
|
||||
Export-Certificate -Cert $cert -FilePath $outfile
|
||||
$out = New-Object String[] -ArgumentList 5
|
||||
|
||||
$out[0] = " "
|
||||
$out[1] = "# " + $cert.Issuer
|
||||
$out[2] = "-----BEGIN CERTIFICATE-----"
|
||||
$out[3] = $([Convert]::ToBase64String($cert.Export('Cert'), [System.Base64FormattingOptions]::InsertLineBreaks))
|
||||
$out[4] = "-----END CERTIFICATE-----"
|
||||
|
||||
[System.IO.File]::AppendAllLines($outfile,$out)
|
||||
}
|
||||
|
||||
Write-Host "Written to: " $outfile
|
||||
|
@ -1,4 +1,8 @@
|
||||
# For now only x[64|86]-windows triplet and dynamic linking is supported
|
||||
# This portfile adds the Qt Cryptographic Arcitecture
|
||||
# Changes to the original sources by this file:
|
||||
# No -qt5 suffix, which is recommended just for Linux
|
||||
# Output directories according to vcpkg
|
||||
# Updated certstore. See certstore.pem in the output dirs
|
||||
#
|
||||
|
||||
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
@ -44,6 +48,16 @@ vcpkg_apply_patches(
|
||||
PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-fix-path-for-vcpkg.patch
|
||||
)
|
||||
|
||||
# Importing local certificates
|
||||
message(STATUS "Importing certstore")
|
||||
file(REMOVE ${SOURCE_PATH}/certs/rootcerts.pem)
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND "& ${CMAKE_CURRENT_LIST_DIR}/import-local-certificates.ps1 -outpath ${SOURCE_PATH}/certs/"
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
||||
LOGNAME certimport
|
||||
)
|
||||
message(STATUS "Importing certstore done")
|
||||
|
||||
# Configure and build
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
@ -53,7 +67,7 @@ vcpkg_configure_cmake(
|
||||
-DUSE_RELATIVE_PATHS=ON
|
||||
-DQT4_BUILD=OFF
|
||||
-DBUILD_TESTS=OFF
|
||||
-DBUILD_TOOLS=ON
|
||||
-DBUILD_TOOLS=OFF
|
||||
-DQCA_SUFFIX=OFF
|
||||
-DQCA_FEATURE_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/share/qca/mkspecs/features
|
||||
OPTIONS_DEBUG
|
||||
@ -66,7 +80,6 @@ vcpkg_install_cmake()
|
||||
|
||||
# Patch and copy cmake files
|
||||
message(STATUS "Patching files")
|
||||
|
||||
file(READ
|
||||
${CURRENT_PACKAGES_DIR}/debug/share/qca/cmake/QcaTargets-debug.cmake
|
||||
QCA_DEBUG_CONFIG
|
||||
@ -85,20 +98,6 @@ file(WRITE ${CURRENT_PACKAGES_DIR}/share/qca/cmake/QcaTargets.cmake
|
||||
"${QCA_TARGET_CONFIG}"
|
||||
)
|
||||
|
||||
# Move tools
|
||||
file(COPY ${CURRENT_PACKAGES_DIR}/bin/mozcerts.exe
|
||||
DESTINATION ${CURRENT_PACKAGES_DIR}/share/qca/tools
|
||||
)
|
||||
file(COPY ${CURRENT_PACKAGES_DIR}/bin/qcatool.exe
|
||||
DESTINATION ${CURRENT_PACKAGES_DIR}/share/qca/tools
|
||||
)
|
||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/mozcerts.exe
|
||||
${CURRENT_PACKAGES_DIR}/bin/qcatool.exe
|
||||
${CURRENT_PACKAGES_DIR}/debug/bin/mozcerts.exe
|
||||
${CURRENT_PACKAGES_DIR}/debug/bin/mozcerts.pdb
|
||||
${CURRENT_PACKAGES_DIR}/debug/bin/qcatool.exe
|
||||
)
|
||||
|
||||
# Remove unneeded dirs
|
||||
file(REMOVE_RECURSE
|
||||
${CURRENT_BUILDTREES_DIR}/share/man
|
||||
@ -106,7 +105,6 @@ file(REMOVE_RECURSE
|
||||
${CURRENT_PACKAGES_DIR}/debug/include
|
||||
${CURRENT_PACKAGES_DIR}/debug/share
|
||||
)
|
||||
|
||||
message(STATUS "Patching files done")
|
||||
|
||||
# Handle copyright
|
||||
|
Loading…
x
Reference in New Issue
Block a user