Bug 528892 (mingw32-freeglut) - Review Request: mingw32-freeglut - Fedora MinGW alternative to the OpenGL Utility Toolkit (GLUT)
Summary: Review Request: mingw32-freeglut - Fedora MinGW alternative to the OpenGL Uti...
Keywords:
Status: CLOSED ERRATA
Alias: mingw32-freeglut
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Paulo Roma Cavalcanti
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 454410
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-10-14 08:54 UTC by Richard W.M. Jones
Modified: 2009-11-10 03:21 UTC (History)
6 users (show)

Fixed In Version: 2.6.0-0.1.rc1.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-11-10 03:21:53 UTC
Type: ---
Embargoed:
promac: fedora-review+
kevin: fedora-cvs+


Attachments (Terms of Use)

Description Richard W.M. Jones 2009-10-14 08:54:19 UTC
Spec URL: http://www.annexia.org/tmp/mingw32-freeglut.spec
SRPM URL: http://www.annexia.org/tmp/mingw32-freeglut-2.6.0-0.1.rc1.fc11.src.rpm
Description: Fedora MinGW alternative to the OpenGL Utility Toolkit (GLUT)

Comment 1 Richard W.M. Jones 2009-10-14 08:54:53 UTC
This package is rpmlint clean.

Koji scratch build:

http://koji.fedoraproject.org/koji/taskinfo?taskID=1745740

Comment 2 Richard W.M. Jones 2009-10-14 09:05:48 UTC
You can easily try this package against some of the OpenGL
examples from:

http://www.opengl.org/resources/code/samples/glut_examples/examples/examples.html

(Although not all of the examples are able to run because of
limitations in Wine etc.)

Do:

  i686-pc-mingw32-gcc glutplane.c -o glutplane -lglut -lglu32 -lopengl32
  wine ./glutplane

You may need to set up Wine paths first:

  https://fedoraproject.org/wiki/MinGW/Configure_wine

Comment 3 Paulo Roma Cavalcanti 2009-10-14 20:55:06 UTC
Hi,

I used these examples to test:

http://orion.lcg.ufrj.br/temp/TutorsMin1.0/

The corresponding Makefile defines an OS. For instance,

make OS="linux" (compiles for linux)
make OS="win32" (compiles for windows)
make OS="cross" (cross-compile)

I recreated mingw32-freglut on F10(64 bits) and F11(32 bits).
On F10, the compilation goes just fine. On F11:

[leo:~/cg/TutorsMin1.0] make
i686-pc-mingw32-gcc -o fog".exe" fog.c glm.o -lglut32 -lglu32 -lopengl32
/usr/lib/gcc/i686-pc-mingw32/4.4.0/../../../../i686-pc-mingw32/bin/ld: cannot find -lglut32
collect2: ld returned 1 exit status
make: *** [fog".exe"] Error 1

This is what I have on F10:

[cascavel:/usr/i686-pc-mingw32/sys-root/mingw/lib] d *glut*
-rw-r--r-- 1 root root 86612 2008-12-10 18:55 libglut32.a
-rw-r--r-- 1 root root 86374 2008-12-10 18:55 libglut.a
-rwxr-xr-x 1 root root 90624 2009-10-14 06:15 libglut.dll.a

On F11:

[leo:/usr/i686-pc-mingw32/sys-root/mingw/lib] d *glut*
-rwxr-xr-x 1 root root 90624 2009-10-14 08:46 libglut.dll.a

I have all mingw32 packages on both systems.

Comment 4 Paulo Roma Cavalcanti 2009-10-14 21:08:22 UTC
Copying the missing libs from F10 to F11, make it work on F11:

libglut32.a
libglut.a

[leo:~/cg/TutorsMin1.0] make
i686-pc-mingw32-gcc -c glm.c
i686-pc-mingw32-gcc -o fog".exe" fog.c glm.o -lglut32 -lglu32 -lopengl32
i686-pc-mingw32-gcc -o lightmaterial".exe" lightmaterial.c glm.o -lglut32 -lglu32 -lopengl32
i686-pc-mingw32-gcc -o lightposition".exe" lightposition.c glm.o -lglut32 -lglu32 -lopengl32
i686-pc-mingw32-gcc -o projection".exe" projection.c glm.o -lglut32 -lglu32 -lopengl32
i686-pc-mingw32-gcc -o shapes".exe" shapes.c -lglut32 -lglu32 -lopengl32
i686-pc-mingw32-gcc -o texture".exe" texture.c glm.o -lglut32 -lglu32 -lopengl32
i686-pc-mingw32-gcc -o transformation".exe" transformation.c glm.o -lglut32 -lglu32 -lopengl32
Compilation completed.


These libs should have come from 

mingw32-w32api-3.13-3.fc11.noarch

but they are not in the package.

Comment 5 Richard W.M. Jones 2009-10-15 08:37:25 UTC
(In reply to comment #3)
> I recreated mingw32-freglut on F10(64 bits) and F11(32 bits).
> On F10, the compilation goes just fine. On F11:
> 
> [leo:~/cg/TutorsMin1.0] make
> i686-pc-mingw32-gcc -o fog".exe" fog.c glm.o -lglut32 -lglu32 -lopengl32
> /usr/lib/gcc/i686-pc-mingw32/4.4.0/../../../../i686-pc-mingw32/bin/ld: cannot
> find -lglut32
> collect2: ld returned 1 exit status
> make: *** [fog".exe"] Error 1
> 
> This is what I have on F10:
> 
> [cascavel:/usr/i686-pc-mingw32/sys-root/mingw/lib] d *glut*
> -rw-r--r-- 1 root root 86612 2008-12-10 18:55 libglut32.a
> -rw-r--r-- 1 root root 86374 2008-12-10 18:55 libglut.a
> -rwxr-xr-x 1 root root 90624 2009-10-14 06:15 libglut.dll.a

When you say you "recreated" freeglut, what does that mean?

The package under review contains the following library-related
files:

/usr/i686-pc-mingw32/sys-root/mingw/bin/libglut-0.dll
/usr/i686-pc-mingw32/sys-root/mingw/lib/libglut.dll.a

> On F11:
> 
> [leo:/usr/i686-pc-mingw32/sys-root/mingw/lib] d *glut*
> -rwxr-xr-x 1 root root 90624 2009-10-14 08:46 libglut.dll.a

I'm assuming this file comes from my package?

With mingw32-freeglut installed you can compile programs
like this:

i686-pc-mingw32-gcc cube.c -o cube -lglut -lglu32 -lopengl32

You don't need to copy files from one system to another.

Also I'm only testing this on Fedora 11 and above, because
Fedora 10 is almost at end of life.

Comment 6 Paulo Roma Cavalcanti 2009-10-15 09:23:46 UTC
(In reply to comment #5)
> (In reply to comment #3)
> > I recreated mingw32-freglut on F10(64 bits) and F11(32 bits).
> > On F10, the compilation goes just fine. On F11:
> > 
> > [leo:~/cg/TutorsMin1.0] make
> > i686-pc-mingw32-gcc -o fog".exe" fog.c glm.o -lglut32 -lglu32 -lopengl32
> > /usr/lib/gcc/i686-pc-mingw32/4.4.0/../../../../i686-pc-mingw32/bin/ld: cannot
> > find -lglut32
> > collect2: ld returned 1 exit status
> > make: *** [fog".exe"] Error 1
> > 
> > This is what I have on F10:
> > 
> > [cascavel:/usr/i686-pc-mingw32/sys-root/mingw/lib] d *glut*
> > -rw-r--r-- 1 root root 86612 2008-12-10 18:55 libglut32.a
> > -rw-r--r-- 1 root root 86374 2008-12-10 18:55 libglut.a
> > -rwxr-xr-x 1 root root 90624 2009-10-14 06:15 libglut.dll.a
> 
> When you say you "recreated" freeglut, what does that mean?
> 

I mean I created the rpm:

http://orion.lcg.ufrj.br/RPMS/myrpms-f11/repoview/mingw32-freeglut.html



> The package under review contains the following library-related
> files:
> 
> /usr/i686-pc-mingw32/sys-root/mingw/bin/libglut-0.dll
> /usr/i686-pc-mingw32/sys-root/mingw/lib/libglut.dll.a
> 
> > On F11:
> > 
> > [leo:/usr/i686-pc-mingw32/sys-root/mingw/lib] d *glut*
> > -rwxr-xr-x 1 root root 90624 2009-10-14 08:46 libglut.dll.a
> 
> I'm assuming this file comes from my package?

yes:

[orion:~/RPMS11/lcgrpms] lstrpm mingw32-freeglut-2.6.0-0.1.rc1.fc11.noarch.rpm
/usr/i686-pc-mingw32/sys-root/mingw/bin/libglut-0.dll
/usr/i686-pc-mingw32/sys-root/mingw/include/GL/freeglut.h
/usr/i686-pc-mingw32/sys-root/mingw/include/GL/freeglut_ext.h
/usr/i686-pc-mingw32/sys-root/mingw/include/GL/freeglut_std.h
/usr/i686-pc-mingw32/sys-root/mingw/include/GL/glut.h
/usr/i686-pc-mingw32/sys-root/mingw/lib/libglut.dll.a
/usr/share/doc/mingw32-freeglut-2.6.0
/usr/share/doc/mingw32-freeglut-2.6.0/AUTHORS
/usr/share/doc/mingw32-freeglut-2.6.0/COPYING
/usr/share/doc/mingw32-freeglut-2.6.0/FrequentlyAskedQuestions
/usr/share/doc/mingw32-freeglut-2.6.0/NEWS
/usr/share/doc/mingw32-freeglut-2.6.0/README
/usr/share/doc/mingw32-freeglut-2.6.0/README.win32
/usr/share/doc/mingw32-freeglut-2.6.0/TODO



> 
> With mingw32-freeglut installed you can compile programs
> like this:
> 
> i686-pc-mingw32-gcc cube.c -o cube -lglut -lglu32 -lopengl32
> 
> You don't need to copy files from one system to another.
> 

What I said is that without 
  
libglut32.a and libglut.a 

on F11, which I do not have, my system does not find glut32.

I need to copy both libs from 

mingw32-w32api-3.12-8.fc10.noarch

Why are those libs missing from F11?

Comment 7 Richard W.M. Jones 2009-10-15 09:33:52 UTC
Don't worry about glut32.  That is some other library,
not related to freeglut, which was apparently removed
from w32api because of licensing problems.

To link to freeglut you use '-lglut', as described:

> i686-pc-mingw32-gcc cube.c -o cube -lglut -lglu32 -lopengl32

Comment 8 Richard W.M. Jones 2009-10-15 09:35:55 UTC
I should note that there are two upstream versions of
glut in the world.

Original GLUT:

http://www.opengl.org/resources/libraries/glut/

(This is _not_ free software).

Freeglut:

http://freeglut.sourceforge.net/

This is a GLUT-compatible reimplementation of GLUT
under a free license.

Comment 9 Paulo Roma Cavalcanti 2009-10-15 10:00:33 UTC
You are right. Using only -lglut, I can link on F11 (and F10 too).

The problem is that I have no libglut-0.dll on my windows box,
and the programs do not run on windows. Doing the other way, linking with glut32,
I could run just fine on windows.

Comment 10 Richard W.M. Jones 2009-10-15 12:28:22 UTC
(In reply to comment #9)
> You are right. Using only -lglut, I can link on F11 (and F10 too).
> 
> The problem is that I have no libglut-0.dll on my windows box,
> and the programs do not run on windows. Doing the other way, linking with
> glut32,
> I could run just fine on windows.  

What you should do is copy the freeglut DLL to your
Windows box.

AIUI freeglut is not completely compatible with non-free
GLUT, so building / linking against freeglut and then
trying to run against real GLUT could cause other problems.

Our nsiswrapper program automates generation of NSIS
installers that include all the required libraries.

Comment 11 Paulo Roma Cavalcanti 2009-10-15 12:34:25 UTC
I compiled freeglut 2.6.0 on windows (using mingw - gcc 3.4.2) and even having
a libglut-0.dll now the cross-compiled applications hang and nothing is
displayed (I even tried just copying libglut-0.dll from fedora, with the same
result).

Have you been able to run any cross-compiled opengl example in windows using
freeglut 2.6.0? 

In wine the examples run, but the opengl window is not redrawn when moved
across the screen.

Freeglut 2.6.0 is a release candidate, and seems to present some issues.

Comment 12 Stefan Riemens 2009-10-16 20:22:59 UTC
Let's go for an informal review (I'm not sponsored yet):


+ OK
! needs attention


+ rpmlint is quiet
+ Package is named according to Fedora MinGW packaging guidelines
+ Specfile name matches the package base name
+ Package follows the Fedora MinGW packaging guidelines
+ The stated license (MIT) is a Fedora approved license
+ The stated license is the same as the one for the corresponding
 Fedora package
+ The package contains the license file (COPYING)
+ Spec file is written in American English
+ Spec file is legible
+ Upstream sources match sources in the srpm
b1a8107f99b5d953e8418a5409462294  freeglut-2.6.0-rc1.tar.gz
b1a8107f99b5d953e8418a5409462294  freeglut-2.6.0-rc1.tar.gz

+ Package builds in mock (Fedora Rawhide i386)
koji scratch build: https://koji.fedoraproject.org/koji/taskinfo?taskID=1750642
n/a ExcludeArch bugs filed
+ BuildRequires look sane
n/a The spec file MUST handle locales properly
n/a binary RPM with shared library files must call ldconfig in %post and
   %postun
+ Does not use Prefix: /usr
+ Package owns all directories it creates
+ No duplicate files in %files
+ %files has %defattr
+ %clean contains rm -rf $RPM_BUILD_ROOT
+ Consistent use of macros
+ Package must contain code or permissible content
n/a Large documentation files should go in -doc subpackage
+ Files marked %doc should not affect package
n/a Header files should be in -devel
   Fedora MinGW guidelines allow headers in main package
n/a Static libraries should be in -static
n/a Packages containing pkgconfig (.pc) files need 'Requires: pkgconfig'
n/a Library files that end in .so must go in a -devel package
n/a -devel must require the fully versioned base
+ Packages should not contain libtool .la files (though mingw guidelines allow them to be present)
n/a Packages containing GUI apps must include %{name}.desktop file
+ Packages must not own files or directories owned by other packages
+ %install begins with rm -rf $RPM_BUILD_ROOT
+ Filenames must be valid UTF-8

Comment 13 Paulo Roma Cavalcanti 2009-10-17 10:53:35 UTC
I agree with Stefan's revision.

I tested freeglut a lot, and it works for me linking with glut32, and I am not sure why. Otherwise, the application does not display anything when run in windows.

But I have mingw with gcc 3.4.2 installed on my windows box with some additional packages, such as CGAL, which make it difficult for me to upgrade to a newer mingw right now (CGAL requires a lot of other packages). Maybe this cause some incompatibilities with the code generated in Fedora (gcc-4.3.2).

I also used mingw32-freeglut and a mingw32-glui, I packaged myself,
and it is also working just fine for cross-compiling opengl applications: 

http://orion.lcg.ufrj.br/RPMS/src/mingw32-glui-2.35-1.fc10.src.rpm

I tried to package freglut 2.4.0, but there were so many errors that
I gave up.

Therefore, unless Richard has anything else to say, I believe it is better to include mingw32-freeglut in Fedora the way it is, so people can cross-compile and report any issues.

Comment 14 Paulo Roma Cavalcanti 2009-10-18 12:32:24 UTC
I think I got it.

freeglut does not work when using a windows guest on a Fedora VirtualBox (3.0.8) host, when 3D acceleration is ENABLED. Disabling 3D acceleration brings everything back to normal, but depending on the application, it can become very slow. It does not matter whether the application is cross-compiled or not.

In a native windows, freeglut works as long as glut 3.7 is out of the way.

This is my review:

rpmlint produces some warnings, but according to the mingw guidelines,
all of them are acceptable:

http://fedoraproject.org/wiki/Packaging/MinGW


rpmlint mingw32-freeglut

mingw32-freeglut.noarch: E: arch-independent-package-contains-binary-or-object /usr/i686-pc-mingw32/sys-root/mingw/lib/libglut.dll.a
mingw32-freeglut.noarch: W: devel-file-in-non-devel-package /usr/i686-pc-mingw32/sys-root/mingw/include/GL/glut.h
mingw32-freeglut.noarch: W: devel-file-in-non-devel-package /usr/i686-pc-mingw32/sys-root/mingw/include/GL/freeglut_std.h
mingw32-freeglut.noarch: W: devel-file-in-non-devel-package /usr/i686-pc-mingw32/sys-root/mingw/include/GL/freeglut.h
mingw32-freeglut.noarch: W: devel-file-in-non-devel-package /usr/i686-pc-mingw32/sys-root/mingw/include/GL/freeglut_ext.h
mingw32-freeglut.noarch: W: devel-file-in-non-devel-package /usr/i686-pc-mingw32/sys-root/mingw/lib/libglut.dll.a
mingw32-freeglut.noarch: W: spurious-executable-perm /usr/i686-pc-mingw32/sys-root/mingw/lib/libglut.dll.a
mingw32-freeglut.noarch: W: non-standard-dir-in-usr i686-pc-mingw32
1 packages and 0 specfiles checked; 1 errors, 7 warnings.

--------------------------------------------------------------

1) Track Fedora native package versions
   OK: 2.4.0 in F11 and 2.6.0 in F12
     
2) Follow Fedora policy
   OK.

3) Package naming
   Packages should be named by prefixing the upstream package name with 
   mingw32-

   OK: Used mingw32-freeglut

