Skip to content

cmake: detect nettle when building with GnuTLS #14285

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

Closed
wants to merge 11 commits into from

Conversation

vszakats
Copy link
Member

@vszakats vszakats commented Jul 27, 2024

nettle is a direct dependency of curl, when building with GnuTLS.
Add a new Find module to detect it.

Also:

  • GHA/macos: drop nettle hack no longer necessary.
  • add nettle to libcurl.pc.
  • also add nettle to libcurl.pc in autotools builds.

Follow-up to 781242f #11967
Closes #14285

@github-actions github-actions bot added build CI Continuous Integration labels Jul 27, 2024
@vszakats vszakats changed the title cmake: detect nettle when building with GnuTLS cmake: detect nettle when building with GnuTLS Jul 27, 2024
@vszakats vszakats force-pushed the cmake-gnutls-nettle branch from b7831a7 to 0a8ddbd Compare July 27, 2024 18:00
vszakats added 2 commits July 27, 2024 20:56
This reverts commit 658e84a.

GnuTLS autotools build fails on macOS:
```
configure: error: GnuTLS found, but nettle was not found
```
https://github.com/curl/curl/actions/runs/10125730919/job/28001564901?pr=14285#step:8:250
@vszakats vszakats closed this in 669ce42 Jul 29, 2024
@vszakats vszakats deleted the cmake-gnutls-nettle branch July 29, 2024 18:42
vszakats added a commit to vszakats/curl that referenced this pull request Jul 30, 2024
The oldest cmake supported by curl is 3.7.0, which already has a guard
inside `pkg_check_modules()`. The advantage of leaving that to CMake is
that it will define/reset all variables, while the manual guard doesn't
do this and also leave `NETTLE_FOUND` undefined.

Delete the single use of this check in the recently added NETTLE patch
by accident. And re-introduce this later everywhere if we find it useful after
more evaluation.

Follow-up to 669ce42 curl#14285
Closes curl#14309
vszakats added a commit that referenced this pull request Jul 30, 2024
The oldest cmake supported by curl is v3.7.0, which already has such
guard (using `PKG_CONFIG_EXECUTABLE`) inside `pkg_check_modules()`. The
advantage of leaving that guard to CMake is that it will define/reset
all output variables, while the manual guard doesn't do this and also
leaves for example `NETTLE_FOUND` undefined.

Delete the single use of this guard from the recently added `nettle`
detection, where I included it by accident. Then possibly re-introduce
it universally if we find it useful after more evaluation.

Follow-up to 669ce42 #14285
Closes #14309
@lazka
Copy link

lazka commented Jul 31, 2024

I get this with 8.9.1:

  CMake Error at CMakeLists.txt:544 (find_package):
    By not providing "Findnettle.cmake" in CMAKE_MODULE_PATH this project has
    asked CMake to find a package configuration file provided by "nettle", but
    CMake did not find one.
  
    Could not find a package configuration file provided by "nettle" with any
    of the following names:
  
      nettleConfig.cmake
      nettle-config.cmake
  
    Add the installation prefix of "nettle" to CMAKE_PREFIX_PATH or set
    "nettle_DIR" to a directory containing one of the above files.  If "nettle"
    provides a separate development package or SDK, be sure it has been
    installed.

There is no Findnettle.cmake in the release tarball

@lazka
Copy link

lazka commented Jul 31, 2024

I just took the file from git for now. With that all seems fine.

@vszakats
Copy link
Member Author

Thanks for the report and I'm sorry about this. → #14320

@lazka
Copy link

lazka commented Jul 31, 2024

No problem :) thanks!

vszakats added a commit to vszakats/curl that referenced this pull request Jul 31, 2024
Follow-up to 669ce42 curl#14285
Reported-by: Christoph Reiter
Bug: curl#14285 (comment)
Closes curl#14320
vszakats added a commit that referenced this pull request Jul 31, 2024
Follow-up to 669ce42 #14285
Reported-by: Christoph Reiter
Bug: #14285 (comment)
Closes #14320
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build CI Continuous Integration cmake TLS
Development

Successfully merging this pull request may close these issues.

3 participants