aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Morgan2015-03-23 16:38:13 +0000
committerXu Cheng2015-03-29 22:01:21 +0800
commit2995ec785ab7940270a70e931c716f9f22b930a0 (patch)
tree6c43be1d50cf249fc596528430323106dc02e53d
parent22549f646a735e620eeaa3c3679d6dae30667a9f (diff)
downloadhomebrew-2995ec785ab7940270a70e931c716f9f22b930a0.tar.bz2
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 `<prefix>/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 #38005. Signed-off-by: Xu Cheng <xucheng@me.com>
-rw-r--r--Library/Homebrew/keg.rb2
-rw-r--r--Library/Homebrew/test/test_keg.rb7
2 files changed, 9 insertions, 0 deletions
diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb
index a4d43bc83..2271fd697 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 0fb419f0d..28cadf1c4 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")