4) Base packages
   Not applicable.

5) Filenames of the cross-compilers and binutils
   Not applicable.

6) Naming of the root filesystem
   OK.
   
7) Standard mingw RPM macros
   OK: Used the standard macros. 

8) Dependencies
   OK.

   BuildRequires:  mingw32-filesystem >= 35
   BuildRequires:  mingw32-gcc
   BuildRequires:  mingw32-binutils

9) Build architecture
   OK: noarch.

10) Libraries (DLLs)
   OK: All libraries built as DLLs. 

11) Do not use %{_mingw32_bindir}/* or %{_mingw32_libdir}/* in %files section
   Not used.

12) Manpages and info files
   None.

13) Static libraries
   None.

14) Stripping
  %global __strip %{_mingw32_strip}
  %global __objdump %{_mingw32_objdump}

  OK: both macros are present in the spec file. 


Package approved.

Comment 15 Richard W.M. Jones 2009-10-19 12:09:43 UTC
Paulo, thanks.  I have no idea about the VirtualBox problem, sorry.

Comment 16 Richard W.M. Jones 2009-10-19 12:11:09 UTC
New Package CVS Request
=======================
Package Name: mingw32-freeglut
Short Description: Fedora MinGW alternative to the OpenGL Utility Toolkit (GLUT)
Owners: rjones mingw-maint
Branches: F-12 EL-5
InitialCC:

Comment 17 Kevin Fenzi 2009-10-19 16:19:14 UTC
Did you mean mingw-maint as a CC here?

Comment 18 Richard W.M. Jones 2009-10-19 17:05:50 UTC
Kevin, we usually add mingw-maint as a role account
so that the mailing list gets CC'd on Bugzillas.  But
I can set this up manually so don't worry about it.

Thanks for doing CVS.

Comment 19 Kevin Fenzi 2009-10-19 20:47:01 UTC
I didn't process the request, because the tools won't allow me to make 'mingw-maint' a co-maintainer. ;) 

So, that should be in CC? If so, I can process it like that...

Comment 20 Richard W.M. Jones 2009-10-20 09:00:00 UTC
Oh I see.  Let's do it like this and I will
add mingw-maint to pkgdb myself later.

New Package CVS Request
=======================
Package Name: mingw32-freeglut
Short Description: Fedora MinGW alternative to the OpenGL Utility Toolkit (GLUT)
Owners: rjones
Branches: F-12 EL-5
InitialCC:

Comment 21 Kevin Fenzi 2009-10-22 04:35:32 UTC
cvs done.

Comment 22 Fedora Update System 2009-10-22 08:22:33 UTC
mingw32-freeglut-2.6.0-0.1.rc1.el5 has been submitted as an update for Fedora EPEL 5.
http://admin.fedoraproject.org/updates/mingw32-freeglut-2.6.0-0.1.rc1.el5

Comment 23 Richard W.M. Jones 2009-10-22 08:26:51 UTC
I can't create an update in F-12 for some reason:

$ make update
[...]
Creating a new update for  mingw32-freeglut-2.6.0-0.1.rc1.fc12 
mingw32-freeglut-2.6.0-0.1.rc1.fc12 not tagged as an update candidate

Comment 24 Kevin Fenzi 2009-10-22 11:39:08 UTC
Request a tag instead. ('make tag-request'). 
See: 

http://www.redhat.com/archives/fedora-devel-announce/2009-October/msg00007.html

Comment 25 Richard W.M. Jones 2009-10-22 12:31:04 UTC
Thanks - requested as #2642.

Comment 26 Fedora Update System 2009-10-23 23:21:13 UTC
mingw32-freeglut-2.6.0-0.1.rc1.el5 has been pushed to the Fedora EPEL 5 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update mingw32-freeglut'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/EL-5/FEDORA-EPEL-2009-0723

Comment 27 Fedora Update System 2009-11-10 03:21:47 UTC
mingw32-freeglut-2.6.0-0.1.rc1.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.