app-arch/innoextract: fix build with cmake 3.5
authorDaniel Scharrer <daniel@constexpr.org>
Thu, 10 Mar 2016 15:46:55 +0000 (16:46 +0100)
committerPatrice Clement <monsieurp@gentoo.org>
Thu, 10 Mar 2016 22:56:03 +0000 (22:56 +0000)
Closes: https://github.com/gentoo/gentoo/pull/1025
Signed-off-by: Patrice Clement <monsieurp@gentoo.org>
app-arch/innoextract/files/innoextract-1.4-cmake-3.5.patch [new file with mode: 0644]
app-arch/innoextract/innoextract-1.4.ebuild
app-arch/innoextract/innoextract-1.5.ebuild

diff --git a/app-arch/innoextract/files/innoextract-1.4-cmake-3.5.patch b/app-arch/innoextract/files/innoextract-1.4-cmake-3.5.patch
new file mode 100644 (file)
index 0000000..0b619ac
--- /dev/null
@@ -0,0 +1,31 @@
+From 01705758dd04d937160c99c8b87c6fa2057db894 Mon Sep 17 00:00:00 2001
+From: Daniel Scharrer <daniel@constexpr.org>
+Date: Tue, 23 Feb 2016 05:45:50 +0100
+Subject: [PATCH] CMake: Disable variable expansion for quoted strings in if()
+
+This makes the build system more rubust against stray variables
+coming from included CMake scripts provided by the system.
+
+Fixes build with CMake 3.5 (tested with 3.5.0-rc3).
+
+Fixes: issue #50
+---
+ CMakeLists.txt | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 02e0308..8653b93 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -2,6 +2,11 @@ project(innoextract)
+ cmake_minimum_required(VERSION 2.8)
++if(POLICY CMP0054)
++      # CMake 3.1+: Only interpret if() arguments as variables or keywords when unquoted.
++      cmake_policy(SET CMP0054 NEW)
++endif()
++
+ # Define configuration options
index 37b9d2f7617aaf2d85fc07b75a88d8213a0f289e..1fb858ef931cdceb7afc9fe39c14444ef08d1431 100644 (file)
@@ -48,6 +48,8 @@ pkg_pretend() {
 
 src_prepare() {
        epatch "${FILESDIR}"/${P}-cmake.patch
+       epatch "${FILESDIR}"/${P}-cmake-3.5.patch
+       cmake-utils_src_prepare
 }
 
 src_configure() {
index de642008c533bcde2747ad271465068e557e48a3..eedb4ed6dcbbc0ddbaf3851f67a2da01828e596e 100644 (file)
@@ -4,7 +4,7 @@
 
 EAPI=5
 
-inherit cmake-utils
+inherit eutils cmake-utils
 
 DESCRIPTION="A tool to unpack installers created by Inno Setup"
 HOMEPAGE="http://constexpr.org/innoextract/"
@@ -23,6 +23,11 @@ DEPEND="${RDEPEND}"
 
 DOCS=( README.md CHANGELOG )
 
+src_prepare() {
+       epatch "${FILESDIR}"/${PN}-1.4-cmake-3.5.patch
+       cmake-utils_src_prepare
+}
+
 src_configure() {
        local mycmakeargs=(
                $(cmake-utils_use_use lzma LZMA)