Open IllustratedMan-code opened 2 years ago
To be clear, on Linux distros using the standard /usr/include
path as default include path, the upstream X11 pkgconfig file is sufficient (example from Mageia):
$ cat /usr/include/X11/extensions/XInput2.h | grep Xfixes
#include <X11/extensions/Xfixes.h> /* PointerBarrier */
$ ls /usr/include/X11/extensions/Xfixes.h
/usr/include/X11/extensions/Xfixes.h
$ cat /usr/lib64/pkgconfig/xi.pc
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib64
includedir=/usr/include
Name: Xi
Description: X Input Extension Library
Version: 1.8
Requires: inputproto
Requires.private: x11 xext xfixes
Cflags: -I${includedir}
Libs: -L${libdir} -lXi
A project using Xinput2 like Godot does, and parsing pkg-config --cflags --libs xi
, will properly get -I/usr/include
added which resolves <X11/extensions/Xfixes.h>
fine.
And Mageia's package that provides Xinput2 does properly depend on Xfixes:
$ urpmq --requires lib64xi-devel
devel(libX11(64bit))
devel(libXext(64bit))
lib64xi6[== 1.8-2.mga9]
pkgconfig
pkgconfig(inputproto)
pkgconfig(x11)
pkgconfig(xext)
pkgconfig(xfixes)
So likewise, Nix's libXi should require libXfixes, and its pkgconfig file should be amended to point to the include path prefix for libXfixes so that the cross-dependency can be resolved.
I haven't checked the Nix libXi packaging, but for the record, it should likely also depend on libXext:
$ cat /usr/include/X11/extensions/XInput2.h | grep include.*extensions
#include <X11/extensions/XI2.h>
#include <X11/extensions/Xge.h>
#include <X11/extensions/Xfixes.h> /* PointerBarrier */
(Xge.h
is from libXext)
It wasn't spotted as an issue for Nix users on Godot because we do use and thus have a dependency on libXext explicitly for other parts of the codebase.
There might be more similar intricate cross-dependencies among X11 extensions which would be worth reviewing. Otherwise X11 projects would basically need to overlink all X11 extensions to be safe, which defeats the purpose of these extensions being packaged separately.
We already propagate libXfixes and libXext in libXi
xorg/overrides.nix
propagatedBuildInputs = attrs.propagatedBuildInputs or [] ++ [ xorg.libXfixes xorg.libXext ];
Describe the bug
I have been trying to build the godot game engine using a flake. I was able to get a successful build working, but I had fork the project and add a
env.ParseConfig("pkg-config xfixes --cflags")
to their detect.py script (using the scons build system). This is strange, because there is already a pkg-config line for xi in their scriptenv.ParseConfig("pkg-config xi --cflags --libs")
. xi should also include the flags for xfixes.More information can be found in this issue on the godot repository: https://github.com/godotengine/godot/issues/59913
Steps To Reproduce
Steps to reproduce the behavior:
nix build
Expected behavior
I expected the
pkg-config xi
line to function normally by also including the flags for xfixes.Notify maintainers
@TredwellGit @vcunat
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.