From df2b0589ae1edf6806db6e470a08d0c87eed0979 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sun, 10 Jan 2021 15:43:31 +0100 Subject: Qt docs: we now use qt5-packages.nix --- doc/languages-frameworks/qt.section.md | 35 ++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/doc/languages-frameworks/qt.section.md b/doc/languages-frameworks/qt.section.md index 4a37eb4ef7d..6cfdc663550 100644 --- a/doc/languages-frameworks/qt.section.md +++ b/doc/languages-frameworks/qt.section.md @@ -92,32 +92,43 @@ mkDerivation { } ``` ## Adding a library to Nixpkgs - Add a Qt library to all-packages.nix by adding it to the collection inside `mkLibsForQt5`. This ensures that the library is built with every available version of Qt as needed. - -### Example Adding a Qt library to all-packages.nix {#qt-library-all-packages-nix} +Qt libraries are added to `qt5-packages.nix` and are made available for every Qt +version supported. +### Example adding a Qt library {#qt-library-all-packages-nix} +The following represents the contents of `qt5-packages.nix`. ``` { # ... - mkLibsForQt5 = self: with self; { - # ... - - mylib = callPackage ../path/to/mylib {}; - }; + mylib = callPackage ../path/to/mylib {}; # ... } ``` ## Adding an application to Nixpkgs -Add a Qt application to *all-packages.nix* using `libsForQt5.callPackage` instead of the usual `callPackage`. The former ensures that all dependencies are built with the same version of Qt. +Applications that use Qt are also added to `qt5-packages.nix`. An alias is added +in the top-level `all-packages.nix` pointing to the package with the desired Qt5 version. -### Example Adding a QT application to all-packages.nix {#qt-application-all-packages-nix} -```nix +### Example adding a Qt application {#qt-application-all-packages-nix} + +The following represents the contents of `qt5-packages.nix`. +``` +{ + # ... + + myapp = callPackage ../path/to/myapp {}; + + # ... +} +``` + +The following represents the contents of `all-packages.nix`. +``` { # ... - myapp = libsForQt5.callPackage ../path/to/myapp/ {}; + myapp = libsForQt5.myapp; # ... } -- cgit 1.4.1