Qt: Difference between revisions

imported>Makefu
No edit summary
imported>Bryanhonof
No edit summary
Line 26: Line 26:


Happy qt coding :)
Happy qt coding :)
== Packaging ==
[https://nixos.org/manual/nixpkgs/stable/#sec-language-qt See] for the entry in the nixpkgs manual.
Qt applications can't be called with <code>callPackage</code>, since they expect more inputs. Namely <code>qtbase</code> and <code>wrapQtAppsHook</code>. Instead they should be called with <code>libsForQt5.callPackage</code>.
{{File|./build/default.nix|nix|<nowiki>
{ stdenv, lib, qtbase, wrapQtAppsHook }:
stdenv.mkDerivation {
  pname = "myapp";
  version = "1.0";
  buildInputs = [ qtbase ];
  nativeBuildInputs = [ wrapQtAppsHook ];
}
</nowiki>}}
<syntaxHighlight lang=nix>
#nix-repl
myapp = callPackage ./build/myapp/default.nix { } # Will complain it wasn't called with qtbase, etc.
myapp = libsForQt5.callPackage ./build/myapp/default.nix { } # Should work
</syntaxHighlight>


== Troubleshooting ==
== Troubleshooting ==