From 09ab7bc3b88fc52952bac71e35be6e6452eae648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Thu, 14 May 2015 14:06:15 -0600 Subject: [PATCH 1/5] CMake: update to 3.2.2 --- pkgs/cmake.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/cmake.yaml b/pkgs/cmake.yaml index 4da397372..c7cb7a72f 100644 --- a/pkgs/cmake.yaml +++ b/pkgs/cmake.yaml @@ -1,8 +1,8 @@ extends: [autotools_package] sources: -- key: tar.gz:kcrzjtzo7wnjfxkbctv6fgmurgmezzxg - url: http://www.cmake.org/files/v3.2/cmake-3.2.0-rc1.tar.gz +- key: tar.gz:vxuu43rwaodxivs7flwyqzsbkrbuit5x + url: http://www.cmake.org/files/v3.2/cmake-3.2.2.tar.gz build_stages: - name: configure From 835f05b0ac7c2717f007f0ffef1ecc2b96616888 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Thu, 14 May 2015 14:07:20 -0600 Subject: [PATCH 2/5] CMake: use our zlib, bzip2 and curl This way CMake does not build its own versions, but rather uses Hashstack versions. We also made sure the proper RPATH will be used in the `cmake` executable via the CMAKE_PREFIX_PATH option. Only three other libraries are still build as part of CMake: expat, jsoncpp, libarchive, so we commented out options that disable them for now. As a bonus, this patch also fixes a problem on OSX 10.10 where the curl component of CMake fails to build with gcc (we now use Hashstack's version that builds). --- pkgs/cmake.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pkgs/cmake.yaml b/pkgs/cmake.yaml index c7cb7a72f..f948e7899 100644 --- a/pkgs/cmake.yaml +++ b/pkgs/cmake.yaml @@ -1,12 +1,24 @@ extends: [autotools_package] +dependencies: + build: [zlib, bzip2, curl] + sources: - key: tar.gz:vxuu43rwaodxivs7flwyqzsbkrbuit5x url: http://www.cmake.org/files/v3.2/cmake-3.2.2.tar.gz build_stages: - name: configure - extra: ['--parallel=${HASHDIST_CPU_COUNT}'] + extra: ['--parallel=${HASHDIST_CPU_COUNT}', + '--system-bzip2', + '--system-curl', + #'--system-expat', + #'--system-jsoncpp', + #'--system-libarchive', + '--system-zlib', + '--', + '-DCMAKE_PREFIX_PATH=${CURL_DIR}/lib;${ZLIB_DIR}/lib;${BZIP2_DIR}/lib', + ] when_build_dependency: - set: CMAKE From 34c798afd4388f7c0dd356b06971b36a43a26fc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Thu, 14 May 2015 14:12:22 -0600 Subject: [PATCH 3/5] CMake: set OSX specific variables properly On OSX 10.10, one gets errors of the type: [cmake] CMake Error at Modules/Platform/Darwin.cmake:76 (message): [cmake] CMAKE_OSX_DEPLOYMENT_TARGET is '10.10' but CMAKE_OSX_SYSROOT: [cmake] [cmake] "" [cmake] [cmake] is not set to a MacOSX SDK with a recognized version. Either set [cmake] CMAKE_OSX_SYSROOT to a valid SDK or set CMAKE_OSX_DEPLOYMENT_TARGET to [cmake] empty. [cmake] Call Stack (most recent call first): [cmake] Modules/CMakeSystemSpecificInformation.cmake:36 (include) [cmake] CMakeLists.txt:16 (project) Unless the CMAKE_OSX_DEPLOYMENT_TARGET is set to empty. We set it to empty by unsetting the MACOSX_DEPLOYMENT_TARGET environment variable. Similar problem happens when cmake is used to build other packages. There the fix is to unset the CMAKE_OSX_DEPLOYMENT_TARGET variable on the command line. --- base/cmake_package.py | 3 +++ pkgs/cmake.yaml | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/base/cmake_package.py b/base/cmake_package.py index ad83dfbfe..853c85b95 100644 --- a/base/cmake_package.py +++ b/base/cmake_package.py @@ -34,6 +34,9 @@ def configure(ctx, stage_args): else: conf_lines.append('-DCMAKE_BUILD_TYPE:STRING=Release') + if ctx.parameters['platform'] == 'Darwin': + conf_lines.append('-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=""') + #cmake needs to be given all the dependency dirs as prefix paths #so that we search the hashdist directories before the system directories #CMake doesn't use the CPPFLAGS implicitly to find libraries diff --git a/pkgs/cmake.yaml b/pkgs/cmake.yaml index f948e7899..135252f12 100644 --- a/pkgs/cmake.yaml +++ b/pkgs/cmake.yaml @@ -8,6 +8,14 @@ sources: url: http://www.cmake.org/files/v3.2/cmake-3.2.2.tar.gz build_stages: +- when: platform == 'Darwin' + name: fix_deployment_target + after: prologue + before: configure + handler: bash + bash: | + unset MACOSX_DEPLOYMENT_TARGET + - name: configure extra: ['--parallel=${HASHDIST_CPU_COUNT}', '--system-bzip2', From aa3c2f706cb83bf5f41f5c28320559a08896d6fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Thu, 14 May 2015 17:03:29 -0600 Subject: [PATCH 4/5] CMake: fix the $ORIGIN problem ld does not seem to follow the $ORIGIN in recursive dependencies properly. The workaround is to specify the recursive dependencies (in this case openssl, libidn) explicitly, then the rpath is properly constructed and things work at link time. Also add full include paths to the dependencies. --- pkgs/cmake.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/cmake.yaml b/pkgs/cmake.yaml index 135252f12..04052e0e2 100644 --- a/pkgs/cmake.yaml +++ b/pkgs/cmake.yaml @@ -1,7 +1,7 @@ extends: [autotools_package] dependencies: - build: [zlib, bzip2, curl] + build: [zlib, bzip2, curl, openssl, libidn] sources: - key: tar.gz:vxuu43rwaodxivs7flwyqzsbkrbuit5x @@ -26,6 +26,9 @@ build_stages: '--system-zlib', '--', '-DCMAKE_PREFIX_PATH=${CURL_DIR}/lib;${ZLIB_DIR}/lib;${BZIP2_DIR}/lib', + '-DCURL_INCLUDE_DIR=${CURL_DIR}/include', + '-DZLIB_INCLUDE_DIR=${ZLIB_DIR}/include', + '-DBZIP2_INCLUDE_DIR=${BZIP2_DIR}/include', ] when_build_dependency: From 9aed1265a8886a5e514ba78813953fd2c94e16d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Thu, 14 May 2015 17:16:41 -0600 Subject: [PATCH 5/5] CMake: use our own expat library --- pkgs/cmake.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/cmake.yaml b/pkgs/cmake.yaml index 04052e0e2..01ae25dec 100644 --- a/pkgs/cmake.yaml +++ b/pkgs/cmake.yaml @@ -1,7 +1,7 @@ extends: [autotools_package] dependencies: - build: [zlib, bzip2, curl, openssl, libidn] + build: [zlib, bzip2, curl, openssl, libidn, expat] sources: - key: tar.gz:vxuu43rwaodxivs7flwyqzsbkrbuit5x @@ -20,15 +20,16 @@ build_stages: extra: ['--parallel=${HASHDIST_CPU_COUNT}', '--system-bzip2', '--system-curl', - #'--system-expat', + '--system-expat', #'--system-jsoncpp', #'--system-libarchive', '--system-zlib', '--', - '-DCMAKE_PREFIX_PATH=${CURL_DIR}/lib;${ZLIB_DIR}/lib;${BZIP2_DIR}/lib', + '-DCMAKE_PREFIX_PATH=${CURL_DIR}/lib;${ZLIB_DIR}/lib;${BZIP2_DIR}/lib;${EXPAT_DIR}/lib', '-DCURL_INCLUDE_DIR=${CURL_DIR}/include', '-DZLIB_INCLUDE_DIR=${ZLIB_DIR}/include', '-DBZIP2_INCLUDE_DIR=${BZIP2_DIR}/include', + '-DEXPAT_INCLUDE_DIR=${EXPAT_DIR}/include', ] when_build_dependency: