doc/languages-frameworks/qt: remove outdated information
This commit is contained in:
@@ -2,14 +2,9 @@
|
|||||||
|
|
||||||
Writing Nix expressions for Qt libraries and applications is largely similar as for other C++ software.
|
Writing Nix expressions for Qt libraries and applications is largely similar as for other C++ software.
|
||||||
This section assumes some knowledge of the latter.
|
This section assumes some knowledge of the latter.
|
||||||
There are two problems that the Nixpkgs Qt infrastructure addresses,
|
|
||||||
which are not shared by other C++ software:
|
|
||||||
|
|
||||||
1. There are usually multiple supported versions of Qt in Nixpkgs.
|
However, Qt makes extensive use of runtime dependency detection.
|
||||||
All of a package's dependencies must be built with the same version of Qt.
|
In nixpkgs, those runtime dependencies are made into build dependencies through wrappers.
|
||||||
This is similar to the version constraints imposed on interpreted languages like Python.
|
|
||||||
2. Qt makes extensive use of runtime dependency detection.
|
|
||||||
Runtime dependencies are made into build dependencies through wrappers.
|
|
||||||
|
|
||||||
## Nix expression for a Qt package (default.nix) {#qt-default-nix}
|
## Nix expression for a Qt package (default.nix) {#qt-default-nix}
|
||||||
|
|
||||||
@@ -95,66 +90,3 @@ stdenv.mkDerivation {
|
|||||||
This means that scripts won't be automatically wrapped so you'll need to manually wrap them as previously mentioned.
|
This means that scripts won't be automatically wrapped so you'll need to manually wrap them as previously mentioned.
|
||||||
An example of when you'd always need to do this is with Python applications that use PyQt.
|
An example of when you'd always need to do this is with Python applications that use PyQt.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
## Adding a library to Nixpkgs {#adding-a-library-to-nixpkgs}
|
|
||||||
|
|
||||||
Add Qt libraries to `qt5-packages.nix` to make them available for every
|
|
||||||
supported Qt version.
|
|
||||||
|
|
||||||
### Example adding a Qt library {#qt-library-all-packages-nix}
|
|
||||||
|
|
||||||
The following represents the contents of `qt5-packages.nix`.
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{
|
|
||||||
# ...
|
|
||||||
|
|
||||||
mylib = callPackage ../path/to/mylib {};
|
|
||||||
|
|
||||||
# ...
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Libraries are built with every available version of Qt.
|
|
||||||
Use the `meta.broken` attribute to disable the package for unsupported Qt versions:
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{ stdenv, lib, qtbase }:
|
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
# ...
|
|
||||||
# Disable this library with Qt < 5.9.0
|
|
||||||
meta.broken = lib.versionOlder qtbase.version "5.9.0";
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Adding an application to Nixpkgs {#adding-an-application-to-nixpkgs}
|
|
||||||
|
|
||||||
Add Qt applications to `qt5-packages.nix`. Add an alias to `all-packages.nix`
|
|
||||||
to select the Qt 5 version used for the application.
|
|
||||||
|
|
||||||
### Example adding a Qt application {#qt-application-all-packages-nix}
|
|
||||||
|
|
||||||
The following represents the contents of `qt5-packages.nix`.
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{
|
|
||||||
# ...
|
|
||||||
|
|
||||||
myapp = callPackage ../path/to/myapp {};
|
|
||||||
|
|
||||||
# ...
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
The following represents the contents of `all-packages.nix`.
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{
|
|
||||||
# ...
|
|
||||||
|
|
||||||
myapp = libsForQt5.myapp;
|
|
||||||
|
|
||||||
# ...
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|||||||
Reference in New Issue
Block a user