summaryrefslogtreecommitdiffstats
path: root/patches
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-10-20 16:54:23 (EDT)
committer P. J. McDermott <pj@pehjota.net>2014-10-20 16:54:23 (EDT)
commit34f44a10842ac3cf5a3cc37d5ad62cda83d859e6 (patch)
treeebbbb53cac1fffcdfe9c974feae5b0f85a6cb724 /patches
parentdfcb6f6599646a943c4e8fdeeac3389f300f5d06 (diff)
Add patch to port CMake to ProteanOS
Diffstat (limited to 'patches')
-rw-r--r--patches/01_proteanos-port.patch66
1 files changed, 66 insertions, 0 deletions
diff --git a/patches/01_proteanos-port.patch b/patches/01_proteanos-port.patch
new file mode 100644
index 0000000..dd3cbd2
--- /dev/null
+++ b/patches/01_proteanos-port.patch
@@ -0,0 +1,66 @@
+Author: "P. J. McDermott" <pj@pehjota.net>
+Subject: ProteanOS port
+
+diff -Naur src.orig/Modules/CMakeFindPackageMode.cmake src/Modules/CMakeFindPackageMode.cmake
+--- src.orig/Modules/CMakeFindPackageMode.cmake 2010-07-23 10:27:20.000000000 -0400
++++ src/Modules/CMakeFindPackageMode.cmake 2014-10-20 16:11:25.770252311 -0400
+@@ -102,6 +102,16 @@
+ endif()
+ endforeach()
+ endif()
++ elseif(EXISTS /etc/proteanos_arch)
++ if(NOT CMAKE_${LANGUAGE}_LANGUAGE_ARCHITECTURE )
++ file(GLOB filesInLib RELATIVE /lib /lib/*-linux-* )
++ foreach(file ${filesInLib})
++ if("${file}" MATCHES "${CMAKE_LIBRARY_ARCHITECTURE_REGEX}")
++ set(CMAKE_${LANGUAGE}_LANGUAGE_ARCHITECTURE ${file})
++ break()
++ endif()
++ endforeach()
++ endif()
+ endif()
+
+ endif()
+diff -Naur src.orig/Modules/GNUInstallDirs.cmake src/Modules/GNUInstallDirs.cmake
+--- src.orig/Modules/GNUInstallDirs.cmake 2014-09-11 09:24:00.000000000 -0400
++++ src/Modules/GNUInstallDirs.cmake 2014-10-20 16:09:56.263503487 -0400
+@@ -132,7 +132,7 @@
+ endif()
+ if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
+ AND NOT CMAKE_CROSSCOMPILING)
+- if (EXISTS "/etc/debian_version") # is this a debian system ?
++ if (EXISTS "/etc/debian_version" OR EXISTS "/etc/proteanos_arch") # is this a debian system ?
+ if(CMAKE_LIBRARY_ARCHITECTURE)
+ if("${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$")
+ set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
+diff -Naur src.orig/Modules/Platform/Linux.cmake src/Modules/Platform/Linux.cmake
+--- src.orig/Modules/Platform/Linux.cmake 2014-09-11 09:24:00.000000000 -0400
++++ src/Modules/Platform/Linux.cmake 2014-10-20 16:07:12.962485916 -0400
+@@ -39,6 +39,9 @@
+ if(EXISTS "/etc/debian_version")
+ set(CMAKE_INSTALL_SO_NO_EXE 1 CACHE INTERNAL
+ "Install .so files without execute permission.")
++ elseif(EXISTS "/etc/proteanos_arch")
++ set(CMAKE_INSTALL_SO_NO_EXE 1 CACHE INTERNAL
++ "Install .so files without execute permission.")
+ else()
+ set(CMAKE_INSTALL_SO_NO_EXE 0 CACHE INTERNAL
+ "Install .so files without execute permission.")
+@@ -47,6 +50,9 @@
+
+ # Match multiarch library directory names.
+ set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-linux-gnu[a-z0-9_]*")
++if(EXISTS "/etc/proteanos_arch")
++ set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9]+-linux-[a-z0-9]+")
++endif()
+
+ include(Platform/UnixPaths)
+
+ # Debian has lib64 paths only for compatibility so they should not be
+@@ -54,4 +60,6 @@
+ # searched.
+ if(EXISTS "/etc/debian_version")
+ set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
++elseif(EXISTS "/etc/proteanos_arch")
++ set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
+ endif()