Reading PDF files using mupdf-gl emits the following: warning: This version of MuPDF has been built WITHOUT clipboard or unicode input support! warning: Please file a complaint with your friendly local distribution manager. One cannot copy text from mupdf-gl. It does not happen with mupdf (which uses x11 not opengl) and primary selection works. It seems that no option in ports can enable clipboard for the -gl variant of mupdf. Any idea why clipboard support is not enabled? Thanks.
I think I found the reason. The mupdf's source contains a file, platform/gl/gl-ui.c, and in line 402 can found this message (https://git.ghostscript.com/?p=mupdf.git;a=blob;f=platform/gl/gl-ui.c;h=838ce61ade8acfc550e1d8409cf93f7bba0e9b63;hb=HEAD#l399). The line 399 contains a condition: GLUT_API_VERSION >= 6. The FreeBSD ports has graphics/freeglut 3.0.0, and in the /usr/local/include/GL/freeglut_std.h the GLUT_API_VERSION is: #define GLUT_API_VERSION 4 I think the freeglut should upgrade because there is version 3.2.1 since September 2019 (http://freeglut.sourceforge.net/index.php#download). I try update it. Thanks for report!
I send a request to update graphics/freeglut: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254454 Could you test this patch please? The mupdf build with newest freeglut without any other patches.
I'm afraid this won't be enough as upstream freeglut doesn't contain the relevant mupdf-specific changes. The full story is told in https://github.com/NixOS/nixpkgs/issues/104017 I've been using the attached patch (but never tested it in poudriere).
Created attachment 223520 [details] 0001-Use-bundled-freeglut-lib-for-mupdf.patch Use bundled freeglut for mupdf
I see. I didn't was enough open-eyed, sorry. The Porter's Handbook suggests avoid bundled libraries: https://docs.freebsd.org/en/books/porters-handbook/book.html#bundled-libs If anybody takes this report I hope (s)he can show any solution.
(In reply to wjenkner from comment #3) Thanks for the insight. I guess rebasing the patches from mupdf to graphics/freeglut 3.2.1 is one possible solution.
(In reply to yzrh from comment #6) I think it would be maybe the best solution. But the better would be the official freeglut use these patches :)
Created attachment 223548 [details] mupdf freeglut patch Extracted from mupdf repo. It is based on freeglut 3.0.0. Considered the size, it will take some time to review. For this specific case, bundled library may be better. The patch can potentially break other programmes.
(In reply to yzrh from comment #8) I think it should be a report on graphics/freeglut.