glut2 8.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 69bc2d2697952cb124d8779b1b2083b4b752cb0bce3e72c30e1af5fddc0a84ca
4
+ data.tar.gz: 27beae5b1ddbfa4717da7047049806e7a49af936583f0240ac848a6fa60e93a6
5
+ SHA512:
6
+ metadata.gz: 952698c9a500aeee912c8f43bcbe76f7ad5a9036dae3147950fe30c14526f9a58ea75ec1eccdf5a4903070c90c128a1eab89d1152ca44ceea07470c1f17d6eba
7
+ data.tar.gz: c03175826b977b98b9b26d0fe4ac9f290fee2f87939fa53a19f4b4d2373fb4b42d92167781b7d5c95c1ea3c59fb51c46ed96bb9d345cbb729d95fdf6b1635d59
data/.autotest ADDED
@@ -0,0 +1,29 @@
1
+ require 'autotest/restart'
2
+
3
+ Autotest.add_hook :initialize do |at|
4
+ at.add_exception /\.git/
5
+ at.add_exception /doc/
6
+ at.add_exception /examples/
7
+ at.add_exception /utils/
8
+ at.add_exception /website/
9
+
10
+ at.add_mapping(/^lib\/.*(\.bundle|so|dll)$/) do |filename, match|
11
+ possible = File.basename(filename, match[1])
12
+ at.files_matching %r%^test/test_#{possible}%
13
+ end
14
+
15
+ def at.path_to_classname s
16
+ sep = File::SEPARATOR
17
+ n = s.sub(/^test#{sep}test_(.*)\.rb/, '\1')
18
+ c = if n =~ /^(glu?)_?(.*)/ then
19
+ "#{$1.capitalize}#{$2.split(/_|(\d+)/).map { |seg| seg.capitalize }.join}"
20
+ end
21
+
22
+ "Test#{c}"
23
+ end
24
+ end
25
+
26
+ Autotest.add_hook :run_command do |at|
27
+ at.unit_diff = 'cat'
28
+ system Gem.ruby, Gem.bin_path('rake', 'rake'), 'compile'
29
+ end
data/.gemtest ADDED
File without changes
data/.gitignore ADDED
@@ -0,0 +1,6 @@
1
+ *.swp
2
+ /TAGS
3
+ /lib/glut/*.so
4
+ /lib/glut/*.bundle
5
+ /pkg
6
+ /tmp
data/.travis.yml ADDED
@@ -0,0 +1,15 @@
1
+ language: ruby
2
+ rvm:
3
+ # - "1.9.3"
4
+ - "2.0.0"
5
+ # - jruby-19mode # JRuby in 1.9 mode
6
+ # - rbx-19mode
7
+ before_install:
8
+ - gem install hoe rake-compiler;
9
+ - sudo apt-get install xpra xserver-xorg-video-dummy freeglut3-dev;
10
+ before_script:
11
+ - "xpra --xvfb=\"Xorg +extension GLX -config `pwd`/test/dummy.xorg.conf -logfile ${HOME}/.xpra/xorg.log\" start :9"
12
+ script: "env DISPLAY=:9 rake test"
13
+ after_script:
14
+ - "xpra stop :9"
15
+ - "cat ~/.xpra/*"
data/History.rdoc ADDED
@@ -0,0 +1,29 @@
1
+ === 8.4.0 / 2024-09-08
2
+
3
+ * Add as new gem with modern Ruby 3.3 compatibility
4
+
5
+ === 8.3.0 / 2017-05-30
6
+
7
+ * Add ruby-2.4 to binary windows gems and remove ruby-1.9.
8
+ * Add support for source gems on RubyInstaller-2.4 and MSYS2.
9
+
10
+ === 8.2.2 / 2016-01-21
11
+
12
+ * Add ruby-2.2 and 2.3 to binary windows gems.
13
+ * Fix compilation on OS-X. Github #2
14
+
15
+ === 8.2.1 / 2014-10-06
16
+
17
+ * Add ruby-2.1 to binary windows gems.
18
+ * Fix segmentation fault in glutKeyboardUpFunc callback
19
+
20
+ === 8.2.0 / 2014-03-14
21
+
22
+ * Add x64-mingw platform for cross build and add ruby-2.0.0 to binary gems.
23
+ * Update to freeglut-2.8.1 for cross build.
24
+ * Don't pollute the global namespace. Use GLUT namespace.
25
+ * Replace deprecated rb_thread_blocking_region() by rb_thread_call_with_gvl()
26
+
27
+ === 8.1.0 / 2013-03-03
28
+
29
+ * Moved glut into a standalone gem.
data/MIT-LICENSE ADDED
@@ -0,0 +1,18 @@
1
+
2
+ Permission is hereby granted, free of charge, to any person obtaining a
3
+ copy of this software and associated documentation files (the "Software"),
4
+ to deal in the Software without restriction, including without limitation
5
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
6
+ and/or sell copies of the Software, and to permit persons to whom the
7
+ Software is furnished to do so, subject to the following conditions:
8
+
9
+ The above copyright notice and this permission notice shall be included in
10
+ all copies or substantial portions of the Software.
11
+
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18
+ DEALINGS IN THE SOFTWARE.
data/Manifest.txt ADDED
@@ -0,0 +1,16 @@
1
+ .autotest
2
+ .gemtest
3
+ .gitignore
4
+ .travis.yml
5
+ History.rdoc
6
+ MIT-LICENSE
7
+ Manifest.txt
8
+ README.rdoc
9
+ Rakefile
10
+ ext/glut/common.h
11
+ ext/glut/extconf.rb
12
+ ext/glut/glut.c
13
+ ext/glut/glut_callbacks.c
14
+ ext/glut/glut_ext.c
15
+ lib/glut.rb
16
+ lib/glut/dummy.rb
data/README.rdoc ADDED
@@ -0,0 +1,78 @@
1
+ = glut
2
+ home :: https://github.com/vrodic/ruby-glut2
3
+
4
+ == Description
5
+
6
+ Glut bindings for OpenGL. To be used with the {opengl}[https://github.com/larskanis/opengl] gem.
7
+
8
+ == Features and Problems
9
+
10
+ * available for Windows, Linux and OS X
11
+
12
+ == Requirements
13
+
14
+ * Ruby 1.9.2+
15
+ * see {0.7}[https://github.com/archSeer/opengl/tree/0.7] for Ruby 1.8.x compatible branch
16
+ * (free-)GLUT development files installed
17
+
18
+ == Install
19
+
20
+ gem install glut
21
+
22
+ == Cross compiling for Windows
23
+
24
+ Using rake-compiler a cross compiled opengl gem can be build on a Linux or MacOS X
25
+ host for the win32 platform. The generated gem is statically linked against
26
+ libfreeglut. Freeglut is downloaded and compiled from the sources.
27
+ There are no runtime dependencies to any but the standard Windows
28
+ DLLs.
29
+
30
+ Install mingw32 or w64 using the instructions in rake-compiler's README.
31
+ For Debian/Ubuntu it is <tt>apt-get install gcc-mingw-w64</tt> .
32
+
33
+ Download and cross compile ruby 1.9 for win32 with:
34
+
35
+ rake-compiler cross-ruby VERSION=1.9.3-p0
36
+
37
+ Download and cross compile opengl for win32:
38
+
39
+ rake cross native gem
40
+
41
+ or with custom versions:
42
+
43
+ rake cross native gem RUBY_CC_VERSION=1.9.3 LIBFREEGLUT_VERSION=2.8.0
44
+
45
+ If everything works, there should be ruby-opengl-VERSION-x86-mingw32.gem in the pkg
46
+ directory.
47
+
48
+
49
+ == License
50
+
51
+ (The MIT License)
52
+
53
+ Copyright (c) Blaž Hrastnik (current maintainer)
54
+ Copyright (c) Eric Hodel (current maintainer)
55
+ Copyright (c) Alain Hoang (previous maintainer)
56
+ Copyright (c) Jan Dvorak (contributor)
57
+ Copyright (c) Minh Thu Vo (contributor)
58
+ Copyright (c) James Adam (contributor)
59
+
60
+ Permission is hereby granted, free of charge, to any person obtaining
61
+ a copy of this software and associated documentation files (the
62
+ 'Software'), to deal in the Software without restriction, including
63
+ without limitation the rights to use, copy, modify, merge, publish,
64
+ distribute, sublicense, and/or sell copies of the Software, and to
65
+ permit persons to whom the Software is furnished to do so, subject to
66
+ the following conditions:
67
+
68
+ The above copyright notice and this permission notice shall be
69
+ included in all copies or substantial portions of the Software.
70
+
71
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
72
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
73
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
74
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
75
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
76
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
77
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
78
+
data/Rakefile ADDED
@@ -0,0 +1,77 @@
1
+ # -*-ruby-*-
2
+ #
3
+ # Copyright (C) 2006 John M. Gabriele <jmg3000@gmail.com>
4
+ # Copyright (C) Eric Hodel <drbrain@segment7.net>
5
+ #
6
+ # This program is distributed under the terms of the MIT license.
7
+ # See the included MIT-LICENSE file for the terms of this license.
8
+ #
9
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
10
+ # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
12
+ # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
13
+ # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
14
+ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
15
+ # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16
+
17
+ require 'hoe'
18
+ require 'rake/extensiontask'
19
+
20
+ hoe = Hoe.spec 'glut2' do
21
+ developer 'Eric Hodel', 'drbrain@segment7.net'
22
+ developer 'Lars Kanis', 'lars@greiz-reinsdorf.de'
23
+ developer 'Blaž Hrastnik', 'speed.the.bboy@gmail.com'
24
+ developer 'Alain Hoang', ''
25
+ developer 'Jan Dvorak', ''
26
+ developer 'Minh Thu Vo', ''
27
+ developer 'James Adam', ''
28
+
29
+ self.readme_file = 'README.rdoc'
30
+ self.history_file = 'History.rdoc'
31
+ self.extra_rdoc_files = FileList['*.rdoc']
32
+
33
+ extra_dev_deps << ['rake-compiler', '~> 1.0']
34
+ extra_dev_deps << ['rake-compiler-dock', '~> 0.6.0']
35
+ extra_dev_deps << ['mini_portile2', '~> 2.1']
36
+
37
+ self.spec_extras = {
38
+ extensions: %w[ext/glut/extconf.rb],
39
+ required_ruby_version: '>= 1.9.2',
40
+ metadata: { 'msys2_mingw_dependencies' => 'freeglut' }
41
+ }
42
+ end
43
+
44
+ Rake::ExtensionTask.new 'glut', hoe.spec do |ext|
45
+ ext.lib_dir = 'lib/glut'
46
+
47
+ ext.cross_compile = true
48
+ ext.cross_platform = %w[x86-mingw32 x64-mingw32]
49
+ ext.cross_config_options += [
50
+ '--enable-win32-cross'
51
+ ]
52
+ ext.cross_compiling do |spec|
53
+ # The fat binary gem doesn't depend on the freeglut package, since it bundles the library.
54
+ spec.metadata.delete('msys2_mingw_dependencies')
55
+ end
56
+ end
57
+
58
+ # To reduce the gem file size strip mingw32 dlls before packaging
59
+ ENV['RUBY_CC_VERSION'].to_s.split(':').each do |ruby_version|
60
+ task "copy:glut:x86-mingw32:#{ruby_version}" do |t|
61
+ sh "i686-w64-mingw32-strip -S tmp/x86-mingw32/stage/lib/glut/#{ruby_version[/^\d+\.\d+/]}/glut.so"
62
+ end
63
+
64
+ task "copy:glut:x64-mingw32:#{ruby_version}" do |t|
65
+ sh "x86_64-w64-mingw32-strip -S tmp/x64-mingw32/stage/lib/glut/#{ruby_version[/^\d+\.\d+/]}/glut.so"
66
+ end
67
+ end
68
+
69
+ desc 'Build windows binary gems per rake-compiler-dock.'
70
+ task 'gem:windows' do
71
+ require 'rake_compiler_dock'
72
+ RakeCompilerDock.sh <<-EOT
73
+ rake cross native gem MAKE='nice make -j`nproc`'
74
+ EOT
75
+ end
76
+
77
+ task test: :compile
data/ext/glut/common.h ADDED
@@ -0,0 +1,68 @@
1
+ /*
2
+ * Last edit by previous maintainer:
3
+ * 2000/01/06 16:37:43, kusano
4
+ *
5
+ * Copyright (C) 1999 - 2005 Yoshi <yoshi@giganet.net>
6
+ * Copyright (C) 2006 John M. Gabriele <jmg3000@gmail.com>
7
+ * Copyright (C) 2007 James Adam <james@lazyatom.com>
8
+ * Copyright (C) 2007 Jan Dvorak <jan.dvorak@kraxnet.cz>
9
+ *
10
+ * This program is distributed under the terms of the MIT license.
11
+ * See the included MIT-LICENSE file for the terms of this license.
12
+ *
13
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
14
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
17
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
18
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ */
21
+
22
+ #ifndef _COMMON_H_
23
+ #define _COMMON_H_
24
+
25
+ #include <ruby.h>
26
+ #include "extconf.h"
27
+
28
+ #ifdef HAVE_GL_FREEGLUT_H
29
+ #include <GL/freeglut.h>
30
+ #endif
31
+
32
+ #ifdef HAVE_GL_GLUT_H
33
+ #include <GL/glut.h>
34
+ #endif
35
+
36
+ #ifdef HAVE_GLUT_GLUT_H
37
+ #include <GLUT/glut.h>
38
+ #endif
39
+
40
+ #ifndef GLUTCALLBACK
41
+ #define GLUTCALLBACK
42
+ #endif
43
+
44
+ #ifdef HAVE_WINDOWS_H
45
+ #define DLLEXPORT __declspec(dllexport)
46
+ #else
47
+ #define DLLEXPORT
48
+ #endif
49
+
50
+ /* these two macros are cast to a 32 bit type in the places they are used */
51
+ #ifndef RARRAY_LENINT
52
+ #define RARRAY_LENINT RARRAY_LEN
53
+ #endif
54
+
55
+ /* GLUT */
56
+
57
+ #define GLUT_SIMPLE_FUNCTION(_name_) \
58
+ static VALUE \
59
+ glut_##_name_(obj) \
60
+ VALUE obj; \
61
+ { \
62
+ glut##_name_(); \
63
+ return Qnil; \
64
+ }
65
+
66
+ VALUE rb_glut_check_callback(VALUE, VALUE);
67
+
68
+ #endif
@@ -0,0 +1,72 @@
1
+ require 'mkmf'
2
+
3
+ def have_framework(fw, &b)
4
+ checking_for fw do
5
+ src = cpp_include("#{fw}/#{fw}.h") << "\n" "int main(void){return 0;}"
6
+ if try_link(src, opt = "-ObjC -framework #{fw}", &b)
7
+ $defs.push(format("-DHAVE_FRAMEWORK_%s", fw.tr_cpp))
8
+ $LDFLAGS << " " << opt
9
+ true
10
+ else
11
+ false
12
+ end
13
+ end
14
+ end unless respond_to? :have_framework
15
+
16
+ if enable_config('win32-cross')
17
+ require "rubygems"
18
+ gem "mini_portile2", "~> 2.0"
19
+ require "mini_portile2"
20
+
21
+ LIBFREEGLUT_VERSION = ENV['LIBFREEGLUT_VERSION'] || '2.8.1'
22
+ LIBFREEGLUT_SOURCE_URI = "http://downloads.sourceforge.net/project/freeglut/freeglut/#{LIBFREEGLUT_VERSION}/freeglut-#{LIBFREEGLUT_VERSION}.tar.gz"
23
+
24
+ recipe = MiniPortile.new("libglut", LIBFREEGLUT_VERSION)
25
+ recipe.files = [LIBFREEGLUT_SOURCE_URI]
26
+ recipe.target = portsdir = File.expand_path('../../../ports', __FILE__)
27
+ # Prefer host_alias over host in order to use i586-mingw32msvc as
28
+ # correct compiler prefix for cross build, but use host if not set.
29
+ recipe.host = RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"]
30
+ recipe.configure_options = [
31
+ "--enable-static",
32
+ "--target=#{recipe.host}",
33
+ "--host=#{recipe.host}",
34
+ ]
35
+
36
+ checkpoint = File.join(portsdir, "#{recipe.name}-#{recipe.version}-#{recipe.host}.installed")
37
+ unless File.exist?(checkpoint)
38
+ recipe.cook
39
+ # --disable-static can not be used since it breaks the freeglut build,
40
+ # but to enforce static linking, we delete the import lib.
41
+ FileUtils.rm File.join(recipe.path, "lib", "libglut.dll.a")
42
+ FileUtils.touch checkpoint
43
+ end
44
+ recipe.activate
45
+
46
+ $defs.push "-DFREEGLUT_EXPORTS"
47
+ dir_config('freeglut', "#{recipe.path}/include", "#{recipe.path}/lib")
48
+
49
+ # libfreeglut is linked to gdi32 and winmm
50
+ have_library( 'gdi32', 'CreateDC' ) && append_library( $libs, 'gdi32' )
51
+ have_library( 'winmm', 'timeBeginPeriod' ) && append_library( $libs, 'winmm' )
52
+ end
53
+
54
+ ok =
55
+ (have_library('opengl32.lib', 'glVertex3d') && have_library('glut32.lib', 'gluSolidTeapot')) ||
56
+ (have_library('opengl32') && (have_library('glut') || have_library('freeglut'))) ||
57
+ (have_library('GL', 'glVertex3d') && have_library('glut', 'glutSolidTeapot')) ||
58
+ (have_framework('OpenGL') && have_framework('GLUT') && have_framework('Cocoa'))
59
+
60
+ ok &&=
61
+ have_header('GL/freeglut.h') ||
62
+ have_header('GL/glut.h') ||
63
+ have_header('GLUT/glut.h') # OS X
64
+
65
+ if String === ?a then
66
+ $defs.push "-DHAVE_SINGLE_BYTE_STRINGS"
67
+ end
68
+
69
+ if ok then
70
+ create_header
71
+ create_makefile 'glut/glut'
72
+ end