Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issues #3 & #4, compiling in Yosemite & ElCapitan #5

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
21 changes: 20 additions & 1 deletion lidarviewer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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<uintptr_t>(programObject),GL_GEOMETRY_VERTICES_OUT_ARB,4);
+ glProgramParameteriARB(reinterpret_cast<uintptr_t>(programObject),GL_GEOMETRY_INPUT_TYPE_ARB,GL_POINTS);
+ glProgramParameteriARB(reinterpret_cast<uintptr_t>(programObject),GL_GEOMETRY_OUTPUT_TYPE_ARB,GL_TRIANGLE_STRIP);

/* Compile the surfel fragment shader: */
const char* fragmentShaderSource=
"

def install
args = []
Expand Down
81 changes: 80 additions & 1 deletion vrui.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,93 @@ 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'

# 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<uintptr_t>(programObject)),GL_GEOMETRY_INPUT_TYPE_EXT,geometryInputType);
+ glProgramParameteriEXT(GLuint(reinterpret_cast<uintptr_t>(programObject)),GL_GEOMETRY_OUTPUT_TYPE_EXT,geometryOutputType);
+ glProgramParameteriEXT(GLuint(reinterpret_cast<uintptr_t>(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<boolean>(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<JOCTET*>(buffer);

/* Return true if all data has been read: */
- return bufferSize!=0;
+ return static_cast<boolean>(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<boolean>(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<boolean>(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<boolean>(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<boolean>(true));

/* Set the decompressor's output color space to Y'CbCr: */
jpegStruct->out_color_space=JCS_YCbCr;
"

def install
args = []

Expand Down