Skip to content
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

libssh2.pc: re-add & extend support for static-only libssh2 builds #1119

Closed
wants to merge 6 commits into from

Conversation

vszakats
Copy link
Member

@vszakats vszakats commented Jul 13, 2023

Adapted for libssh2 from the curl commit message by James Le Cuirot:

"A project built entirely statically will call pkg-config with
--static, which utilises the Libs.private: field. Conversely it will
not use --static when not being built entirely statically, even if
there is only a static build of libssh2 available. This will most
likely cause the build to fail due to underlinking unless we merge the
Libs: fields.

Consider that this is what the Meson build system does when it generates
pkg-config files."

This patch extends the above to Requires:, to mirror Libs: with
pkg-config package names.

Follow-up to 1209c16 #1114

Ref: #1114 (comment)
Ref: curl/curl@98e5904
Ref: curl/curl#5373
Closes #1119

@vszakats
Copy link
Member Author

vszakats commented Jul 14, 2023

Misc observations comparing libssh2.pc generated by autotools and CMake and with libcurl.pc:

Ref:

@vszakats vszakats changed the title libssh2.pc: refix Libs: for static builds libssh2.pc: refix Libs: for static-only builds Jul 14, 2023
@vszakats vszakats changed the title libssh2.pc: refix Libs: for static-only builds libssh2.pc: fixup Libs: for static-only builds Jul 14, 2023
vszakats added a commit to vszakats/libssh2 that referenced this pull request Jul 14, 2023
Quoting the curl commit message (adapted for libssh2):

"A project being built entirely statically will call pkg-config with
`--static`, which utilises the `Libs.private` field. Conversely it will
not use `--static` when not being built entirely statically, even if
there is only a static build of libssh2 available. This will most
likely cause the build to fail due to underlinking unless we merge the
`Libs` fields.

Consider that this is what the Meson build system does when it
generates pkg-config files."

Follow-up to 1209c16 libssh2#1114

Ref: curl/curl@98e5904
Ref: curl/curl#5373
Closes libssh2#1119
@vszakats vszakats changed the title libssh2.pc: fixup Libs: for static-only builds libssh2.pc: adjust Libs: for static-only builds Jul 14, 2023
@vszakats

This comment was marked as outdated.

@vszakats vszakats removed the bug label Jul 14, 2023
@vszakats vszakats changed the title libssh2.pc: adjust Libs: for static-only builds libssh2.pc: restore Libs: for static-only builds Jul 15, 2023
vszakats added a commit to vszakats/libssh2 that referenced this pull request Jul 15, 2023
Quoting the curl commit message (adapted for libssh2):

"A project being built entirely statically will call pkg-config with
`--static`, which utilises the `Libs.private` field. Conversely it will
not use `--static` when not being built entirely statically, even if
there is only a static build of libssh2 available. This will most
likely cause the build to fail due to underlinking unless we merge the
`Libs` fields.

Consider that this is what the Meson build system does when it
generates pkg-config files."

Follow-up to 1209c16 libssh2#1114

Ref: curl/curl@98e5904
Ref: curl/curl#5373
Closes libssh2#1119
Quoting the curl commit message (adapted for libssh2):

"A project being built entirely statically will call pkg-config with
`--static`, which utilises the `Libs.private` field. Conversely it will
not use `--static` when not being built entirely statically, even if
there is only a static build of libssh2 available. This will most
likely cause the build to fail due to underlinking unless we merge the
`Libs` fields.

Consider that this is what the Meson build system does when it
generates pkg-config files."

Follow-up to 1209c16 libssh2#1114

Ref: curl/curl@98e5904
Ref: curl/curl#5373
Closes libssh2#1119
@vszakats vszakats changed the title libssh2.pc: restore Libs: for static-only builds libssh2.pc: adjust for static-only builds Jul 15, 2023
@vszakats vszakats changed the title libssh2.pc: adjust for static-only builds libssh2.pc: make it work better for static-only builds Jul 15, 2023
@vszakats vszakats changed the title libssh2.pc: make it work better for static-only builds libssh2.pc: re-add & expand support for static-only libssh2 builds Jul 16, 2023
@vszakats vszakats changed the title libssh2.pc: re-add & expand support for static-only libssh2 builds libssh2.pc: re-add & extend support for static-only libssh2 builds Jul 18, 2023
@vszakats vszakats closed this in 624abe2 Jul 18, 2023
@vszakats vszakats deleted the pc-refix-static-deps branch July 18, 2023 15:19
lampmanyao pushed a commit to lampmanyao/libssh2 that referenced this pull request Sep 3, 2023
Adapted for libssh2 from the curl commit message by James Le Cuirot:

"A project built entirely statically will call `pkg-config` with
`--static`, which utilises the `Libs.private:` field. Conversely it will
not use `--static` when not being built entirely statically, even if
there is only a static build of libssh2 available. This will most
likely cause the build to fail due to underlinking unless we merge the
`Libs:` fields.

Consider that this is what the Meson build system does when it generates
`pkg-config` files."

This patch extends the above to `Requires:`, to mirror `Libs:` with
`pkg-config` package names.

Follow-up to 1209c16 libssh2#1114

Ref: libssh2#1114 (comment)
Ref: curl/curl@98e5904
Ref: curl/curl#5373
Closes libssh2#1119
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant