Bug 260878 - graphics/jasper: Use release archive, enable "make test" and fix FreeGLUT detection
Summary: graphics/jasper: Use release archive, enable "make test" and fix FreeGLUT det...
Status: Closed Not Accepted
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Po-Chuan Hsieh
Depends on:
Reported: 2022-01-02 11:00 UTC by Daniel Engberg
Modified: 2022-04-06 13:27 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (sunpoet)

Patch for jasper (1.64 KB, patch)
2022-01-02 11:00 UTC, Daniel Engberg
no flags Details | Diff
Patch for jasper v2 (5.85 KB, patch)
2022-01-19 13:46 UTC, Daniel Engberg
no flags Details | Diff
proposal patch for graphics/jasper (1.27 KB, patch)
2022-02-06 05:35 UTC, Tatsuki Makino
no flags Details | Diff
Fix libglut discovery (1.39 KB, patch)
2022-02-10 08:38 UTC, Peter Jeremy
no flags Details | Diff
CMakeLists.txt for test /usr/local/share/cmake/Modules/FindGLUT.cmake (980 bytes, text/plain)
2022-02-11 01:52 UTC, Tatsuki Makino
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Engberg freebsd_committer 2022-01-02 11:00:15 UTC
Created attachment 230624 [details]
Patch for jasper

Use release archive as suggested by Porters Handbook
Do some minor rearragement of port Makefile
Comment 1 Daniel Engberg freebsd_committer 2022-01-19 07:22:41 UTC
Friendly ping
Comment 2 Daniel Engberg freebsd_committer 2022-01-19 13:46:34 UTC
Created attachment 231156 [details]
Patch for jasper v2

Import patch from Fedora to fix detection of FreeGLUT when pkgconf(ig) is installed
Connect test suite to "make test"

Reported here: https://lists.freebsd.org/archives/freebsd-ports/2022-January/001288.html

Reference: https://src.fedoraproject.org/rpms/jasper/blob/rawhide/f/jasper-freeglut.patch

Compile and runtime tested on FreeBSD 13.0-STABLE #2 stable/13-n248607-93a95ebbf7c (amd64) (make, make check-plist, make test)
Poudriere testport OK 12.2-RELEASE (amd64)
Poudriere testport OK 13.0-RELEASE (i386)
Comment 3 Tatsuki Makino 2022-01-19 21:56:34 UTC
(In reply to Daniel Engberg from comment #2)

By applying this attachment 231156 [details], the build will now always succeed.
Comment 4 commit-hook freebsd_committer 2022-01-23 19:33:56 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=10212df6567f632fdf19f15fd7c040cd6b53b041

commit 10212df6567f632fdf19f15fd7c040cd6b53b041
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2022-01-23 18:26:37 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2022-01-23 19:09:47 +0000

    graphics/jasper: Use upstream release tarball

    PR:             260878
    Reported by:    diizzy

 graphics/jasper/Makefile | 5 +----
 graphics/jasper/distinfo | 6 +++---
 2 files changed, 4 insertions(+), 7 deletions(-)
Comment 5 Daniel Engberg freebsd_committer 2022-01-25 22:47:56 UTC
What about the rest of this patch?
Comment 6 Tatsuki Makino 2022-01-26 04:04:01 UTC
(In reply to commit-hook from comment #4)

This commit does not solve my problem.

FAILED: src/appl/jiv 
: && /usr/bin/cc -O2 -pipe -march=haswell  -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -Wall -pedantic -W -Wformat -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Wredundant-decls -O2 -pipe -march=haswell  -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fstack-protector-strong src/appl/CMakeFiles/jiv.dir/jiv.c.o -o src/appl/jiv  -Wl,-rpath,/var/tmp/ports/work/usr/ports/graphics/jasper/work/.build/src/libjasper:/usr/local/lib:  src/libjasper/libjasper.so.4.0.0  /usr/local/lib/libjpeg.so  /usr/local/lib/libOpenGL.so  /usr/local/lib/libGLX.so  /usr/local/lib/libGLU.so  -lm && :
ld: error: undefined symbol: glutInit
>>> referenced by jiv.c
>>>               src/appl/CMakeFiles/jiv.dir/jiv.c.o:(main)

ld: error: undefined symbol: glutInitDisplayMode
>>> referenced by jiv.c
>>>               src/appl/CMakeFiles/jiv.dir/jiv.c.o:(main)

cc: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
===> Compilation failed unexpectedly.
Comment 7 Tatsuki Makino 2022-01-26 04:10:55 UTC
(In reply to Daniel Engberg ...)

By the way, what are the patch in files/patch-build-cmake-modules-JasOpenGL.cmake used for?
Here is where it was added.
Where will JAS_OPENGL_REQUIRED be provided from?
Comment 8 Tatsuki Makino 2022-01-26 05:27:57 UTC
(In reply to Daniel Engberg from comment #5)

attachment 231156 [details] solves my problem.
But this patch is too big a change.
Perhaps the following changes will be sufficient.

file: jasper-2.0.33/build/cmake/modules/JasOpenGL.cmake
Comment 9 Tatsuki Makino 2022-02-06 05:35:23 UTC
Created attachment 231574 [details]
proposal patch for graphics/jasper

(In reply to Daniel Engberg from comment #5)

I wasn't sure about the bug that exists in Fedora, but I think this is what it means.
It should be rewritten more properly in the upstream :)
This part does not exist in 3.0, does it?
Comment 10 Peter Jeremy freebsd_committer 2022-02-10 08:38:01 UTC
Created attachment 231705 [details]
Fix libglut discovery

This is a horrible hack but it lets jasper to build for me.
Comment 11 Daniel Engberg freebsd_committer 2022-02-10 23:39:08 UTC
The inital patch did fix this issue however for whatever reason sunpoet decided to commit half of it and keep the broken part still broken. I'm not sure what the best solution would be however, I picked Fedora's because it were at least at the time adopted by others.

Tatsuki, I haven't tried to verify this issue on 3.X
Comment 12 Tatsuki Makino 2022-02-11 01:52:57 UTC
Created attachment 231736 [details]
CMakeLists.txt for test /usr/local/share/cmake/Modules/FindGLUT.cmake

How to use the attachment:
cd `mktemp -d` && cmake -DPC=0 /the-directory-where-this-attachment-exists
cd `mktemp -d` && cmake -DPC=1 /the-directory-where-this-attachment-exists

(In reply to Daniel Engberg from comment #11)
(In reply to Peter Jeremy from comment #10)

GLUT is properly detected.
So I guess sunpoet-san did not commit half of the patch.
However, different results are returned with and without pkgconf-1.8.0,1.
We can use PKG_CONFIG_FOUND to branch on whether pkgconf is available or not.
If we use the result when pkgconfig is exist, it will not touch the -L/usr/local/lib flag.
attachment 231574 [details] is a patch that makes GLUT_LIBRARIES have the same value regardless of whether pkgconf is available or not.
Comment 13 Tatsuki Makino 2022-02-11 01:58:49 UTC
(In reply to Daniel Engberg from comment #11)
> Tatsuki, I haven't tried to verify this issue on 3.X

From what little I've seen, there are no files related to this in 3.x yet :)
Comment 14 Daniel Engberg freebsd_committer 2022-02-16 15:19:22 UTC
...which is why I was a bit confused ;-) (Comment #9)

Anyhow, 3.0.2 is out so we should probably focus on that updating the port and go from there as CMake files seems to have been rewritten.
Comment 15 Daniel Engberg freebsd_committer 2022-02-17 12:46:24 UTC
I have a patch for 3.0.2 ready but since my buildbox is "not very fast" it's doing to take a few days or so to test deps.
Comment 16 Daniel Engberg freebsd_committer 2022-02-18 20:05:01 UTC
Superseded by https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262039 (help is appreciated)