cmake: WIP

This commit is contained in:
Alexpux
2015-03-12 20:50:30 +03:00
parent 3b070840e9
commit 5ebf2c7957
7 changed files with 1794 additions and 0 deletions

237
cmake/2.8.11-cygwin.patch Normal file
View File

@@ -0,0 +1,237 @@
--- origsrc/cmake-2.8.10/Source/cmFileCommand.cxx 2012-10-31 10:32:06.000000000 -0500
+++ src/cmake-2.8.10/Source/cmFileCommand.cxx 2013-03-16 22:55:11.306681100 -0500
@@ -1002,7 +1002,7 @@ protected:
MatchProperties CollectMatchProperties(const char* file)
{
// Match rules are case-insensitive on some platforms.
-#if defined(_WIN32) || defined(__APPLE__) || defined(__CYGWIN__)
+#if defined(_WIN32) || defined(__APPLE__)
std::string lower = cmSystemTools::LowerCase(file);
const char* file_to_match = lower.c_str();
#else
--- origsrc/cmake-2.8.10/Source/cmInstallCommand.cxx 2012-10-31 10:32:06.000000000 -0500
+++ src/cmake-2.8.10/Source/cmInstallCommand.cxx 2013-03-16 22:56:21.008667800 -0500
@@ -1090,7 +1090,7 @@ cmInstallCommand::HandleDirectoryMode(st
{
literal_args += " REGEX \"";
// Match rules are case-insensitive on some platforms.
-#if defined(_WIN32) || defined(__APPLE__) || defined(__CYGWIN__)
+#if defined(_WIN32) || defined(__APPLE__)
std::string regex = cmSystemTools::LowerCase(args[i]);
#else
std::string regex = args[i];
--- origsrc/cmake-2.8.10/Source/kwsys/Glob.cxx 2012-10-31 10:32:06.000000000 -0500
+++ src/cmake-2.8.10/Source/kwsys/Glob.cxx 2013-03-16 22:58:54.192429400 -0500
@@ -37,7 +37,7 @@
#include <string.h>
namespace KWSYS_NAMESPACE
{
-#if defined(_WIN32) || defined(__APPLE__) || defined(__CYGWIN__)
+#if defined(_WIN32) || defined(__APPLE__)
// On Windows and apple, no difference between lower and upper case
# define KWSYS_GLOB_CASE_INDEPENDENT
#endif
--- origsrc/cmake-2.8.11/Source/kwsys/SystemInformation.cxx 2013-05-15 12:38:13.000000000 -0500
+++ src/cmake-2.8.11/Source/kwsys/SystemInformation.cxx 2013-07-08 01:57:31.216321800 -0500
@@ -888,7 +888,7 @@ void SystemInformation::RunMemoryCheck()
// Hide implementation details in an anonymous namespace.
namespace {
// *****************************************************************************
-#if defined(__linux) || defined(__APPLE__)
+#if defined(__linux) || defined(__APPLE__) || defined(__CYGWIN__)
int LoadLines(
FILE *file,
kwsys_stl::vector<kwsys_stl::string> &lines)
@@ -918,7 +918,7 @@ int LoadLines(
return nRead;
}
-# if defined(__linux)
+# if defined(__linux) || defined(__CYGWIN__)
// *****************************************************************************
int LoadLines(
const char *fileName,
@@ -957,7 +957,7 @@ int NameValue(
}
#endif
-#if defined(__linux)
+#if defined(__linux) || defined(__CYGWIN__)
// ****************************************************************************
template<typename T>
int GetFieldsFromFile(
@@ -2869,7 +2869,6 @@ bool SystemInformationImplementation::Re
pos = buffer.find("processor\t",pos+1);
}
-#ifdef __linux
// Find the largest physical id.
int maxId = -1;
kwsys_stl::string idc =
@@ -2893,14 +2892,6 @@ bool SystemInformationImplementation::Re
this->NumberOfPhysicalCPU=static_cast<unsigned int>(
numberOfCoresPerCPU*(maxId+1));
-#else // __CYGWIN__
- // does not have "physical id" entries, neither "cpu cores"
- // this has to be fixed for hyper-threading.
- kwsys_stl::string cpucount =
- this->ExtractValueFromCpuInfoFile(buffer,"cpu count");
- this->NumberOfPhysicalCPU=
- this->NumberOfLogicalCPU = atoi(cpucount.c_str());
-#endif
// gotta have one, and if this is 0 then we get a / by 0n
// better to have a bad answer than a crash
if(this->NumberOfPhysicalCPU <= 0)
@@ -3086,7 +3077,7 @@ SystemInformationImplementation::GetHost
GlobalMemoryStatusEx(&statex);
return statex.ullTotalPhys/1024;
# endif
-#elif defined(__linux)
+#elif defined(__linux) || defined(__CYGWIN__)
SystemInformation::LongLong memTotal=0;
int ierr=GetFieldFromFile("/proc/meminfo","MemTotal:",memTotal);
if (ierr)
@@ -3217,7 +3208,7 @@ SystemInformationImplementation::GetHost
GlobalMemoryStatusEx(&statex);
return (statex.ullTotalPhys - statex.ullAvailPhys)/1024;
# endif
-#elif defined(__linux)
+#elif defined(__linux) || defined(__CYGWIN__)
const char *names[3]={"MemTotal:","MemFree:",NULL};
SystemInformation::LongLong values[2]={SystemInformation::LongLong(0)};
int ierr=GetFieldsFromFile("/proc/meminfo",names,values);
@@ -3276,7 +3267,7 @@ SystemInformationImplementation::GetProc
return -2;
}
return pmc.WorkingSetSize/1024;
-#elif defined(__linux)
+#elif defined(__linux) || defined(__CYGWIN__)
SystemInformation::LongLong memUsed=0;
int ierr=GetFieldFromFile("/proc/self/status","VmRSS:",memUsed);
if (ierr)
@@ -3328,7 +3319,7 @@ SystemInformationImplementation::GetProc
{
#if defined(_WIN32)
return GetCurrentProcessId();
-#elif defined(__linux) || defined(__APPLE__)
+#elif defined(__linux) || defined(__APPLE__) || defined(__CYGWIN__)
return getpid();
#else
return -1;
--- origsrc/cmake-2.8.10/Source/kwsys/SystemTools.cxx 2012-10-31 10:32:06.000000000 -0500
+++ src/cmake-2.8.10/Source/kwsys/SystemTools.cxx 2013-03-16 22:52:11.830415600 -0500
@@ -75,19 +75,12 @@
// Windows API.
#if defined(_WIN32)
# include <windows.h>
-#elif defined (__CYGWIN__)
-# include <windows.h>
-# undef _WIN32
#endif
#if !KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H
extern char **environ;
#endif
-#ifdef __CYGWIN__
-extern "C" void cygwin_conv_to_win32_path(const char *path, char *win32_path);
-#endif
-
// getpwnam doesn't exist on Windows and Cray Xt3/Catamount
// same for TIOCGWINSZ
#if defined(_WIN32) || defined (__LIBCATAMOUNT__)
@@ -1068,7 +1061,7 @@ bool SystemTools::SameFile(const char* f
}
//----------------------------------------------------------------------------
-#if defined(_WIN32) || defined(__CYGWIN__)
+#if defined(_WIN32)
static bool WindowsFileExists(const char* filename)
{
WIN32_FILE_ATTRIBUTE_DATA fd;
@@ -1083,7 +1076,7 @@ bool SystemTools::FileExists(const char*
{
return false;
}
-#if defined(__CYGWIN__)
+#if 0
// Convert filename to native windows path if possible.
char winpath[MAX_PATH];
if(SystemTools::PathCygwinToWin32(filename, winpath))
@@ -1111,7 +1104,7 @@ bool SystemTools::FileExists(const char*
}
//----------------------------------------------------------------------------
-#ifdef __CYGWIN__
+#if 0
bool SystemTools::PathCygwinToWin32(const char *path, char *win32_path)
{
SystemToolsTranslationMap::iterator i =
@@ -3894,7 +3887,7 @@ bool SystemTools::LocateFileInDir(const
bool SystemTools::FileIsFullPath(const char* in_name)
{
kwsys_stl::string name = in_name;
-#if defined(_WIN32) || defined(__CYGWIN__)
+#if defined(_WIN32)
// On Windows, the name must be at least two characters long.
if(name.length() < 2)
{
@@ -4712,9 +4705,6 @@ bool SystemTools::ParseURL( const kwsys_
unsigned int SystemToolsManagerCount;
SystemToolsTranslationMap *SystemTools::TranslationMap;
SystemToolsTranslationMap *SystemTools::LongPathMap;
-#ifdef __CYGWIN__
-SystemToolsTranslationMap *SystemTools::Cyg2Win32Map;
-#endif
// SystemToolsManager manages the SystemTools singleton.
// SystemToolsManager should be included in any translation unit
@@ -4760,9 +4750,6 @@ void SystemTools::ClassInitialize()
// Allocate the translation map first.
SystemTools::TranslationMap = new SystemToolsTranslationMap;
SystemTools::LongPathMap = new SystemToolsTranslationMap;
-#ifdef __CYGWIN__
- SystemTools::Cyg2Win32Map = new SystemToolsTranslationMap;
-#endif
// Add some special translation paths for unix. These are not added
// for windows because drive letters need to be maintained. Also,
@@ -4817,9 +4804,6 @@ void SystemTools::ClassFinalize()
{
delete SystemTools::TranslationMap;
delete SystemTools::LongPathMap;
-#ifdef __CYGWIN__
- delete SystemTools::Cyg2Win32Map;
-#endif
}
--- origsrc/cmake-2.8.10/Source/kwsys/SystemTools.hxx.in 2012-10-31 10:32:06.000000000 -0500
+++ src/cmake-2.8.10/Source/kwsys/SystemTools.hxx.in 2013-03-16 23:10:30.185237900 -0500
@@ -277,15 +277,6 @@ public:
static bool FileExists(const char* filename);
/**
- * Converts Cygwin path to Win32 path. Uses dictionary container for
- * caching and calls to cygwin_conv_to_win32_path from Cygwin dll
- * for actual translation. Returns true on success, else false.
- */
-#ifdef __CYGWIN__
- static bool PathCygwinToWin32(const char *path, char *win32_path);
-#endif
-
- /**
* Return file length
*/
static unsigned long FileLength(const char *filename);
@@ -887,9 +878,6 @@ private:
*/
static SystemToolsTranslationMap *TranslationMap;
static SystemToolsTranslationMap *LongPathMap;
-#ifdef __CYGWIN__
- static SystemToolsTranslationMap *Cyg2Win32Map;
-#endif
friend class SystemToolsManager;
};

View File

@@ -0,0 +1,13 @@
--- origsrc/cmake-2.8.9/Modules/FindPerlLibs.cmake 2012-08-09 13:15:19.000000000 -0500
+++ src/cmake-2.8.9/Modules/FindPerlLibs.cmake 2012-08-24 05:48:43.898426900 -0500
@@ -206,9 +206,8 @@ if (PERL_EXECUTABLE)
)
if (NOT PERL_LIBRARY_RESULT_VARIABLE)
string(REGEX REPLACE "libperl='([^']+)'.*" "\\1" PERL_POSSIBLE_LIBRARY_NAMES ${PERL_LIBRARY_OUTPUT_VARIABLE})
- else ()
- set(PERL_POSSIBLE_LIBRARY_NAMES perl${PERL_VERSION_STRING} perl)
endif ()
+ set(PERL_POSSIBLE_LIBRARY_NAMES ${PERL_POSSIBLE_LIBRARY_NAMES} perl${PERL_VERSION_STRING} perl)
### PERL_INCLUDE_PATH
find_path(PERL_INCLUDE_PATH

20
cmake/2.8.9-ruby19.patch Normal file
View File

@@ -0,0 +1,20 @@
--- origsrc/cmake-2.8.9/Modules/FindRuby.cmake 2012-08-09 13:15:19.000000000 -0500
+++ src/cmake-2.8.9/Modules/FindRuby.cmake 2012-08-23 01:36:44.554852600 -0500
@@ -88,6 +88,8 @@ IF(RUBY_EXECUTABLE AND NOT RUBY_VERSIO
_RUBY_CONFIG_VAR("libdir" RUBY_POSSIBLE_LIB_DIR)
_RUBY_CONFIG_VAR("rubylibdir" RUBY_RUBY_LIB_DIR)
+ _RUBY_CONFIG_VAR("RUBY_SO_NAME" RUBY_SO_NAME)
+
# site_ruby
_RUBY_CONFIG_VAR("sitearchdir" RUBY_SITEARCH_DIR)
_RUBY_CONFIG_VAR("sitelibdir" RUBY_SITELIB_DIR)
@@ -176,7 +178,7 @@ ENDIF( "${Ruby_FIND_VERSION_SHORT_NODOT}
# Determine the list of possible names for the ruby library
-set(_RUBY_POSSIBLE_LIB_NAMES ruby ruby-static ruby${_RUBY_VERSION_SHORT} ruby${_RUBY_VERSION_SHORT_NODOT} ruby-${_RUBY_VERSION_SHORT} ruby-${RUBY_VERSION})
+set(_RUBY_POSSIBLE_LIB_NAMES ${RUBY_SO_NAME} ${RUBY_SO_NAME}-static ruby ruby-static)
if(WIN32)
set( _RUBY_MSVC_RUNTIME "" )

76
cmake/PKGBUILD Normal file
View File

@@ -0,0 +1,76 @@
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
pkgname=cmake
pkgver=2.8.12.2
pkgrel=2
pkgdesc="A cross-platform open-source make system (mingw-w64)."
arch=('i686' 'x86_64')
url="http://www.cmake.org/"
license=("MIT")
makedepends=("gcc" "pkg-config"
libcurl-devel
libexpat-devel
libarchive-devel
ncurses-devel
zlib-devel)
depends=("gcc-libs"
"libcurl"
"libexpat"
"libarchive"
"ncurses"
"pkg-config"
"zlib")
options=('staticlibs' 'strip')
source=("http://www.cmake.org/files/v2.8/${pkgname}-${pkgver}.tar.gz"
cmake-2.8.11.2-msys.patch
"findfreetype.patch"
"disable-response-files-for-msys.patch"
2.8.11-cygwin.patch
2.8.9-perl-libs.patch
2.8.9-ruby19.patch)
md5sums=('17c6513483d23590cbce6957ec6d1e66'
'69b1bea788ef477b45137364793b87fb'
'90321de1d9d46cd8d6609d0509dbd7b0'
'9cb83b715a68f03f9db8c2eebc127f80'
'3a056694fe79d8e10f6560e86bab1558'
'3adff0ff67d05bb4576a195d017fde39'
'05a6d4218974bb28343c186996d1ad68')
prepare() {
cd ${pkgname}-${pkgver}
patch -p1 -i ${srcdir}/cmake-2.8.11.2-msys.patch
patch -p1 -i ${srcdir}/findfreetype.patch
patch -p1 -i ${srcdir}/disable-response-files-for-msys.patch
patch -p2 -i ${srcdir}/2.8.11-cygwin.patch
patch -p2 -i ${srcdir}/2.8.9-perl-libs.patch
patch -p2 -i ${srcdir}/2.8.9-ruby19.patch
}
build() {
mkdir -p "${srcdir}/build-${CARCH}"
cd "${srcdir}/build-${CARCH}"
MSYSTEM=MSYS "${srcdir}"/${pkgname}-${pkgver}/configure \
--prefix=/usr \
--system-libs \
--no-system-expat \
--no-qt-gui \
--parallel=3 \
--mandir=share \
--docdir=share/doc/cmake
plain "Start building..."
make
}
package() {
cd "${srcdir}/build-${CARCH}"
make DESTDIR=$pkgdir install
vimpath="${pkgdir}/usr/share/vim/vimfiles"
install -Dm644 ${srcdir}/${pkgname}-${pkgver}/Docs/cmake-indent.vim "${vimpath}"/indent/cmake-indent.vim
install -Dm644 ${srcdir}/${pkgname}-${pkgver}/Docs/cmake-syntax.vim "${vimpath}"/syntax/cmake-syntax.vim
install -Dm644 ${srcdir}/${pkgname}-${pkgver}/Copyright.txt \
"${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,15 @@
--- cmake-2.8.12.2/Modules/Platform/Windows-GNU.cmake.orig 2014-01-30 23:55:26.783200000 +0400
+++ cmake-2.8.12.2/Modules/Platform/Windows-GNU.cmake 2014-01-31 00:03:27.411200000 +0400
@@ -86,8 +86,10 @@
set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "")
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "")
- set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS ${__WINDOWS_GNU_LD_RESPONSE})
- set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_INCLUDES 1)
+ if(NOT CMAKE_GENERATOR STREQUAL "MSYS Makefiles")
+ set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS ${__WINDOWS_GNU_LD_RESPONSE})
+ set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_INCLUDES 1)
+ endif()
# We prefer "@" for response files but it is not supported by gcc 3.
execute_process(COMMAND ${CMAKE_${lang}_COMPILER} --version OUTPUT_VARIABLE _ver ERROR_VARIABLE _ver)

26
cmake/findfreetype.patch Normal file
View File

@@ -0,0 +1,26 @@
diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake
index 179dc00..0f5a2b4 100644
--- a/Modules/FindFreetype.cmake
+++ b/Modules/FindFreetype.cmake
@@ -62,10 +62,10 @@ find_path(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
ENV GTKMM_BASEPATH
[HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]
- PATH_SUFFIXES include/freetype2 include
+ PATH_SUFFIXES include/freetype2 include/freetype include
)
-find_path(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
+find_path(FREETYPE_INCLUDE_DIR_freetype2 config/ftheader.h
HINTS
ENV FREETYPE_DIR
PATHS
@@ -76,7 +76,7 @@ find_path(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
ENV GTKMM_BASEPATH
[HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]
- PATH_SUFFIXES include/freetype2 include
+ PATH_SUFFIXES include/freetype2 include/freetype include include/freetype2/freetype
)
find_library(FREETYPE_LIBRARY