[arch-commits] Commit in cmake/trunk (2 files)
Evangelos Foutras
foutrelis at archlinux.org
Mon Dec 29 17:14:19 UTC 2014
Date: Monday, December 29, 2014 @ 18:14:18
Author: foutrelis
Revision: 228153
upgpkg: cmake 3.1.0-2
Fix FindRuby.cmake to properly detect Ruby 2.2.0.
Added:
cmake/trunk/0001-FindRuby-Fix-output-check-in-_RUBY_CONFIG_VAR.patch
Modified:
cmake/trunk/PKGBUILD
----------------------------------------------------------+
0001-FindRuby-Fix-output-check-in-_RUBY_CONFIG_VAR.patch | 41 +++++++++++++
PKGBUILD | 15 +++-
2 files changed, 53 insertions(+), 3 deletions(-)
Added: 0001-FindRuby-Fix-output-check-in-_RUBY_CONFIG_VAR.patch
===================================================================
--- 0001-FindRuby-Fix-output-check-in-_RUBY_CONFIG_VAR.patch (rev 0)
+++ 0001-FindRuby-Fix-output-check-in-_RUBY_CONFIG_VAR.patch 2014-12-29 17:14:18 UTC (rev 228153)
@@ -0,0 +1,41 @@
+From 339fc9de27d54edec3c0b71e9e1aba858c408399 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos at foutrelis.com>
+Date: Mon, 29 Dec 2014 18:19:08 +0200
+Subject: [PATCH] FindRuby: Fix output check in _RUBY_CONFIG_VAR
+
+Since commit 854e762 (FindRuby: clean up querying variables from Ruby)
+we query RbConfig::CONFIG first and, if the command fails or its output
+equates to a false constant, then fall back to querying Config::CONFIG.
+
+Due to the above, an error condition exists with Ruby 2.2.0; when querying
+RbConfig::CONFIG['TEENY'], the output of '0' will be discarded since it
+matches the false constant '0'.
+
+In previous versions this wasn't a problem, but Ruby 2.2 has completely
+removed Config::CONFIG. This causes RUBY_VERSION_PATCH to be set to an
+empty string and the Ruby version to be detected as '2.2.' (instead of
+'2.2.0').
+
+This patch fixes the output check to explicitly look for an empty string
+before using the fallback query method. (Someone more familiar with Ruby
+might be able to deem the fallback as unnecessary and fully remove it.)
+---
+ Modules/FindRuby.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake
+index b5ac703..0950d15 100644
+--- a/Modules/FindRuby.cmake
++++ b/Modules/FindRuby.cmake
+@@ -90,7 +90,7 @@ if(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR)
+ RESULT_VARIABLE _RUBY_SUCCESS
+ OUTPUT_VARIABLE _RUBY_OUTPUT
+ ERROR_QUIET)
+- if(_RUBY_SUCCESS OR NOT _RUBY_OUTPUT)
++ if(_RUBY_SUCCESS OR _RUBY_OUTPUT STREQUAL "")
+ execute_process(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['${RBVAR}']"
+ RESULT_VARIABLE _RUBY_SUCCESS
+ OUTPUT_VARIABLE _RUBY_OUTPUT
+--
+2.2.1
+
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2014-12-29 16:40:28 UTC (rev 228152)
+++ PKGBUILD 2014-12-29 17:14:18 UTC (rev 228153)
@@ -4,7 +4,7 @@
pkgname=cmake
pkgver=3.1.0
-pkgrel=1
+pkgrel=2
pkgdesc='A cross-platform open-source make system'
arch=('i686' 'x86_64')
url="http://www.cmake.org/"
@@ -14,9 +14,18 @@
optdepends=('qt5-base: cmake-gui'
'libxkbcommon-x11: cmake-gui')
install="${pkgname}.install"
-source=("http://www.cmake.org/files/v${pkgver%.*}/${pkgname}-${pkgver}.tar.gz")
-md5sums=('188eb7dc9b1b82b363bc51c0d3f1d461')
+source=("http://www.cmake.org/files/v${pkgver%.*}/${pkgname}-${pkgver}.tar.gz"
+ 0001-FindRuby-Fix-output-check-in-_RUBY_CONFIG_VAR.patch)
+md5sums=('188eb7dc9b1b82b363bc51c0d3f1d461'
+ 'c21e3e63501e1ee7aa6092851089f8ad')
+prepare() {
+ cd ${pkgname}-${pkgver}
+
+ # http://public.kitware.com/pipermail/cmake-developers/2014-December/024044.html
+ patch -Np1 -i ../0001-FindRuby-Fix-output-check-in-_RUBY_CONFIG_VAR.patch
+}
+
build() {
cd ${pkgname}-${pkgver}
More information about the arch-commits
mailing list