From 6488aa98343725ed2f6ecd4cb8b50007d43c963a15ba004c9b040474959df2bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Wed, 8 Jun 2016 07:51:45 +0000 Subject: [PATCH] - Add libarchive-version.patch to fix version detecting for libarchive 3.2 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/cmake?expand=0&rev=248 --- cmake.changes | 6 ++++++ cmake.spec | 3 +++ libarchive-version.patch | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 libarchive-version.patch diff --git a/cmake.changes b/cmake.changes index e3f4d67..172522e 100644 --- a/cmake.changes +++ b/cmake.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jun 8 07:48:02 UTC 2016 - idonmez@suse.com + +- Add libarchive-version.patch to fix version detecting for + libarchive 3.2 + ------------------------------------------------------------------- Sat Apr 16 12:57:14 UTC 2016 - astieger@suse.com diff --git a/cmake.spec b/cmake.spec index a0c1d33..7cc481a 100644 --- a/cmake.spec +++ b/cmake.spec @@ -37,6 +37,8 @@ Patch4: form.patch Patch5: system-libs.patch # PATCH-FIX-SUSE cmake-version-in-generated-files.patch -- version number to be found in OBS Patch6: cmake-version-in-generated-files.patch +# PATCH-FIX-UPSTREAM libarchive-version.patch -- Fix version detecting for libarchive 3.2 +Patch7: libarchive-version.patch BuildRequires: curl-devel BuildRequires: fdupes BuildRequires: gcc-c++ @@ -68,6 +70,7 @@ echo "`grep %{name}-%{version}.tar.gz %{SOURCE5} | grep -Eo '^[0-9a-f]+'` %{SOU %patch4 -p1 %patch5 -p1 %patch6 -p1 +%patch7 -p1 %build export CXXFLAGS="%{optflags}" diff --git a/libarchive-version.patch b/libarchive-version.patch new file mode 100644 index 0000000..b50fda6 --- /dev/null +++ b/libarchive-version.patch @@ -0,0 +1,32 @@ +From: Orion Poplawski +Date: Fri, 3 Jun 2016 15:37:03 +0000 (-0600) +Subject: FindLibArchive: Support libarchive 3.2 version string format +X-Git-Url: https://cmake.org/gitweb?p=cmake.git;a=commitdiff_plain;h=38d18bab + +FindLibArchive: Support libarchive 3.2 version string format +--- + +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)