[cmake] Fix FindFreetype for 2.5.1+

Orion Poplawski orion at fedoraproject.org
Thu Jan 23 03:37:13 UTC 2014


commit 960dc151d9c01dd156db134ab3d84c6020c3c3c6
Author: Orion Poplawski <orion at cora.nwra.com>
Date:   Wed Jan 22 20:37:31 2014 -0700

    Fix FindFreetype for 2.5.1+

 cmake-FindFreetype.patch |   43 +++++++++++++++++++++++++++++++++++++++++++
 cmake.spec               |   10 +++++++++-
 2 files changed, 52 insertions(+), 1 deletions(-)
---
diff --git a/cmake-FindFreetype.patch b/cmake-FindFreetype.patch
new file mode 100644
index 0000000..1de0dff
--- /dev/null
+++ b/cmake-FindFreetype.patch
@@ -0,0 +1,43 @@
+From: Julian Ospald <hasufell at gentoo.org>
+Date: Sun Dec  8 13:38:06 UTC 2013
+Subject: fix check for freetype-2.5.1
+
+--- cmake/Modules/FindFreetype.cmake
++++ cmake/Modules/FindFreetype.cmake
+@@ -64,6 +64,19 @@
+   PATH_SUFFIXES include/freetype2 include
+ )
+ 
++if(NOT FREETYPE_INCLUDE_DIR_freetype2)
++  find_path(FREETYPE_INCLUDE_DIR_freetype2 config/ftheader.h
++    HINTS
++      ENV FREETYPE_DIR
++    PATHS
++      /usr/X11R6
++      /usr/local/X11R6
++      /usr/local/X11
++      /usr/freeware
++    PATH_SUFFIXES include/freetype2 include
++  )
++endif()
++
+ find_library(FREETYPE_LIBRARY
+   NAMES freetype libfreetype freetype219
+   HINTS
+@@ -82,8 +95,14 @@
+ endif()
+ set(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}")
+ 
+-if(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
+-    file(STRINGS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h" freetype_version_str
++if(EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
++  set(FREETYPE_H "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
++elseif(EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype.h")
++  set(FREETYPE_H "${FREETYPE_INCLUDE_DIR_freetype2}/freetype.h")
++endif()
++
++if(FREETYPE_INCLUDE_DIR_freetype2 AND FREETYPE_H)
++    file(STRINGS "${FREETYPE_H}" freetype_version_str
+          REGEX "^#[\t ]*define[\t ]+FREETYPE_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$")
+ 
+     unset(FREETYPE_VERSION_STRING)
diff --git a/cmake.spec b/cmake.spec
index b48aafd..c4aabb3 100644
--- a/cmake.spec
+++ b/cmake.spec
@@ -13,7 +13,7 @@
 
 Name:           cmake
 Version:        2.8.12.1
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Cross-platform make system
 
 Group:          Development/Tools
@@ -53,6 +53,10 @@ Patch6:         cmake-strict_aliasing.patch
 Patch7:         cmake-desktop_icon.patch
 # Remove automatic Qt module dep adding
 Patch8:         cmake-qtdeps.patch
+# Fix FindFreetype for 2.5.1+
+# http://public.kitware.com/Bug/view.php?id=14601
+Patch9:		cmake-FindFreetype.patch
+
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  gcc-gfortran
@@ -120,6 +124,7 @@ The %{name}-gui package contains the Qt based GUI for CMake.
 %patch6 -p1
 %patch7 -p1
 %patch8 -p1
+%patch9 -p1
 # Setup copyright docs for main package
 mkdir _doc
 find Source Utilities -type f -iname copy\* | while read f
@@ -231,6 +236,9 @@ update-mime-database %{_datadir}/mime &> /dev/null || :
 
 
 %changelog
+* Wed Jan 22 2014 Orion Poplawski <orion at cora.nwra.com> - 2.8.12.1-2
+- Fix FindFreetype for 2.5.1+
+
 * Wed Nov 6 2013 Orion Poplawski <orion at cora.nwra.com> - 2.8.12.1-1
 - Update to 2.8.12.1
 


More information about the scm-commits mailing list