forked from KeckCAVES/homebrew-keckcaves
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathvrui.rb
125 lines (104 loc) · 4.55 KB
/
vrui.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
require 'formula'
class Vrui < Formula
ver = "3.1-002"
pkgver = "1"
homepage 'http://keckcaves.org/software/vrui'
url "https://github.com/KeckCAVES/Vrui.git", :revision => "v#{ver}"
version "#{ver}-#{pkgver}"
depends_on :x11 => '2.7.6'
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 = []
args << "INSTALLDIR=#{prefix}"
args << "DOCINSTALLDIR=#{doc}"
args << "ETCINSTALLDIR=#{etc}/#{name}"
args << "EXECUTABLEINSTALLDIR=#{bin}"
args << "HEADERINSTALLDIR=#{include}/#{name}"
args << "LIBINSTALLDIR=#{lib}/#{name}"
args << "PKGCONFIGINSTALLDIR=#{lib}/pkgconfig"
args << "PLUGININSTALLDIR=#{lib}/#{name}"
args << "SHAREINSTALLDIR=#{share}/#{name}"
args << "JPEG_BASEDIR=#{HOMEBREW_PREFIX}"
args << "TIFF_BASEDIR=#{HOMEBREW_PREFIX}"
args << "LIBUSB1_BASEDIR=#{HOMEBREW_PREFIX}"
args << "PNG_BASEDIR=#{(MacOS.version >= :mountain_lion) ? HOMEBREW_PREFIX : MacOS::X11.prefix}"
args << "X11_BASEDIR=#{MacOS::X11.prefix}"
args << "GL_BASEDIR=#{MacOS::X11.prefix}"
args << "GLU_BASEDIR=#{MacOS::X11.prefix}"
args << "SHOWCOMMAND=1"
system "make", *args
system "make", *(args+["install"])
end
end