Skip to content

Fix Nix build: point qmake at qttools' lrelease binary - #73

Merged
benapetr merged 1 commit into
benapetr:masterfrom
Suchiman:master
Sep 20, 2026
Merged

benapetr merged 1 commit into
benapetr:masterfrom
Suchiman:master

Conversation

@Suchiman

Copy link
Copy Markdown
Contributor

qmake's qtPrepareTool() macro hardcodes tool lookups (like lrelease) to qtbase's own store output at mkspecs-generation time. On nixpkgs, lrelease lives in kdePackages.qttools instead, which is a separate derivation, so the build failed with "No such file or directory" once CONFIG += lrelease was introduced. Pass QT_TOOL.lrelease.binary explicitly on the qmake command line to point at the real binary.

This was broken by #71

qmake's qtPrepareTool() macro hardcodes tool lookups (like lrelease)
to qtbase's own store output at mkspecs-generation time. On nixpkgs,
lrelease lives in kdePackages.qttools instead, which is a separate
derivation, so the build failed with "No such file or directory" once
CONFIG += lrelease was introduced. Pass QT_TOOL.lrelease.binary
explicitly on the qmake command line to point at the real binary.
@benapetr

Copy link
Copy Markdown
Owner

I don't know much about .nix ecosystem but this seems to create hard dependency on KDE framework, is the .nix always combined only with KDE and nothing else?

@Suchiman

Copy link
Copy Markdown
Contributor Author

this seems to create hard dependency on KDE framework

Do you mean the pkgs.kdePackages.qttools reference?
That's not new, look a few lines up from my edit, lines 28-29 already had:

nativeBuildInputs = with pkgs.kdePackages; [ qmake qttools wrapQtAppsHook ];
buildInputs = with pkgs.kdePackages; [ qtbase ];

which is shorthand for

nativeBuildInputs = [ pkgs.kdePackages.qmake pkgs.kdePackages.qttools pkgs.kdePackages.wrapQtAppsHook ];
buildInputs = [ pkgs.kdePackages.qtbase ];

So pkgs.kdePackages.qttools was already a build input.
My change only tells qmake where its lrelease actually lives.
kdePackages is just the nixpkgs attribute set, kindof like a namespace, that holds Qt 6 as well as the KDE stuff.
Nix attribute sets are lazy, so referencing one attribute pulls in exactly that derivation/package and nothing else from the set.

@benapetr

Copy link
Copy Markdown
Owner

now I get it, I am not familiar with nix at all (that entire nix file was added into repo by someone else), from that diff alone this wasn't obvious

@benapetr
benapetr merged commit 5fa9e51 into benapetr:master Sep 20, 2026
3 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.

2 participants