Compare commits

..

No commits in common. "rawhide" and "f30" have entirely different histories.

3 changed files with 40 additions and 343 deletions

View file

@ -1,27 +0,0 @@
From 914543a4f30de53cd33c2961e8791bf44d29aedf Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Wed, 4 Sep 2024 15:04:27 +0200
Subject: [PATCH] Remove requirement for accum buffers
Mesa's swrast with dril does not expose these anymore, so the tests
fail trying to find a matching config.
---
lib/opengl/test_case.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/opengl/test_case.rb b/lib/opengl/test_case.rb
index e14dac3..4acf91e 100644
--- a/lib/opengl/test_case.rb
+++ b/lib/opengl/test_case.rb
@@ -39,7 +39,7 @@ class OpenGL::TestCase < MiniTest::Unit::TestCase
glutInit
glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA | GLUT_STENCIL |
- GLUT_ACCUM | GLUT_ALPHA)
+ GLUT_ALPHA)
def setup
glutInitWindowPosition 1, 1
--
2.46.0

View file

@ -1,174 +0,0 @@
--- opengl-0.10.0/ext/opengl/gl-1.0-1.1.c.types 2024-02-23 11:59:46.379472357 +0900
+++ opengl-0.10.0/ext/opengl/gl-1.0-1.1.c 2024-02-23 12:20:08.317748271 +0900
@@ -203,8 +203,9 @@ struct gl_endisable_args {
};
static VALUE
-gl_Enable1(struct gl_endisable_args *args)
+gl_Enable1(VALUE val)
{
+ struct gl_endisable_args *args = (struct gl_endisable_args *)val;
long i;
VALUE obj = args->obj;
DECL_GL_FUNC_PTR(void,glEnable,(GLenum cap));
@@ -220,9 +221,10 @@ gl_Enable1(struct gl_endisable_args *arg
}
static VALUE
-gl_Enable0(struct gl_endisable_args *args)
+gl_Enable0(VALUE val)
{
- gl_Enable1(args);
+ struct gl_endisable_args *args = (struct gl_endisable_args *)val;
+ gl_Enable1((VALUE)args);
if (rb_block_given_p())
rb_yield(Qundef);
@@ -231,8 +233,9 @@ gl_Enable0(struct gl_endisable_args *arg
}
static VALUE
-gl_Disable1(struct gl_endisable_args *args)
+gl_Disable1(VALUE val)
{
+ struct gl_endisable_args *args = (struct gl_endisable_args *)val;
long i;
VALUE obj = args->obj;
DECL_GL_FUNC_PTR(void,glDisable,(GLenum cap));
@@ -248,9 +251,10 @@ gl_Disable1(struct gl_endisable_args *ar
}
static VALUE
-gl_Disable0(struct gl_endisable_args *args)
+gl_Disable0(VALUE val)
{
- gl_Disable1(args);
+ struct gl_endisable_args *args = (struct gl_endisable_args *)val;
+ gl_Disable1((VALUE)args);
if (rb_block_given_p())
rb_yield(Qundef);
@@ -279,7 +283,7 @@ gl_Enable(int argc, VALUE *argv, VALUE o
return rb_ensure(gl_Enable0, (VALUE)&enargs, gl_Disable1, (VALUE)&disargs);
} else {
struct gl_endisable_args args = { obj, caps };
- gl_Enable0(&args);
+ gl_Enable0((VALUE)&args);
}
return Qnil;
@@ -306,7 +310,7 @@ gl_Disable(int argc, VALUE *argv, VALUE
return rb_ensure(gl_Disable0, (VALUE)&disargs, gl_Enable1, (VALUE)&enargs);
} else {
struct gl_endisable_args args = { obj, caps };
- gl_Disable0(&args);
+ gl_Disable0((VALUE)&args);
}
return Qnil;
@@ -318,8 +322,9 @@ struct gl_client_state_args {
};
static VALUE
-gl_EnableClientState1(struct gl_client_state_args *args)
+gl_EnableClientState1(VALUE val)
{
+ struct gl_client_state_args *args = (struct gl_client_state_args *)val;
long i;
VALUE obj = args->obj;
DECL_GL_FUNC_PTR(void,glEnableClientState,(GLenum cap));
@@ -335,9 +340,10 @@ gl_EnableClientState1(struct gl_client_s
}
static VALUE
-gl_EnableClientState0(struct gl_client_state_args *args)
+gl_EnableClientState0(VALUE val)
{
- gl_EnableClientState1(args);
+ struct gl_client_state_args *args = (struct gl_client_state_args *)val;
+ gl_EnableClientState1((VALUE)args);
if (rb_block_given_p())
rb_yield(Qundef);
@@ -346,8 +352,9 @@ gl_EnableClientState0(struct gl_client_s
}
static VALUE
-gl_DisableClientState1(struct gl_client_state_args *args)
+gl_DisableClientState1(VALUE val)
{
+ struct gl_client_state_args *args = (struct gl_client_state_args *)val;
long i;
VALUE obj = args->obj;
DECL_GL_FUNC_PTR(void,glDisableClientState,(GLenum cap));
@@ -363,9 +370,10 @@ gl_DisableClientState1(struct gl_client_
}
static VALUE
-gl_DisableClientState0(struct gl_client_state_args *args)
+gl_DisableClientState0(VALUE val)
{
- gl_DisableClientState1(args);
+ struct gl_client_state_args *args = (struct gl_client_state_args *)val;
+ gl_DisableClientState1((VALUE)args);
if (rb_block_given_p())
rb_yield(Qundef);
@@ -394,7 +402,7 @@ gl_EnableClientState(int argc, VALUE *ar
return rb_ensure(gl_EnableClientState0, (VALUE)&enargs, gl_DisableClientState1, (VALUE)&disargs);
} else {
struct gl_client_state_args args = { obj, ary };
- gl_EnableClientState0(&args);
+ gl_EnableClientState0((VALUE)&args);
}
return Qnil;
@@ -421,7 +429,7 @@ gl_DisableClientState(int argc, VALUE *a
return rb_ensure(gl_DisableClientState0, (VALUE)&disargs, gl_EnableClientState1, (VALUE)&enargs);
} else {
struct gl_client_state_args args = { obj, ary };
- gl_DisableClientState0(&args);
+ gl_DisableClientState0((VALUE)&args);
}
return Qnil;
@@ -433,8 +441,9 @@ struct gl_begin0_args {
};
static VALUE
-gl_Begin0(struct gl_begin0_args *args)
+gl_Begin0(VALUE val)
{
+ struct gl_begin0_args *args = (struct gl_begin0_args *)val;
VALUE obj = args->obj;
DECL_GL_FUNC_PTR(void,glBegin,(GLenum mode));
@@ -472,7 +481,7 @@ gl_Begin(VALUE obj, VALUE mode)
if (rb_block_given_p())
return rb_ensure(gl_Begin0, (VALUE)&args, gl_End, obj);
else
- gl_Begin0(&args);
+ gl_Begin0((VALUE)&args);
return Qnil;
}
@@ -525,8 +534,9 @@ struct gl_list_args {
};
static VALUE
-gl_NewList0(struct gl_list_args *args)
+gl_NewList0(VALUE val)
{
+ struct gl_list_args *args = (struct gl_list_args *) val;
GLuint list;
GLenum mode;
VALUE obj = args->obj;
@@ -563,7 +573,7 @@ gl_NewList(VALUE obj, VALUE list, VALUE
if (rb_block_given_p())
return rb_ensure(gl_NewList0, (VALUE)&args, gl_EndList, obj);
else
- gl_NewList0(&args);
+ gl_NewList0((VALUE)&args);
return Qnil;
}

View file

@ -1,23 +1,19 @@
%global gem_name opengl
%bcond_with bootstrap
%global bootstrap 1
# MIT-LICENSE: MIT
# README.rdoc: MIT
# examples/OrangeBook/3Dlabs-License.txt (etc): BSD-3-Clause
# examples/OrangeBook/: BSD
# examples/NeHe: KILLED (license unclear)
# examples/RedBook/aapoly.rb: HPND
# examples/misc/OGLBench.rb: GPL-1.0-or-later OR Artistic-1.0-Perl
# examples/misc/plane.rb: HPND
# examples/RedBook/ SGI = MIT
# examples/misc/OGLBench.rb: GPL+ or Artistic
# examples/misc/fbo_test.rb ??? KILLED
# examples/misc/trislam.rb: GPL-1.0-or-later OR Artistic-1.0-Perl
# examples/misc/trislam.rb: GPL+ or Artistic
Name: rubygem-%{gem_name}
Version: 0.10.0
Release: 39%{?dist}
Release: 10%{?dist}
Summary: An OpenGL wrapper for Ruby
# SPDX confirmed
License: MIT
URL: https://github.com/drbrain/opengl
# Source0: https://rubygems.org/gems/%%{gem_name}-%%{version}.gem
@ -29,11 +25,6 @@ Source0: %{gem_name}-%{version}-clean.gem
Source1: create-clean-opengl-gem.sh
# http://www.gnu.org/licenses/old-licenses/gpl-1.0.txt
Source2: GPLv1.rubygem_opengl
# Fix for -Werror=incompatible-pointer-types
Patch0: opengl-0.10.0-pointer-types.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2303995#c20
# Mesa 24.2.2 swrast with dril does not expose accum buffers anymore
Patch1: 0001-Remove-requirement-for-accum-buffers.patch
# MRI (CRuby) only
BuildRequires: gcc
@ -43,13 +34,17 @@ BuildRequires: libGL-devel
BuildRequires: libGLU-devel
BuildRequires: freeglut-devel
# %%check
%if %{without bootstrap}
%if 0%{?bootstrap} < 1
BuildRequires: rubygem(minitest) >= 5
BuildRequires: %{_bindir}/xvfb-run
BuildRequires: mesa-dri-drivers
BuildRequires: rubygem(glu)
BuildRequires: rubygem(glut)
BuildRequires: rubygem(matrix)
%endif
%if 0%{?fedora} <= 21
# Install this for compatibility
Requires: rubygem(glu)
Requires: rubygem(glut)
%endif
@ -61,15 +56,23 @@ GLU and GLUT libraries.
%package doc
Summary: Documentation for %{name}
Requires: %{name} = %{version}-%{release}
License: MIT AND BSD-3-Clause AND HPND AND (GPL-1.0-or-later OR Artistic-1.0-Perl)
License: MIT and BSD and (GPL+ or Artistic)
BuildArch: noarch
%description doc
Documentation for %{name}
%prep
%setup -q -n %{gem_name}-%{version}-clean
mv ../%{gem_name}-%{version}-clean.gemspec ./%{gem_name}.gemspec
%setup -q -c -T
# Gem repack
TOPDIR=$(pwd)
mkdir tmpunpackdir
pushd tmpunpackdir
gem unpack %{SOURCE0}
cd %{gem_name}-%{version}-clean
gem specification -l --ruby %{SOURCE0} > %{gem_name}.gemspec
find examples/ -type f -print0 | xargs --null file | \
grep CRLF | sed -e 's|:.*$||' | \
@ -82,13 +85,13 @@ sed -i.minitest \
-e 's|MiniTest::Unit::TestCase|Minitest::Test|' \
lib/opengl/test_case.rb
%patch -P0 -p1 -b .types
%if 0%{?fedora} >= 41
%patch -P1 -p1 -b .accum
%endif
gem build %{gem_name}.gemspec
mv %{gem_name}-%{version}.gem $TOPDIR
popd
rm -rf tmpunpackdir
%build
gem build %{gem_name}.gemspec
%gem_install
%install
@ -126,36 +129,22 @@ popd
rm -f %{buildroot}%{gem_extdir_mri}/lib/opengl/test_case.rb
%check
%if %{with bootstrap}
exit 0
%endif
%if 0%{?bootstrap} < 1
pushd .%{gem_instdir}
EXPECTED_TEST_MSG="184 runs, 17\(38\|44\|45\) assertions, 6 failures, [12] errors, 14 skips"
cat > test/unit.rb << EOF
gem "minitest"
require "minitest/autorun"
EOF
export RUBYLIB=%{buildroot}%{gem_extdir_mri}/:$(pwd)/lib:$(pwd)
# try twice
STATUS_ON_FAILURE=true
for trial in 1 2 ; do
xvfb-run \
-s "-screen 0 640x480x24" \
ruby \
-e "Dir.glob('test/test_*.rb').each { |f| require f }" \
2>&1 | tee TEST.log
cat TEST.log | grep -q "$EXPECTED_TEST_MSG" && break || $STATUS_ON_FAILURE
%ifarch i686
%else
STATUS_ON_FAILURE=false
%endif
%ifarch s390x
%if 0%{?fedora} == 40
# Currently mesa on F41, s390x is fairly broken
STATUS_ON_FAILURE=true
%endif
%endif
done
xvfb-run \
-s "-screen 0 640x480x24" \
ruby \
-Ilib:.:./ext \
-e "Dir.glob('test/test_*.rb').each { |f| require f }" \
|| echo "please check this later"
popd
%endif
%files
%dir %{gem_instdir}
@ -175,97 +164,6 @@ popd
%doc %{gem_instdir}/utils/
%changelog
* Thu Jan 08 2026 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.10.0-39
- Rebuild for https://fedoraproject.org/wiki/Changes/Ruby_4.0
* Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-38
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Sat Jan 18 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-37
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Wed Jan 08 2025 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.10.0-36
- Rebuild for https://fedoraproject.org/wiki/Changes/Ruby_3.4
* Fri Sep 06 2024 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.10.0-35
- Adjust to mesa 24.2.2 change that swrast with dril does not expose
accum buffers anymore
- Adjust test result message with recent mesa
* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-34
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Fri Jul 12 2024 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.10.0-33
- Enable s390x test on F41 again
* Mon Jun 17 2024 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.10.0-32
- Use regex match for test result
* Thu May 09 2024 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.10.0-31
- Ignore one more test failure with recent F41 mesa
- Ignore test failure completely for now on F41 s390x mesa
* Fri Feb 23 2024 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.10.0-30
- Fix -Werror=incompatible-pointer-types hard
* Thu Feb 22 2024 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.10.0-29
- Explicitly add -Wno-error=incompatible-pointer-types only
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-28
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sat Jan 20 2024 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.10.0-27
- Change -Wincompatible-pointer-types from error to warning
* Wed Jan 03 2024 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.10.0-26
- Rebuild for https://fedoraproject.org/wiki/Changes/Ruby_3.3
* Mon Oct 9 2023 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.10.0-25
- SPDX migration
* Thu Oct 5 2023 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.10.0-24
- Switch to use recent spec file style
- Actually check the count of the test failures
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-23
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-22
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Wed Jan 04 2023 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.10.0-21
- Rebuild for https://fedoraproject.org/wiki/Changes/Ruby_3.2
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Wed Jan 26 2022 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.10.0-19
- F-36: rebuild against ruby31
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Jan 06 2021 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.10.0-15
- F-34: rebuild against ruby 3.0
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Jan 17 2020 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.10.0-12
- F-32: rebuild against ruby27
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild