diff -Nru cmake-3.5.1/debian/changelog cmake-3.5.1/debian/changelog --- cmake-3.5.1/debian/changelog 2016-06-29 15:19:44.000000000 +0000 +++ cmake-3.5.1/debian/changelog 2016-09-27 08:24:04.000000000 +0000 @@ -1,3 +1,13 @@ +cmake (3.5.1-1ubuntu3) xenial; urgency=medium + + * cherry-pick from upstream to fix Ninja builds (LP: #1624832): + - debian/patches/f6c5958047ee8a9084bf230a6c1acb4801cb2b93.patch: + * cherry-pick Debian patch to fix build with libarchive from backports: + - Make FindLibArchive compatible with libarchive 3.2. (Closes: #828092) + - Add FindLibArchive_Support_libarchive_3.2.patch + + -- Gianfranco Costamagna Mon, 26 Sep 2016 19:38:26 +0200 + cmake (3.5.1-1ubuntu2) xenial; urgency=medium * cherry-picks from upstream to fix a GetProperty() crash (LP: #1564741): diff -Nru cmake-3.5.1/debian/patches/f6c5958047ee8a9084bf230a6c1acb4801cb2b93.patch cmake-3.5.1/debian/patches/f6c5958047ee8a9084bf230a6c1acb4801cb2b93.patch --- cmake-3.5.1/debian/patches/f6c5958047ee8a9084bf230a6c1acb4801cb2b93.patch 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.1/debian/patches/f6c5958047ee8a9084bf230a6c1acb4801cb2b93.patch 2016-09-27 08:24:04.000000000 +0000 @@ -0,0 +1,66 @@ +diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx +index 8a68af6..030b094 100644 +--- a/Source/cmLocalNinjaGenerator.cxx ++++ b/Source/cmLocalNinjaGenerator.cxx +@@ -400,7 +400,7 @@ cmLocalNinjaGenerator::WriteCustomCommandBuildStatement( + + bool symbolic = false; + for (std::vector::const_iterator o = outputs.begin(); +- o != outputs.end(); ++o) ++ !symbolic && o != outputs.end(); ++o) + { + if (cmSourceFile* sf = this->Makefile->GetSource(*o)) + { +@@ -444,7 +444,7 @@ cmLocalNinjaGenerator::WriteCustomCommandBuildStatement( + this->ConstructComment(ccg), + "Custom command for " + ninjaOutputs[0], + cc->GetUsesTerminal(), +- /*restat*/!symbolic, ++ /*restat*/!symbolic || !byproducts.empty(), + ninjaOutputs, + ninjaDeps, + orderOnlyDeps); +diff --git a/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake b/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake +new file mode 100644 +index 0000000..6948c35 +--- /dev/null ++++ b/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake +@@ -0,0 +1,28 @@ ++add_custom_command( ++ OUTPUT gen-byproduct gen-byproduct-stamp ++ BYPRODUCTS byproduct ++ COMMAND ${CMAKE_COMMAND} -E touch gen-byproduct-stamp ++ COMMAND ${CMAKE_COMMAND} -E copy_if_different gen-byproduct-stamp byproduct ++ ) ++set_property(SOURCE gen-byproduct PROPERTY SYMBOLIC 1) ++add_custom_target(produce DEPENDS gen-byproduct) ++ ++add_custom_command( ++ OUTPUT use-byproduct ++ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/byproduct ++ COMMAND ${CMAKE_COMMAND} -E touch use-byproduct ++ ) ++add_custom_target(drive ALL DEPENDS use-byproduct) ++add_dependencies(drive produce) ++ ++file(GENERATE OUTPUT check-$>.cmake CONTENT " ++if (check_step EQUAL 1) ++ set(check_pairs ++ \"${CMAKE_CURRENT_BINARY_DIR}/use-byproduct|${CMAKE_CURRENT_BINARY_DIR}/gen-byproduct-stamp\" ++ ) ++else() ++ set(check_pairs ++ \"${CMAKE_CURRENT_BINARY_DIR}/gen-byproduct-stamp|${CMAKE_CURRENT_BINARY_DIR}/use-byproduct\" ++ ) ++endif() ++") +diff --git a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake +index 6b2b85a..8541070 100644 +--- a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake ++++ b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake +@@ -39,4 +39,5 @@ if(NOT RunCMake_GENERATOR MATCHES "Visual Studio 7|Xcode") + unset(run_BuildDepends_skip_step_2) + endif() + ++run_BuildDepends(Custom-Symbolic-and-Byproduct) + run_BuildDepends(Custom-Always) diff -Nru cmake-3.5.1/debian/patches/FindLibArchive_Support_libarchive_3.2.patch cmake-3.5.1/debian/patches/FindLibArchive_Support_libarchive_3.2.patch --- cmake-3.5.1/debian/patches/FindLibArchive_Support_libarchive_3.2.patch 1970-01-01 00:00:00.000000000 +0000 +++ cmake-3.5.1/debian/patches/FindLibArchive_Support_libarchive_3.2.patch 2016-09-27 08:24:04.000000000 +0000 @@ -0,0 +1,33 @@ +From 38d18bab54cd9dceba5902dcb4407ecdb585953c Mon Sep 17 00:00:00 2001 +From: Orion Poplawski +Date: Fri, 3 Jun 2016 09:37:03 -0600 +Subject: [PATCH] FindLibArchive: Support libarchive 3.2 version string format + +--- + Modules/FindLibArchive.cmake | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/Modules/FindLibArchive.cmake b/Modules/FindLibArchive.cmake +index 471a4f1..dd93041 100644 +--- a/Modules/FindLibArchive.cmake ++++ b/Modules/FindLibArchive.cmake +@@ -42,14 +42,15 @@ mark_as_advanced(LibArchive_INCLUDE_DIR LibArchive_LIBRARY) + + # Extract the version number from the header. + if(LibArchive_INCLUDE_DIR AND EXISTS "${LibArchive_INCLUDE_DIR}/archive.h") +- # The version string appears in one of two known formats in the header: ++ # The version string appears in one of three known formats in the header: + # #define ARCHIVE_LIBRARY_VERSION "libarchive 2.4.12" + # #define ARCHIVE_VERSION_STRING "libarchive 2.8.4" +- # Match either format. +- set(_LibArchive_VERSION_REGEX "^#define[ \t]+ARCHIVE[_A-Z]+VERSION[_A-Z]*[ \t]+\"libarchive +([0-9]+)\\.([0-9]+)\\.([0-9]+)[^\"]*\".*$") ++ # #define ARCHIVE_VERSION_ONLY_STRING "3.2.0" ++ # Match any format. ++ set(_LibArchive_VERSION_REGEX "^#define[ \t]+ARCHIVE[_A-Z]+VERSION[_A-Z]*[ \t]+\"(libarchive +)?([0-9]+)\\.([0-9]+)\\.([0-9]+)[^\"]*\".*$") + file(STRINGS "${LibArchive_INCLUDE_DIR}/archive.h" _LibArchive_VERSION_STRING LIMIT_COUNT 1 REGEX "${_LibArchive_VERSION_REGEX}") + if(_LibArchive_VERSION_STRING) +- string(REGEX REPLACE "${_LibArchive_VERSION_REGEX}" "\\1.\\2.\\3" LibArchive_VERSION "${_LibArchive_VERSION_STRING}") ++ string(REGEX REPLACE "${_LibArchive_VERSION_REGEX}" "\\2.\\3.\\4" LibArchive_VERSION "${_LibArchive_VERSION_STRING}") + endif() + unset(_LibArchive_VERSION_REGEX) + unset(_LibArchive_VERSION_STRING) diff -Nru cmake-3.5.1/debian/patches/series cmake-3.5.1/debian/patches/series --- cmake-3.5.1/debian/patches/series 2016-06-29 15:19:44.000000000 +0000 +++ cmake-3.5.1/debian/patches/series 2016-09-27 08:30:33.000000000 +0000 @@ -5,3 +5,5 @@ ubuntu_cmake-crosscompile.patch bc30f8b5e66cb9c15fd224f5e51454c0bc66c67e.patch 0e44f4894f23d5eccd8d360f3420c832f9433a20.patch +f6c5958047ee8a9084bf230a6c1acb4801cb2b93.patch +FindLibArchive_Support_libarchive_3.2.patch