Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Sep 2021 09:27:25 GMT
From:      Adriaan de Groot <adridg@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: aeb5f9cf181c - main - devel/cmake: fix CPack .pkg support, jump to 3.21.3
Message-ID:  <202109210927.18L9RPSJ086618@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by adridg:

URL: https://cgit.FreeBSD.org/ports/commit/?id=aeb5f9cf181c597d6c2c5fcb0497b2bce116896f

commit aeb5f9cf181c597d6c2c5fcb0497b2bce116896f
Author:     Adriaan de Groot <adridg@FreeBSD.org>
AuthorDate: 2021-09-21 09:16:05 +0000
Commit:     Adriaan de Groot <adridg@FreeBSD.org>
CommitDate: 2021-09-21 09:27:23 +0000

    devel/cmake: fix CPack .pkg support, jump to 3.21.3
    
    Update the patch for FreeBSD .pkg support in CPack to handle
    libpkg 1.17 and later's use of .pkg as package-suffix rather
    than .tgz. The PR below refers to this fix. I've kept code
    for older libpkg in case there are systems with weirdly
    mismatched current CMake and last-quarter's libpkg.
    
    The patch is still being upstreamed. The PR mentioned below
    is for this fix.
    
    While here, update to 3.21.3.  I've decided to -- unusual,
    for sure -- bump CMake without the usual exp-run, because:
    
    A regression in CMake 3.21.2 prompted a quick release of
    3.21.3 from upstream. The regression applies to the AMD ROCm
    platform, so that's not us. Other fixes in 3.21.3 apply to supported
    MSVC versions -- again, not us.
    
    There is new support for Boost 1.77 -- not in our ports yet.
    
    In other words, the git diff on CMake sources does not show
    anything that could affect us (famous last words). Release notes are at
            https://cmake.org/cmake/help/v3.21/release/3.21.html#id3
    
    PR:             257615
    Reported by:    Peter Laursen
---
 devel/cmake-doc/Makefile                  |  2 +-
 devel/cmake-gui/Makefile                  |  2 +-
 devel/cmake/Makefile                      |  2 +-
 devel/cmake/distinfo                      |  6 +--
 devel/cmake/files/patch-cmake-issue-18031 | 64 +++++++++++++++++++++++--------
 devel/cmake/pkg-plist                     | 10 -----
 6 files changed, 53 insertions(+), 33 deletions(-)

diff --git a/devel/cmake-doc/Makefile b/devel/cmake-doc/Makefile
index 690dab27afb3..7ccd22f540d4 100644
--- a/devel/cmake-doc/Makefile
+++ b/devel/cmake-doc/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	cmake
-DISTVERSION=	3.21.2
+DISTVERSION=	3.21.3
 CATEGORIES=	devel
 MASTER_SITES=	https://www.cmake.org/files/v${PORTVERSION:R}/
 PKGNAMESUFFIX=	-doc
diff --git a/devel/cmake-gui/Makefile b/devel/cmake-gui/Makefile
index 360f30c71b7f..ee63aa5b37f7 100644
--- a/devel/cmake-gui/Makefile
+++ b/devel/cmake-gui/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	cmake
-DISTVERSION=	3.21.2
+DISTVERSION=	3.21.3
 CATEGORIES=	devel
 MASTER_SITES=	https://www.cmake.org/files/v${PORTVERSION:R}/
 PKGNAMESUFFIX=	-gui
diff --git a/devel/cmake/Makefile b/devel/cmake/Makefile
index b3c4c52435f0..85be41cc8087 100644
--- a/devel/cmake/Makefile
+++ b/devel/cmake/Makefile
@@ -2,7 +2,7 @@
 
 PORTNAME=	cmake
 # Remember to update devel/cmake-doc and devel/cmake-gui as well.
-DISTVERSION=	3.21.2
+DISTVERSION=	3.21.3
 CATEGORIES=	devel
 MASTER_SITES=	https://github.com/Kitware/CMake/releases/download/v${DISTVERSION}/ \
 		https://www.cmake.org/files/v${PORTVERSION}/
diff --git a/devel/cmake/distinfo b/devel/cmake/distinfo
index dd0522d81cd3..fcf240a07331 100644
--- a/devel/cmake/distinfo
+++ b/devel/cmake/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1631212166
-SHA256 (cmake-3.21.2.tar.gz) = 94275e0b61c84bb42710f5320a23c6dcb2c6ee032ae7d2a616f53f68b3d21659
-SIZE (cmake-3.21.2.tar.gz) = 9630492
+TIMESTAMP = 1632174000
+SHA256 (cmake-3.21.3.tar.gz) = d14d06df4265134ee42c4d50f5a60cb8b471b7b6a47da8e5d914d49dd783794f
+SIZE (cmake-3.21.3.tar.gz) = 9630442
diff --git a/devel/cmake/files/patch-cmake-issue-18031 b/devel/cmake/files/patch-cmake-issue-18031
index 89681cf0b022..4185603c947e 100644
--- a/devel/cmake/files/patch-cmake-issue-18031
+++ b/devel/cmake/files/patch-cmake-issue-18031
@@ -1,4 +1,6 @@
---- Modules/Internal/CPack/CPackFreeBSD.cmake.orig	2021-03-23 15:43:17 UTC
+diff --git Modules/Internal/CPack/CPackFreeBSD.cmake Modules/Internal/CPack/CPackFreeBSD.cmake
+index ae40532017..c35089cbcf 100644
+--- Modules/Internal/CPack/CPackFreeBSD.cmake
 +++ Modules/Internal/CPack/CPackFreeBSD.cmake
 @@ -34,7 +34,7 @@ function(_cpack_freebsd_fallback_var OUTPUT_VAR_NAME)
      endif()
@@ -9,23 +11,28 @@
    endif()
  endfunction()
  
---- Source/CPack/cmCPackFreeBSDGenerator.cxx.orig	2021-03-23 15:43:17 UTC
+diff --git Source/CPack/cmCPackFreeBSDGenerator.cxx Source/CPack/cmCPackFreeBSDGenerator.cxx
+index 39ec3c83ed..c09989ceed 100644
+--- Source/CPack/cmCPackFreeBSDGenerator.cxx
 +++ Source/CPack/cmCPackFreeBSDGenerator.cxx
-@@ -21,8 +21,12 @@
+@@ -21,8 +21,15 @@
  
  #include <sys/stat.h>
  
-+// Suffix including the '.', used to tell libpkg what compression to use
-+static const char FreeBSDPackageSuffix[] = ".txz";
++// Suffix used to tell libpkg what compression to use
++static const char FreeBSDPackageCompression[] = "txz";
++// Resulting package file-suffix, for < 1.17 and >= 1.17 versions of libpkg
++static const char FreeBSDPackageSuffix_10[] = ".txz";
++static const char FreeBSDPackageSuffix_17[] = ".pkg";
 +
  cmCPackFreeBSDGenerator::cmCPackFreeBSDGenerator()
 -  : cmCPackArchiveGenerator(cmArchiveWrite::CompressXZ, "paxr", ".txz")
 +  : cmCPackArchiveGenerator(cmArchiveWrite::CompressXZ, "paxr",
-+                            FreeBSDPackageSuffix)
++                            FreeBSDPackageSuffix_17 /* old-style, updated if an old-style package is created */)
  {
  }
  
-@@ -35,6 +39,56 @@ int cmCPackFreeBSDGenerator::InitializeInternal()
+@@ -35,6 +42,56 @@ int cmCPackFreeBSDGenerator::InitializeInternal()
  
  cmCPackFreeBSDGenerator::~cmCPackFreeBSDGenerator() = default;
  
