-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[shiftmedia-libgcrypt] new port (Windows fork of Libgcrypt) #26364
Changes from 23 commits
bc53711
3a95a46
1cd86d5
dd1c684
200b401
353a7bb
cfb6e17
feffc18
cbded1a
0a57df4
069300d
edc8ddf
ef97828
6e4c59f
6084eec
3aa9557
2e440ad
7440e82
ad5fb08
4c1dca8
12b6841
1d2cb57
c7b98b5
8a26453
1375c18
1e3ef57
37a4643
bf8d8bf
7f82cf0
146c50c
1aea01b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/SMP/libgpg-error_winrt.vcxproj b/SMP/llibgpg-error_winrt.vcxproj | ||
index e1acf679..f9c302be 100644 | ||
--- a/SMP/libgpg-error_winrt.vcxproj | ||
+++ b/SMP/libgpg-error_winrt.vcxproj | ||
@@ -3,6 +3,7 @@ | ||
<PropertyGroup Label="Globals"> | ||
<ProjectGuid>{AA4A762D-A8D7-4F68-9B79-FBE63C6BE105}</ProjectGuid> | ||
<RootNamespace>gpg-error</RootNamespace> | ||
+ <TargetPlatformMinVersion>10.0.17200.0</TargetPlatformMinVersion> | ||
</PropertyGroup> | ||
<ImportGroup Label="PropertySheets"> | ||
<Import Project="smp_winrt.props" /> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "libgpg-error", | ||
"version": "1.42", | ||
"port-version": 3, | ||
"port-version": 4, | ||
"description": "A common dependency of all GnuPG components", | ||
"homepage": "https://gnupg.org/software/libgpg-error/index.html", | ||
"supports": "!(windows & (arm | arm64))" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any chance that this may fix arm or arm64? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://github.com/ShiftMediaProject/libgpg-error/blob/master/SMP/libgpg-error.vcxproj doesn't support arm/arm64 platforms, so that can't work ("The specified solution configuration "ReleaseDLLWinRT|arm" is invalid"). That having said, I was close (#20447) to getting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, just wanted to be sure it was considered since our CI does not validate supports expressions |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
set(PACKAGE_VERSION_MAJOR 1) | ||
set(PACKAGE_VERSION_MINOR 10) | ||
set(PACKAGE_VERSION_PATCH 1) | ||
set(PACKAGE_VERSION ${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}) | ||
|
||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO ShiftMediaProject/libgcrypt | ||
REF libgcrypt-${PACKAGE_VERSION} | ||
SHA512 6da8225ec73c51562cd76a0c0abc19506a7378750ed2a9ea45f03df3c8d7cf500840459deb9b0a694a5602fe77ee2b0dd5b2e37376745233350b0f218dff4f1c | ||
HEAD_REF master | ||
) | ||
|
||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") | ||
set(CONFIGURATION_RELEASE ReleaseDLL) | ||
set(CONFIGURATION_DEBUG DebugDLL) | ||
else() | ||
set(CONFIGURATION_RELEASE Release) | ||
set(CONFIGURATION_DEBUG Debug) | ||
endif() | ||
|
||
if(VCPKG_TARGET_IS_UWP) | ||
string(APPEND CONFIGURATION_RELEASE WinRT) | ||
string(APPEND CONFIGURATION_DEBUG WinRT) | ||
endif() | ||
|
||
if(VCPKG_CRT_LINKAGE STREQUAL "static") | ||
set(RuntimeLibraryExt "") | ||
else() | ||
set(RuntimeLibraryExt "DLL") | ||
endif() | ||
|
||
# patch output library file path and name; inject RuntimeLibrary property to control CRT linkage | ||
foreach(PROPS IN ITEMS | ||
"${SOURCE_PATH}/SMP/smp_deps.props" | ||
"${SOURCE_PATH}/SMP/smp_winrt_deps.props") | ||
vcpkg_replace_string( | ||
"${PROPS}" | ||
[=[_winrt</TargetName>]=] | ||
[=[</TargetName>]=] | ||
) | ||
vcpkg_replace_string( | ||
"${PROPS}" | ||
[=[<TargetName>lib$(RootNamespace)]=] | ||
[=[<TargetName>$(RootNamespace)]=] | ||
) | ||
vcpkg_replace_string( | ||
"${PROPS}" | ||
[=[<OutDir>$(ProjectDir)..\..\..\msvc\</OutDir>]=] | ||
[=[<OutDir>$(ProjectDir)..\msvc\</OutDir>]=] | ||
) | ||
vcpkg_replace_string( | ||
"${PROPS}" | ||
[=[</TreatSpecificWarningsAsErrors>]=] | ||
[=[</TreatSpecificWarningsAsErrors><RuntimeLibrary>$(RuntimeLibrary)</RuntimeLibrary>]=] | ||
) | ||
endforeach() | ||
|
||
# patch gpg-error library file name | ||
foreach(VCXPROJ IN ITEMS | ||
"${SOURCE_PATH}/SMP/libgcrypt.vcxproj" | ||
"${SOURCE_PATH}/SMP/libgcrypt_winrt.vcxproj") | ||
vcpkg_replace_string( | ||
"${VCXPROJ}" | ||
"_winrt.lib" | ||
".lib" | ||
) | ||
vcpkg_replace_string( | ||
"${VCXPROJ}" | ||
"libgpg-error" | ||
"gpg-error" | ||
) | ||
endforeach() | ||
|
||
vcpkg_install_msbuild( | ||
USE_VCPKG_INTEGRATION | ||
SOURCE_PATH "${SOURCE_PATH}" | ||
PROJECT_SUBPATH SMP/libgcrypt.sln | ||
PLATFORM ${TRIPLET_SYSTEM_ARCH} | ||
LICENSE_SUBPATH COPYING.LIB | ||
RELEASE_CONFIGURATION ${CONFIGURATION_RELEASE} | ||
DEBUG_CONFIGURATION ${CONFIGURATION_DEBUG} | ||
SKIP_CLEAN | ||
OPTIONS_DEBUG "/p:RuntimeLibrary=MultiThreadedDebug${RuntimeLibraryExt}" | ||
OPTIONS_RELEASE "/p:RuntimeLibrary=MultiThreaded${RuntimeLibraryExt}" | ||
) | ||
|
||
get_filename_component(SOURCE_PATH_SUFFIX "${SOURCE_PATH}" NAME) | ||
file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/${SOURCE_PATH_SUFFIX}/msvc/include" DESTINATION "${CURRENT_PACKAGES_DIR}") | ||
|
||
set(exec_prefix "\${prefix}") | ||
set(libdir "\${prefix}/lib") | ||
set(includedir "\${prefix}/include") | ||
set(LIBGCRYPT_CONFIG_LIBS "-L\${libdir} -lgcrypt -lgpg-error") | ||
configure_file("${SOURCE_PATH}/src/libgcrypt.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libgcrypt.pc" @ONLY) | ||
|
||
set(exec_prefix "\${prefix}") | ||
set(libdir "\${prefix}/lib") | ||
set(includedir "\${prefix}/../include") | ||
set(LIBGCRYPT_CONFIG_LIBS "-L\${libdir} -lgcryptd -lgpg-errord") | ||
configure_file("${SOURCE_PATH}/src/libgcrypt.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libgcrypt.pc" @ONLY) | ||
|
||
vcpkg_fixup_pkgconfig() | ||
vcpkg_copy_pdbs() | ||
|
||
file(INSTALL "${SOURCE_PATH}/src/libgcrypt.m4" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}/aclocal/") | ||
|
||
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/COPYING.LIB" "${CURRENT_PACKAGES_DIR}/debug/lib/COPYING.LIB") |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "shiftmedia-libgcrypt", | ||
"version": "1.10.1", | ||
"description": "An unofficial LibGCrypt with added custom native Visual Studio project build tools. LibGCrypt", | ||
"homepage": "https://github.com/ShiftMediaProject/libgcrypt", | ||
"license": "LGPL-2.1-only", | ||
"supports": "windows", | ||
"dependencies": [ | ||
"libgpg-error" | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"versions": [ | ||
{ | ||
"git-tree": "0d3d916db804e721cf4afebda654430ab926d42c", | ||
"version": "1.10.1", | ||
"port-version": 0 | ||
} | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this specific value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what I saw in the CI logs used as a minimum required when comparing against – then empty – TargetPlatformMinVersion value.
That having said, I did not test anything less than that, to be frank.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, after doing a little digging, it seems as though this change would be fine. I believe TargetPlatformMinVersion is used to determine the fallback framework and the package format. I believe that setting TargetPlatformMinVersion to 10.0.17200.0 would result in the fallback framework being .NET Framework 4.6.1 and the packaging format being msix, none of which matters for our purposes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for checking that.