-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
p11-kit: Set proper proxy_module variable for pkg-config #22595
Open
mlt
wants to merge
1
commit into
msys2:master
Choose a base branch
from
mlt:p11-kit-proxy
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+17
−3
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ _realname=p11-kit | |
pkgbase=mingw-w64-${_realname} | ||
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" | ||
pkgver=0.25.5 | ||
pkgrel=1 | ||
pkgrel=2 | ||
pkgdesc="Library to work with PKCS#11 modules (mingw-w64)" | ||
arch=('any') | ||
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') | ||
|
@@ -37,7 +37,8 @@ source=(https://github.com/p11-glue/p11-kit/releases/download/${pkgver}/${_realn | |
0011-p11-kit-spawn-external.patch | ||
0012-no-version-script.patch | ||
0013-fix-reallocarray-decl.patch | ||
0014-fix-configure.patch) | ||
0014-fix-configure.patch | ||
proxy.patch) | ||
validpgpkeys=('C0F67099B808FB063E2C81117BFB1108D92765AF' # Stef Walter <[email protected]> | ||
'462225C3B46F34879FC8496CD605848ED7E69871' # Daiki Ueno <[email protected]> | ||
'5D46CB0F763405A7053556F47A75A648B3F9220C' # Zoltan Fridrich <[email protected]> | ||
|
@@ -54,7 +55,8 @@ sha256sums=('04d0a86450cdb1be018f26af6699857171a188ac6d5b8c90786a60854e1198e5' | |
'3c4821c36f76fd45c0d1ec83474773e45ccefde4ac92ca88b8493425f7553cb9' | ||
'15a2729f39e260f7fe8d55a91a399f2512854da626a69bc215470f902fc178cd' | ||
'83ecf11aaf9a1c6f617790048e80febd7320edae6ba203958349264170956911' | ||
'9b4831e585e4145f69fef34b371763e959587c23128167cd995c006cb9e1e0c2') | ||
'9b4831e585e4145f69fef34b371763e959587c23128167cd995c006cb9e1e0c2' | ||
'e2568ffd96d68046525a37b9e95fbfbcae14fa1033c9dfe5382d9879b2906e4e') | ||
|
||
prepare() { | ||
test ! -d "${startdir}/../mingw-w64-pathtools" || { | ||
|
@@ -74,6 +76,7 @@ prepare() { | |
patch -p1 -i ${srcdir}/0012-no-version-script.patch | ||
patch -p1 -i ${srcdir}/0013-fix-reallocarray-decl.patch | ||
patch -p1 -i ${srcdir}/0014-fix-configure.patch | ||
patch -p1 -i ${srcdir}/proxy.patch | ||
|
||
autoreconf -vfi | ||
gtkdocize | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- p11-kit-0.25.5/p11-kit/p11-kit-1.pc.in.orig 2023-10-24 07:58:49.000000000 -0500 | ||
+++ p11-kit-0.25.5/p11-kit/p11-kit-1.pc.in 2024-11-19 12:57:54.924556600 -0600 | ||
@@ -9,7 +9,7 @@ | ||
p11_module_configs=@p11_package_config_modules@ | ||
p11_module_path=@p11_module_path@ | ||
p11_trust_paths=@with_trust_paths@ | ||
-proxy_module=@libdir@/p11-kit-proxy@p11_shlext@ | ||
+proxy_module=libp11-kit-0.dll | ||
|
||
# This is for compatibility. Other packages were using this to determine | ||
# the directory they should install their module configs to, so override |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Wouldn't this be more correct?
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.
I was pondering about this. It does look good but I think it is impractical. If let be, applications that depend on it will likely compile the path in (
C:/msys64/ucrt64/bin/libp11-kit-0.dll
) thus making msys2 installation not so portable. Of course, one may patch up the application, but what is the point of having pkg-config then?Here is somewhat related (portability) issue #22187 . It looks like MSYS2 build farm uses
D:/a/MSYS64
prefix. However, for end user MSYS2 typically installs intoC:/MSYS64
. That impliesproxy_module
will be broken out of the gate for libp11 without more patching.Also speaking of pkg-config, while building libp11, I stumbled on this
I'm sure there is a reason why pkg-config expands prefix Windows style, but it causes pain as well.
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.
I see, hm. Hardcoding absolute path in binaries on Windows is a no-no in general, independent of pkg-config. Everything else works just as on Linux.
I'd say the real fix is to make libp11 relocatable, but I see that this here would be easier for now, hm... so guess this is fine.
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.
I see that libp11 calls pkg-config incorrectly in configure.ac in multiple places and doesn't provide the configured prefix to it. That would be even wrong on Linux if installing into a different prefix there (which is rarely used there though..)
Every call to pkg-config that gets used as an install path needs to be passed
--define-variable=prefix="${prefix}"
so the paths get relocated to the install prefix.That doesn't fix the hardcode issue, but fixes the wrong install paths.
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.
My only concern is whether there are any security (or other) implications by allowing to load everything with same name on the PATH. I think here it is okayish.
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.
Yeah, by not passing an absolute path it will even load from the current working dir before looking at PATH (with it using plain LoadLibrary), unless the exe is in the same dir.
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.
I think it is acceptable as one can just set
PKCS11_MODULE_PATH
environment variable in the first place.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.
Last but not least. Would it be better to use
sed
for a single line edits instead of a patch? Are patches the only acceptable norm?Is there any easy way to infer
-0
besides reading dlname fromlibp11-kit.la
? I mean how stable is it? I understand it comes somewhere from libtool but I'm clueless at this point what could make it-1
.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.
Usually it is
SOVERSION
IIRC