Skip to content

xorg.libX11: use the absolute path of libXcursor.so.1#101064

Closed
zanculmarktum wants to merge 1 commit into
NixOS:masterfrom
zanculmarktum:master
Closed

xorg.libX11: use the absolute path of libXcursor.so.1#101064
zanculmarktum wants to merge 1 commit into
NixOS:masterfrom
zanculmarktum:master

Conversation

@zanculmarktum

@zanculmarktum zanculmarktum commented Oct 19, 2020

Copy link
Copy Markdown
Contributor
Motivation for this change

#24137

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@pbogdan

pbogdan commented Oct 19, 2020

Copy link
Copy Markdown
Member

Does this actually work for you? IIRC the issue is that libXcursor itself depends on libX11 so it can't be fed as an input / dependency to the latter without forming a cycle and triggering an infinite recursion.

@zanculmarktum

Copy link
Copy Markdown
Contributor Author

Yes, although only tested through my configuration.nix using https://gitlab.com/zanc/overlays.

@pbogdan

pbogdan commented Oct 19, 2020

Copy link
Copy Markdown
Member

Hmm, I haven't looked at the overlay but as is libX11 doesn't evaluate on this branch:

$ nix-instantiate -A xorg.libX11                                                                                                                                    
error: --- EvalError ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- nix-instantiate
at: (18:19) in file: /nix/store/nvmqjsr9nh3vy7w2p6bqqmrjs17q5dfc-nix-3.0pre20200829_f156513/share/nix/corepkgs/derivation.nix

    17|       value = commonAttrs // {
    18|         outPath = builtins.getAttr outputName strict;
      |                   ^
    19|         drvPath = strict.drvPath;

infinite recursion encountered
(use '--show-trace' to show detailed location information)

(presumably due to the cycle) and ofborg seems to agree.

@zanculmarktum

Copy link
Copy Markdown
Contributor Author

Further test shows that my overlays work because I used the following:

final: prev:
{
  xorg = prev.xorg // {
    libX11 = prev.xorg.libX11.overrideAttrs (oldAttrs: {
      postPatch = (oldAttrs.postPatch or "") + ''
        substituteInPlace src/CrGlCur.c --replace "libXcursor.so.1" "${final.xorg.libXcursor}/lib/libXcursor.so.1"
      '';
    });
  };
}

instead of:

final: prev:
{
  xorg = prev.xorg.overrideScope' (self: super: {
    libX11 = super.libX11.overrideAttrs (oldAttrs: {
      postPatch = (oldAttrs.postPatch or "") + ''
        substituteInPlace src/CrGlCur.c --replace "libXcursor.so.1" "${self.libXcursor}/lib/libXcursor.so.1"
      '';
    });
  });
}

The latter gave me infinite recursion.

@Janik-Haag Janik-Haag added the 12.first-time contribution This PR is the author's first one; please be gentle! label Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

12.first-time contribution This PR is the author's first one; please be gentle!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants