aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Moritz2012-06-07 21:07:25 +0200
committerJack Nagel2012-08-12 11:44:20 -0500
commit1554831ae907c062f54bea2ec37daf0895bfb917 (patch)
tree39a19ac4a4ee28030d98b6115e7bd3828a93e678
parent8bccae69c29476ca40d008a56619c6e18f479f0a (diff)
downloadhomebrew-1554831ae907c062f54bea2ec37daf0895bfb917.tar.bz2
open-scene-graph: apply patch only to stable version
Closes #12689. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
-rw-r--r--Library/Formula/open-scene-graph.rb58
1 files changed, 5 insertions, 53 deletions
diff --git a/Library/Formula/open-scene-graph.rb b/Library/Formula/open-scene-graph.rb
index d8a23155f..b762f060a 100644
--- a/Library/Formula/open-scene-graph.rb
+++ b/Library/Formula/open-scene-graph.rb
@@ -35,8 +35,11 @@ class OpenSceneGraph < Formula
# Lion replacement for CGDisplayBitsPerPixel();
# taken from: http://www.openscenegraph.org/projects/osg/changeset/12790/OpenSceneGraph/trunk/src/osgViewer/DarwinUtils.mm
# Issue at: https://github.com/mxcl/homebrew/issues/11391
- # should be obsolete with some newer versions (current version is: 3.0.1)
- def patches; DATA; end
+ # the second patch should be obsolete with some newer versions (current version is: 3.0.1, it's fixed upstream in 3.1.1)
+ def patches
+ p = [DATA]
+ p << "https://raw.github.com/gist/2890654/a07dec42b8451edf9edbf6468e5ae464c73b3b95/osg.diff" if build.stable?
+ end
def install
args = %W{
@@ -91,54 +94,3 @@ index 428cb29..6206580 100644
PATHS
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
-
-
-Index: OpenSceneGraph/trunk/src/osgViewer/DarwinUtils.mm
-===================================================================
---- a/src/osgViewer/DarwinUtils.mm (revision 12292)
-+++ b/src/osgViewer/DarwinUtils.mm (revision 12790)
-@@ -48,4 +48,23 @@
- namespace osgDarwin {
-
-+//
-+// Lion replacement for CGDisplayBitsPerPixel(CGDirectDisplayID displayId)
-+//
-+size_t displayBitsPerPixel( CGDirectDisplayID displayId )
-+{
-+
-+ CGDisplayModeRef mode = CGDisplayCopyDisplayMode(displayId);
-+ size_t depth = 0;
-+
-+ CFStringRef pixEnc = CGDisplayModeCopyPixelEncoding(mode);
-+ if(CFStringCompare(pixEnc, CFSTR(IO32BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo)
-+ depth = 32;
-+ else if(CFStringCompare(pixEnc, CFSTR(IO16BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo)
-+ depth = 16;
-+ else if(CFStringCompare(pixEnc, CFSTR(IO8BitIndexedPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo)
-+ depth = 8;
-+
-+ return depth;
-+}
-
- static inline CGRect toCGRect(NSRect nsRect)
-@@ -314,5 +333,5 @@
- resolution.width = CGDisplayPixelsWide(id);
- resolution.height = CGDisplayPixelsHigh(id);
-- resolution.colorDepth = CGDisplayBitsPerPixel(id);
-+ resolution.colorDepth = displayBitsPerPixel(id);
- resolution.refreshRate = getDictDouble (CGDisplayCurrentMode(id), kCGDisplayRefreshRate); // Not tested
- if (resolution.refreshRate<0) resolution.refreshRate = 0;
-@@ -403,5 +422,5 @@
- CGDisplayBestModeForParametersAndRefreshRate(
- displayid,
-- CGDisplayBitsPerPixel(displayid),
-+ displayBitsPerPixel(displayid),
- width, height,
- refresh,
-@@ -433,5 +452,5 @@
- CGDisplayBestModeForParametersAndRefreshRate(
- displayid,
-- CGDisplayBitsPerPixel(displayid),
-+ displayBitsPerPixel(displayid),
- width, height,
- refreshRate,