diff options
author | Frederik Rietdijk <fridh@fridh.nl> | 2021-01-10 15:43:31 +0100 |
---|---|---|
committer | Frederik Rietdijk <fridh@fridh.nl> | 2021-01-10 15:59:45 +0100 |
commit | df2b0589ae1edf6806db6e470a08d0c87eed0979 (patch) | |
tree | bc7f889c558f43bd8db3d95918812d32fd1e6f44 /doc | |
parent | 8646eeebf5af125cf29c7289235da70a31a83603 (diff) |
Qt docs: we now use qt5-packages.nix
Diffstat (limited to 'doc')
-rw-r--r-- | doc/languages-frameworks/qt.section.md | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/doc/languages-frameworks/qt.section.md b/doc/languages-frameworks/qt.section.md index 4a37eb4ef7db..6cfdc6635506 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; # ... } |