From 4b8c8eb91d18075b7542497674119370bfdc1e91 Mon Sep 17 00:00:00 2001 From: Gabriele Facciolo Date: Thu, 28 Jul 2016 00:46:59 +0200 Subject: [PATCH 1/5] Fix for issues #3 & #4, compiling in Yosemite & ElCapitan --- lidarviewer.rb | 19 +++++++++++++++++++ vrui.rb | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/lidarviewer.rb b/lidarviewer.rb index 2839e14..87238c7 100644 --- a/lidarviewer.rb +++ b/lidarviewer.rb @@ -10,6 +10,25 @@ class Lidarviewer < Formula depends_on 'KeckCAVES/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-07-28 00:13:57.000000000 +0200 ++++ PointBasedLightingShader.cpp 2016-07-27 23:42:18.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 = [] args << "INSTALLDIR=#{prefix}" diff --git a/vrui.rb b/vrui.rb index 2893e75..56f8557 100644 --- a/vrui.rb +++ b/vrui.rb @@ -17,6 +17,25 @@ 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-07-28 00:32:04.000000000 +0200 ++++ /tmp/GLGeometryShader.cpp 2016-07-27 23:28:00.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(); +" + def install args = [] From d982b7b4e6378a3235fc209842a952f5511f556a Mon Sep 17 00:00:00 2001 From: Gabriele Facciolo Date: Sun, 2 Oct 2016 01:22:00 +0200 Subject: [PATCH 2/5] [fix] rejected patch --- lidarviewer.rb | 8 ++++---- vrui.rb | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lidarviewer.rb b/lidarviewer.rb index 87238c7..9cd5ddc 100644 --- a/lidarviewer.rb +++ b/lidarviewer.rb @@ -12,11 +12,11 @@ class Lidarviewer < Formula # 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-07-28 00:13:57.000000000 +0200 -+++ PointBasedLightingShader.cpp 2016-07-27 23:42:18.000000000 +0200 + 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); @@ -24,7 +24,7 @@ class Lidarviewer < Formula + 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= " diff --git a/vrui.rb b/vrui.rb index 56f8557..6e02980 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' @@ -19,8 +19,8 @@ class Vrui < Formula # 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-07-28 00:32:04.000000000 +0200 -+++ /tmp/GLGeometryShader.cpp 2016-07-27 23:28:00.000000000 +0200 + 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()) { @@ -28,10 +28,10 @@ class Vrui < Formula - 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); - ++ 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(); " From 9588663558354e7e2769a74e41daec586243e8e1 Mon Sep 17 00:00:00 2001 From: Gabriele Facciolo Date: Sun, 2 Oct 2016 01:32:00 +0200 Subject: [PATCH 3/5] make the forked repository functional --- lidarviewer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lidarviewer.rb b/lidarviewer.rb index 9cd5ddc..40ad57b 100644 --- a/lidarviewer.rb +++ b/lidarviewer.rb @@ -8,7 +8,7 @@ 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" From 3e0b3855ba68a622d46ceb6deda3ddab8a2293d6 Mon Sep 17 00:00:00 2001 From: gfacciol Date: Sun, 2 Oct 2016 20:14:27 +0200 Subject: [PATCH 4/5] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 From f0a89ce7a04b5b8482cb97fd2308e849f7e18f32 Mon Sep 17 00:00:00 2001 From: Gabriele Facciolo Date: Tue, 17 Oct 2017 02:50:26 +0200 Subject: [PATCH 5/5] [fix] issue with libjpeg9b --- vrui.rb | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/vrui.rb b/vrui.rb index 6e02980..f900b02 100644 --- a/vrui.rb +++ b/vrui.rb @@ -34,6 +34,66 @@ class Vrui < Formula /* 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