public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Andreas Sturmlechner" <asturm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/cmake/files/, dev-util/cmake/
Date: Sat, 12 Dec 2020 18:02:46 +0000 (UTC)	[thread overview]
Message-ID: <1607795903.814b6b0d056d858c629720ca1a97400688d2542f.asturm@gentoo> (raw)

commit:     814b6b0d056d858c629720ca1a97400688d2542f
Author:     Adrian Grigo <agrigo2001 <AT> yahoo <DOT> com <DOT> au>
AuthorDate: Tue Dec  8 03:19:22 2020 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sat Dec 12 17:58:23 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=814b6b0d

dev-util/cmake: Backport FPHSA fix

Changes to Find Package Handle Standard Args in 3.19.0 result in
an error when compiling openvdb-7.1.0.

This is a known problem in cmake and the fix has been merged into
3.19.2 upstream.

See https://gitlab.kitware.com/cmake/cmake/-/issues/21505

To produce the bug:
emerge dev-util/cmake-3.19.0 or 3.19.1 (the bug not exist in <= 3.18)
emerge media-gfx/openvdb-7.1.0-r1

Compilation fails with
find_package_check_version(): Cannot be used outside a 'Find Module'

To fix the bug:
Apply the patch provided in this bug fix to cmake, then repeat the
above steps and compilation of openvdb succeeds.

The patch ensures that the CMAKE_FPHSA_PACKAGE_NAME package is made
available outside find_package.

Thanks to Dennis Schridde for finding the upstream fix, produced by
Marc Chevrier.

* committer-comment: use Gentoo bug ref; git format-patch 14ecf9c2f

Signed-off-by: Adrian Grigo <agrigo2001 <AT> yahoo.com.au>
Closes: https://bugs.gentoo.org/755743
Package-Manager: Portage-3.0.9, Repoman-3.0.2
Closes: https://github.com/gentoo/gentoo/pull/18560
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 dev-util/cmake/cmake-3.19.1-r1.ebuild              |  1 +
 ...ake-3.19.1-use-FPHSA-outside-find_package.patch | 40 ++++++++++++++++++++++
 2 files changed, 41 insertions(+)

diff --git a/dev-util/cmake/cmake-3.19.1-r1.ebuild b/dev-util/cmake/cmake-3.19.1-r1.ebuild
index 97f173f95a8..2726694149e 100644
--- a/dev-util/cmake/cmake-3.19.1-r1.ebuild
+++ b/dev-util/cmake/cmake-3.19.1-r1.ebuild
@@ -70,6 +70,7 @@ PATCHES=(
 
 	# upstream fixes (can usually be removed with a version bump)
 	"${FILESDIR}"/${P}-fix-spurious-include-target.patch # bug 759271
+	"${FILESDIR}"/${P}-use-FPHSA-outside-find_package.patch # bug 755743
 )
 
 cmake_src_bootstrap() {

diff --git a/dev-util/cmake/files/cmake-3.19.1-use-FPHSA-outside-find_package.patch b/dev-util/cmake/files/cmake-3.19.1-use-FPHSA-outside-find_package.patch
new file mode 100644
index 00000000000..8cde769ce8f
--- /dev/null
+++ b/dev-util/cmake/files/cmake-3.19.1-use-FPHSA-outside-find_package.patch
@@ -0,0 +1,40 @@
+From 14ecf9c2f6edfae4033d9311f79d79d0d07fc1cf Mon Sep 17 00:00:00 2001
+From: Marc Chevrier <marc.chevrier@gmail.com>
+Date: Wed, 25 Nov 2020 16:36:12 +0100
+Subject: [PATCH] FPHSA: ensure it can be used outside 'find_package'
+
+Fixes: #21505
+---
+ Modules/FindPackageHandleStandardArgs.cmake | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake
+index 7af017136d..7e172779e4 100644
+--- a/Modules/FindPackageHandleStandardArgs.cmake
++++ b/Modules/FindPackageHandleStandardArgs.cmake
+@@ -275,8 +275,10 @@ function(FIND_PACKAGE_CHECK_VERSION version result)
+     unset (${FPCV_RESULT_MESSAGE_VARIABLE} PARENT_SCOPE)
+   endif()
+ 
+-  if (CMAKE_FIND_PACKAGE_NAME)
+-    set (package ${CMAKE_FIND_PACKAGE_NAME})
++  if (_CMAKE_FPHSA_PACKAGE_NAME)
++    set (package "${_CMAKE_FPHSA_PACKAGE_NAME}")
++  elseif (CMAKE_FIND_PACKAGE_NAME)
++    set (package "${CMAKE_FIND_PACKAGE_NAME}")
+   else()
+     message (FATAL_ERROR "find_package_check_version(): Cannot be used outside a 'Find Module'")
+   endif()
+@@ -436,6 +438,9 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
+       "will be used.")
+   endif()
+ 
++  # to propagate package name to FIND_PACKAGE_CHECK_VERSION
++  set(_CMAKE_FPHSA_PACKAGE_NAME "${_NAME}")
++
+   # now that we collected all arguments, process them
+ 
+   if("x${FPHSA_FAIL_MESSAGE}" STREQUAL "xDEFAULT_MSG")
+-- 
+GitLab
+


             reply	other threads:[~2020-12-12 18:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-12 18:02 Andreas Sturmlechner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-09-11 23:54 [gentoo-commits] repo/gentoo:master commit in: dev-util/cmake/files/, dev-util/cmake/ Sam James
2021-05-26 11:32 Lars Wendler
2021-05-14 18:22 Andreas Sturmlechner
2020-11-28 15:22 Fabian Groffen
2020-09-06 16:46 Andreas Sturmlechner
2019-11-19 12:43 Lars Wendler
2019-06-22 14:49 Lars Wendler
2018-06-24  9:34 Andreas Sturmlechner
2018-03-12 15:32 Lars Wendler
2018-02-28  9:29 Lars Wendler
2018-02-27 10:06 Lars Wendler
2017-12-14 19:38 Lars Wendler
2017-10-05  8:46 Lars Wendler
2017-09-07 12:09 Michael Palimaka
2017-03-14  7:30 Michael Palimaka
2017-03-13 12:11 Michael Palimaka
2016-12-17  7:08 Johannes Huber
2016-12-15 17:00 Lars Wendler
2016-08-28 16:19 Michał Górny
2016-07-15  5:44 Johannes Huber
2016-03-09 20:20 Lars Wendler
2015-10-10 17:36 Michael Palimaka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1607795903.814b6b0d056d858c629720ca1a97400688d2542f.asturm@gentoo \
    --to=asturm@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox