From 1795599d88c16c3edc4504f1019b9b7a875a64d6 Mon Sep 17 00:00:00 2001 From: Ben Morgan Date: Mon, 23 Mar 2015 16:38:13 +0000 Subject: [PATCH] keg: explicitly create cmake dir under lib Packages supporting CMake may install configuration files for use with CMake's find_package command. A recommended location for these is `/lib/cmake` which is not unique across packages. This may cause issues for Formula using this location when their Keg is linked. As with pkg-config, explicitly create the `lib/cmake` folder when linking a Keg that has installed folders/files to this location. Also add testcase. Closes Homebrew/homebrew#38005. Signed-off-by: Xu Cheng --- Library/Homebrew/keg.rb | 2 ++ Library/Homebrew/test/test_keg.rb | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb index a4d43bc835..2271fd6976 100644 --- a/Library/Homebrew/keg.rb +++ b/Library/Homebrew/keg.rb @@ -278,6 +278,8 @@ class Keg when 'charset.alias' then :skip_file # pkg-config database gets explicitly created when 'pkgconfig' then :mkpath + # cmake database gets explicitly created + when 'cmake' then :mkpath # lib/language folders also get explicitly created when 'dtrace' then :mkpath when /^gdk-pixbuf/ then :mkpath diff --git a/Library/Homebrew/test/test_keg.rb b/Library/Homebrew/test/test_keg.rb index 0fb419f0d2..28cadf1c47 100644 --- a/Library/Homebrew/test/test_keg.rb +++ b/Library/Homebrew/test/test_keg.rb @@ -207,6 +207,13 @@ class LinkTests < Homebrew::TestCase assert_predicate link.lstat, :directory? end + def test_cmake_is_mkpathed + link = HOMEBREW_PREFIX.join("lib", "cmake") + @keg.join("lib", "cmake").mkpath + @keg.link + assert_predicate link.lstat, :directory? + end + def test_symlinks_are_linked_directly link = HOMEBREW_PREFIX.join("lib", "pkgconfig")