aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorGreg Karékinian2013-10-26 22:20:44 +0200
committerJack Nagel2013-10-28 19:55:02 -0500
commite2bb1be791a00e7525057fb4635de4d0bed7d28f (patch)
tree26f5d2f901e5856a8f6a42148154d2d4be79c45a /Library
parent78190af27bb0213e88d500a465f80e12a1663820 (diff)
downloadhomebrew-e2bb1be791a00e7525057fb4635de4d0bed7d28f.tar.bz2
wine: fix library path in wrapper when building without x11
This was caused by `MacOS::X11.lib` raising an exception because of the `MacOS::X11#prefix` method: the `@prefix` instance variable stays nil when neither `/opt/X11/lib/libpng.dylib` nor `/usr/X11/lib/libpng.dylib` exist. Closes #23640. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/wine.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/Library/Formula/wine.rb b/Library/Formula/wine.rb
index 4bc04c3e1..a213be9db 100644
--- a/Library/Formula/wine.rb
+++ b/Library/Formula/wine.rb
@@ -86,7 +86,7 @@ class Wine < Formula
def wine_wrapper; <<-EOS.undent
#!/bin/sh
- DYLD_FALLBACK_LIBRARY_PATH="#{MacOS::X11.lib}:#{HOMEBREW_PREFIX}/lib:/usr/lib" "#{bin}/wine.bin" "$@"
+ DYLD_FALLBACK_LIBRARY_PATH="#{library_path}" "#{bin}/wine.bin" "$@"
EOS
end
@@ -171,4 +171,13 @@ class Wine < Formula
end
return s
end
+
+ private
+
+ def library_path
+ paths = ["#{HOMEBREW_PREFIX}/lib", '/usr/lib']
+ paths.unshift(MacOS::X11.lib) unless build.without? 'x11'
+
+ paths.join(':')
+ end
end