Skip to content

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

Closed
vszakats wants to merge 6 commits intolibssh2:masterfrom
vszakats:pc-refix-static-deps
Closed

libssh2.pc: re-add & extend support for static-only libssh2 builds#1119
vszakats wants to merge 6 commits intolibssh2:masterfrom
vszakats:pc-refix-static-deps

Conversation

@vszakats
Copy link
Copy Markdown
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
Copy Markdown
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 force-pushed the pc-refix-static-deps branch from b15a180 to 67d222b Compare July 14, 2023 21:10
@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
@vszakats vszakats force-pushed the pc-refix-static-deps branch from 67d222b to ada9a97 Compare July 15, 2023 10:55
vszakats added 2 commits July 15, 2023 11:03
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 force-pushed the pc-refix-static-deps branch from ada9a97 to 8dbc258 Compare July 15, 2023 11:03
@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 force-pushed the pc-refix-static-deps branch from 92af986 to e0b0cb7 Compare July 16, 2023 10:29
@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
agreppin pushed a commit to agreppin/libssh2 that referenced this pull request Jul 14, 2024
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.

1 participant