diff --git a/README.md b/README.md index 8af6472..3678d3e 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,11 @@ This repository contains formula for KeckCAVES and KeckCAVES-related software. # Using Tap the KeckCAVES formula repository: +~~brew tap KeckCAVES/keckcaves~~ - brew tap KeckCAVES/keckcaves + brew tap gfacciol/homebrew-keckcaves Then just install the formula you want as per usual! E.g. - brew install vrui-examples + brew install vrui + brew install lidarviewer diff --git a/lidarviewer.rb b/lidarviewer.rb index 2839e14..40ad57b 100644 --- a/lidarviewer.rb +++ b/lidarviewer.rb @@ -8,7 +8,26 @@ class Lidarviewer < Formula url "https://github.com/KeckCAVES/LidarViewer.git", :revision => "v#{ver}" version "#{ver}-#{pkgver}" - depends_on 'KeckCAVES/keckcaves/vrui' + depends_on 'gfacciol/keckcaves/vrui' + + # Patch for Yosemite & ElCapitan to fix the error + # "error: cast from pointer to smaller type 'GLuint' (aka 'unsigned int') loses information" + patch :p0, "--- PointBasedLightingShader.cpp 2016-10-02 01:14:36.000000000 +0200 ++++ PointBasedLightingShader.cpp.new 2016-10-02 01:15:40.000000000 +0200 +@@ -252,9 +252,9 @@ + glCompileShaderFromString(geometryShader,geometryShaderSource); + + /* Set the geometry shader's parameters: */ +- glProgramParameteriARB(programObject,GL_GEOMETRY_VERTICES_OUT_ARB,4); +- glProgramParameteriARB(programObject,GL_GEOMETRY_INPUT_TYPE_ARB,GL_POINTS); +- glProgramParameteriARB(programObject,GL_GEOMETRY_OUTPUT_TYPE_ARB,GL_TRIANGLE_STRIP); ++ glProgramParameteriARB(reinterpret_cast(programObject),GL_GEOMETRY_VERTICES_OUT_ARB,4); ++ glProgramParameteriARB(reinterpret_cast(programObject),GL_GEOMETRY_INPUT_TYPE_ARB,GL_POINTS); ++ glProgramParameteriARB(reinterpret_cast(programObject),GL_GEOMETRY_OUTPUT_TYPE_ARB,GL_TRIANGLE_STRIP); + + /* Compile the surfel fragment shader: */ + const char* fragmentShaderSource= +" def install args = [] diff --git a/vrui.rb b/vrui.rb index 2893e75..f900b02 100644 --- a/vrui.rb +++ b/vrui.rb @@ -9,7 +9,7 @@ class Vrui < Formula version "#{ver}-#{pkgver}" depends_on :x11 => '2.7.6' - depends_on :libpng + depends_on 'libpng' depends_on 'jpeg' depends_on 'libtiff' depends_on 'libusb' @@ -17,6 +17,85 @@ class Vrui < Formula # Don't strip symbols; need them for dynamic linking. skip_clean 'bin' + # Patch for Yosemite & ElCapitan to fix the error + # "error: cast from pointer to smaller type 'GLuint' (aka 'unsigned int') loses information" + patch :p0, "--- GL/GLGeometryShader.cpp 2016-10-02 00:52:52.000000000 +0200 ++++ new/GL/GLGeometryShader.cpp 2016-10-02 00:53:32.000000000 +0200 +@@ -133,9 +133,9 @@ + if(!geometryShaderObjects.empty()) + { + /* Set the input/output parameters: */ +- glProgramParameteriEXT(GLuint(programObject),GL_GEOMETRY_INPUT_TYPE_EXT,geometryInputType); +- glProgramParameteriEXT(GLuint(programObject),GL_GEOMETRY_OUTPUT_TYPE_EXT,geometryOutputType); +- glProgramParameteriEXT(GLuint(programObject),GL_GEOMETRY_VERTICES_OUT_EXT,maxNumOutputVertices); ++ glProgramParameteriEXT(GLuint(reinterpret_cast(programObject)),GL_GEOMETRY_INPUT_TYPE_EXT,geometryInputType); ++ glProgramParameteriEXT(GLuint(reinterpret_cast(programObject)),GL_GEOMETRY_OUTPUT_TYPE_EXT,geometryOutputType); ++ glProgramParameteriEXT(GLuint(reinterpret_cast(programObject)),GL_GEOMETRY_VERTICES_OUT_EXT,maxNumOutputVertices); + + /* Check for errors: */ + GLenum err=glGetError(); +--- Images/GetImageFileSize.cpp 2017-10-17 02:39:20.000000000 +0200 ++++ new/Images/GetImageFileSize.cpp 2017-10-17 02:38:30.000000000 +0200 +@@ -173,7 +173,7 @@ + jpeg_stdio_src(&jpegDecompressStruct,jpegFile.getFilePtr()); + + /* Read the JPEG file header: */ +- jpeg_read_header(&jpegDecompressStruct,true); ++ jpeg_read_header(&jpegDecompressStruct,static_cast(true)); + + /* Prepare for decompression: */ + jpeg_start_decompress(&jpegDecompressStruct); +--- Images/ReadJPEGImage.cpp 2017-10-17 02:39:20.000000000 +0200 ++++ new/Images/ReadJPEGImage.cpp 2017-10-17 02:38:30.000000000 +0200 +@@ -80,7 +80,7 @@ + thisPtr->next_input_byte=static_cast(buffer); + + /* Return true if all data has been read: */ +- return bufferSize!=0; ++ return static_cast(bufferSize!=0); + } + static void skipInputDataFunction(j_decompress_ptr cinfo,long count) + { +@@ -147,7 +147,7 @@ + try + { + /* Read the JPEG file header: */ +- jpeg_read_header(&jpegDecompressStruct,true); ++ jpeg_read_header(&jpegDecompressStruct,static_cast(true)); + + /* Prepare for decompression: */ + jpeg_start_decompress(&jpegDecompressStruct); +--- Video/ImageExtractorMJPG.cpp 2017-10-17 02:39:20.000000000 +0200 ++++ new/Video/ImageExtractorMJPG.cpp 2017-10-17 02:38:30.000000000 +0200 +@@ -204,7 +204,7 @@ + jpegStruct->src=&mjr; + + /* Read the abbreviated image file header: */ +- jpeg_read_header(jpegStruct,true); ++ jpeg_read_header(jpegStruct,static_cast(true)); + + /* Set the decompressor's output color space to Y'CbCr: */ + jpegStruct->out_color_space=JCS_YCbCr; +@@ -257,7 +257,7 @@ + jpegStruct->src=&mjr; + + /* Read the abbreviated image file header: */ +- jpeg_read_header(jpegStruct,true); ++ jpeg_read_header(jpegStruct,static_cast(true)); + + /* Prepare the decompressor: */ + jpeg_start_decompress(jpegStruct); +@@ -283,7 +283,7 @@ + jpegStruct->src=&mjr; + + /* Read the abbreviated image file header: */ +- jpeg_read_header(jpegStruct,true); ++ jpeg_read_header(jpegStruct,static_cast(true)); + + /* Set the decompressor's output color space to Y'CbCr: */ + jpegStruct->out_color_space=JCS_YCbCr; +" + def install args = []