@@ -51,7 +58,7 @@
 +
 +  {
 +    if (d) {
-+      pkg_create_set_format(d, FreeBSDPackageSuffix + 1); // Skip over the '.'
++      pkg_create_set_format(d, FreeBSDPackageCompression); // Skip over the '.'
 +      pkg_create_set_compression_level(d, 0); // Explicitly set default
 +      pkg_create_set_overwrite(d, false);
 +      pkg_create_set_rootdir(d, toplevel_dir.c_str());
@@ -82,7 +89,7 @@
  // This is a wrapper, for use only in stream-based output,
  // that will output a string in UCL escaped fashion (in particular,
  // quotes and backslashes are escaped). The list of characters
-@@ -271,7 +325,7 @@ void write_manifest_files(cmGeneratedFileStream& s,
+@@ -271,7 +328,7 @@ void write_manifest_files(cmGeneratedFileStream& s,
    s << "\"files\": {\n";
    for (std::string const& file : files) {
      s << "  \"/" << cmSystemTools::RelativePath(toplevel, file) << "\": \""
@@ -91,7 +98,7 @@
        << "\",\n";
    }
    s << "  },\n";
-@@ -281,11 +335,10 @@ int cmCPackFreeBSDGenerator::PackageFiles()
+@@ -281,11 +338,10 @@ int cmCPackFreeBSDGenerator::PackageFiles()
  {
    if (!this->ReadListFile("Internal/CPack/CPackFreeBSD.cmake")) {
      cmCPackLogger(cmCPackLog::LOG_ERROR,
@@ -104,7 +111,7 @@
    cmWorkingDirectory wd(toplevel);
  
    files.erase(std::remove_if(files.begin(), files.end(), ignore_file),
-@@ -317,17 +370,59 @@ int cmCPackFreeBSDGenerator::PackageFiles()
+@@ -317,20 +373,79 @@ int cmCPackFreeBSDGenerator::PackageFiles()
                               ONE_PACKAGE_PER_COMPONENT);
    }
  
@@ -125,7 +132,7 @@
 +         ? std::string(currentPackage, 0, lastSlash + 1)
 +         : std::string()) +
 +      var_lookup("CPACK_FREEBSD_PACKAGE_NAME") + '-' +
-+      var_lookup("CPACK_FREEBSD_PACKAGE_VERSION") + FreeBSDPackageSuffix;
++      var_lookup("CPACK_FREEBSD_PACKAGE_VERSION") + FreeBSDPackageSuffix_17;
 +
 +    this->packageFileNames.clear();
 +    this->packageFileNames.emplace_back(actualPackage);
@@ -156,15 +163,38 @@
 +    return 0;
 +  }
  
-   std::string broken_suffix =
+-  std::string broken_suffix =
 -    cmStrCat('-', var_lookup("CPACK_TOPLEVEL_TAG"), ".txz");
-+    cmStrCat('-', var_lookup("CPACK_TOPLEVEL_TAG"), FreeBSDPackageSuffix);
++  // Specifically looking for packages suffixed with the TAG, either extension
++  std::string broken_suffix_10 =
++    cmStrCat('-', var_lookup("CPACK_TOPLEVEL_TAG"), FreeBSDPackageSuffix_10);
++  std::string broken_suffix_17 =
++    cmStrCat('-', var_lookup("CPACK_TOPLEVEL_TAG"), FreeBSDPackageSuffix_17);
    for (std::string& name : packageFileNames) {
      cmCPackLogger(cmCPackLog::LOG_DEBUG, "Packagefile " << name << std::endl);
-     if (cmHasSuffix(name, broken_suffix)) {
-       name.replace(name.size() - broken_suffix.size(), std::string::npos,
+-    if (cmHasSuffix(name, broken_suffix)) {
+-      name.replace(name.size() - broken_suffix.size(), std::string::npos,
 -                   ".txz");
-+                   FreeBSDPackageSuffix);
++    if (cmHasSuffix(name, broken_suffix_10)) {
++      name.replace(name.size() - broken_suffix_10.size(), std::string::npos,
++                   FreeBSDPackageSuffix_10);
++      break;
++    }
++    if (cmHasSuffix(name, broken_suffix_17)) {
++      name.replace(name.size() - broken_suffix_17.size(), std::string::npos,
++                   FreeBSDPackageSuffix_17);
        break;
      }
    }
++  // If the name uses a *new* style name, which doesn't exist, but there
++  // is an *old* style name, then use that instead. This indicates we used
++  // an older libpkg, which still creates .txz instead of .pkg files.
++  for (std::string& name : packageFileNames) {
++    if (cmHasSuffix(name, FreeBSDPackageSuffix_17) && !cmSystemTools::FileExists(name)) {
++      const std::string suffix(FreeBSDPackageSuffix_17);
++      name.replace(name.size() - suffix.size(), std::string::npos, suffix);
++    }
++  }
+ 
+   return 1;
+ }
diff --git a/devel/cmake/pkg-plist b/devel/cmake/pkg-plist
index b4f4383ecf21..ea210f640265 100644
--- a/devel/cmake/pkg-plist
+++ b/devel/cmake/pkg-plist
@@ -1933,7 +1933,6 @@ share/bash-completion/completions/ctest
 %%DATADIR%%/Modules/CMakeHIPCompilerABI.hip
 %%DATADIR%%/Modules/CMakeHIPCompilerId.hip.in
 %%DATADIR%%/Modules/CMakeHIPInformation.cmake
-%%DATADIR%%/Modules/CMakeHIPRuntime.cmake.in
 %%DATADIR%%/Modules/CMakeIOSInstallCombined.cmake
 %%DATADIR%%/Modules/CMakeISPCCompiler.cmake.in
 %%DATADIR%%/Modules/CMakeISPCCompilerABI.ispc
@@ -2201,15 +2200,6 @@ share/bash-completion/completions/ctest
 %%DATADIR%%/Modules/Compiler/QCC-CXX-FeatureTests.cmake
 %%DATADIR%%/Modules/Compiler/QCC-CXX.cmake
 %%DATADIR%%/Modules/Compiler/QCC.cmake
-%%DATADIR%%/Modules/Compiler/ROCMClang-ASM.cmake
-%%DATADIR%%/Modules/Compiler/ROCMClang-C.cmake
-%%DATADIR%%/Modules/Compiler/ROCMClang-CXX.cmake
-%%DATADIR%%/Modules/Compiler/ROCMClang-DetermineCompiler.cmake
-%%DATADIR%%/Modules/Compiler/ROCMClang-FindBinUtils.cmake
-%%DATADIR%%/Modules/Compiler/ROCMClang-HIP.cmake
-%%DATADIR%%/Modules/Compiler/ROCMClang-OBJC.cmake
-%%DATADIR%%/Modules/Compiler/ROCMClang-OBJCXX.cmake
-%%DATADIR%%/Modules/Compiler/ROCMClang.cmake
 %%DATADIR%%/Modules/Compiler/SCO-C.cmake
 %%DATADIR%%/Modules/Compiler/SCO-CXX.cmake
 %%DATADIR%%/Modules/Compiler/SCO-DetermineCompiler.cmake



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109210927.18L9RPSJ086618>