Skip to content

Commit

Permalink
boost: Fix library and include paths in generated cmake files
Browse files Browse the repository at this point in the history
Boost generates its installed cmake configuration using custom logic
in its own build system; while this logic *knows* where it should be
installed, the generated config overrides the correct information with
new paths based on the location of the cmake configuration file in an
attempt to let the package be relocated after installation.

This patch simply undoes that.
  • Loading branch information
thequux committed Apr 14, 2020
1 parent 9d78852 commit 777df0b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
21 changes: 21 additions & 0 deletions pkgs/development/libraries/boost/cmake-paths.patch
@@ -0,0 +1,21 @@
diff --git a/tools/boost_install/boost-install.jam b/tools/boost_install/boost-install.jam
index ad19f7b55..ec6bf57ff 100644
--- a/tools/boost_install/boost-install.jam
+++ b/tools/boost_install/boost-install.jam
@@ -587,6 +587,7 @@ rule generate-cmake-config- ( target : sources * : properties * )
"# Compute the include and library directories relative to this file."
""
"get_filename_component(_BOOST_CMAKEDIR \"${CMAKE_CURRENT_LIST_DIR}/../\" ABSOLUTE)"
+ "get_filename_component(_BOOST_REAL_CMAKEDIR \"${CMAKE_CURRENT_LIST_DIR}/../\" ABSOLUTE)"
: true ;

if [ path.is-rooted $(cmakedir) ]
@@ -607,6 +608,8 @@ rule generate-cmake-config- ( target : sources * : properties * )
" unset(_BOOST_CMAKEDIR_ORIGINAL)"
"endif()"
""
+ "# Assume that the installer actually did know where the libs were to be installed"
+ "get_filename_component(_BOOST_CMAKEDIR \"$(cmakedir-native)\" REALPATH)"
: true ;
}

3 changes: 2 additions & 1 deletion pkgs/development/libraries/boost/generic.nix
Expand Up @@ -112,7 +112,8 @@ stdenv.mkDerivation {
++ optional stdenv.isDarwin (
if version == "1.55.0"
then ./darwin-1.55-no-system-python.patch
else ./darwin-no-system-python.patch);
else ./darwin-no-system-python.patch)
++ optional (versionAtLeast version "1.70") ./cmake-paths.patch;

meta = {
homepage = "http://boost.org/";
Expand Down

0 comments on commit 777df0b

Please sign in to comment.