Skip to content

fix: find OpenGL by correct name on Linux#9869

Merged
xq114 merged 3 commits intodevfrom
xq114-patch-1
Apr 26, 2026
Merged

fix: find OpenGL by correct name on Linux#9869
xq114 merged 3 commits intodevfrom
xq114-patch-1

Conversation

@xq114
Copy link
Copy Markdown
Contributor

@xq114 xq114 commented Apr 26, 2026

No description provided.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the opengl package configuration on Linux to search for gl instead of libgl. A review comment points out that calling find_package("opengl") within the opengl package's own fetch logic is recursive and redundant, suggesting a more direct search for the standard system names gl and GL instead.

Comment thread packages/o/opengl/xmake.lua Outdated
if opt.system then
if package:is_plat("linux") and package.find_package then
return package:find_package("opengl", opt) or package:find_package("libgl", opt)
return package:find_package("opengl", opt) or package:find_package("gl", opt)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Calling package:find_package("opengl", opt) within the on_fetch implementation of the opengl package is recursive and will likely be caught by xmake's recursion protection, returning nil. This makes the first part of the check redundant. It is better to search directly for the standard system names. On Linux, "gl" is the standard name for pkg-config (gl.pc), and "GL" is the standard name for the library file (libGL.so).

                return package:find_package("gl", opt) or package:find_package("GL", opt)

@xq114 xq114 changed the title fix: find OpenGL by libgl.so on Linux fix: find OpenGL by correct name on Linux Apr 26, 2026
@xq114
Copy link
Copy Markdown
Contributor Author

xq114 commented Apr 26, 2026

fetch-only package, tested on local Debian 13

@xq114 xq114 merged commit 6eed698 into dev Apr 26, 2026
14 of 61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant