Unverified Commit 41c76057 authored by Vladimír Čunát's avatar Vladimír Čunát
Browse files

Merge #245935: staging-next 2023-07-28

parents 73f18ca8 dc11c1a4
Loading
Loading
Loading
Loading
+28 −2
Original line number Diff line number Diff line
@@ -1190,11 +1190,12 @@ following are specific to `buildPythonPackage`:
  variables which will be available when the binary is run. For example,
  `makeWrapperArgs = ["--set FOO BAR" "--set BAZ QUX"]`.
* `namePrefix`: Prepends text to `${name}` parameter. In case of libraries, this
  defaults to `"python3.8-"` for Python 3.8, etc., and in case of applications
  to `""`.
  defaults to `"python3.8-"` for Python 3.8, etc., and in case of applications to `""`.
* `pipInstallFlags ? []`: A list of strings. Arguments to be passed to `pip
  install`. To pass options to `python setup.py install`, use
  `--install-option`. E.g., `pipInstallFlags=["--install-option='--cpp_implementation'"]`.
* `pipBuildFlags ? []`: A list of strings. Arguments to be passed to `pip wheel`.
* `pypaBuildFlags ? []`: A list of strings. Arguments to be passed to `python -m build --wheel`.
* `pythonPath ? []`: List of packages to be added into `$PYTHONPATH`. Packages
  in `pythonPath` are not propagated (contrary to `propagatedBuildInputs`).
* `preShellHook`: Hook to execute commands before `shellHook`.
@@ -1249,6 +1250,27 @@ with import <nixpkgs> {};
in python.withPackages(ps: [ ps.blaze ])).env
```

The next example shows a non trivial overriding of the `blas` implementation to
be used through out all of the Python package set:

```nix
python3MyBlas = pkgs.python3.override {
  packageOverrides = self: super: {
    # We need toPythonModule for the package set to evaluate this
    blas = super.toPythonModule(super.pkgs.blas.override {
      blasProvider = super.pkgs.mkl;
    });
    lapack = super.toPythonModule(super.pkgs.lapack.override {
      lapackProvider = super.pkgs.mkl;
    });
  };
};
```

This is particularly useful for numpy and scipy users who want to gain speed with other blas implementations.
Note that using simply `scipy = super.scipy.override { blas = super.pkgs.mkl; };` will likely result in
compilation issues, because scipy dependencies need to use the same blas implementation as well.

#### Optional extra dependencies {#python-optional-dependencies}

Some packages define optional dependencies for additional features. With
@@ -1468,6 +1490,10 @@ are used in `buildPythonPackage`.
- `flitBuildHook` to build a wheel using `flit`.
- `pipBuildHook` to build a wheel using `pip` and PEP 517. Note a build system
  (e.g. `setuptools` or `flit`) should still be added as `nativeBuildInput`.
- `pypaBuildHook` to build a wheel using
  [`pypa/build`](https://pypa-build.readthedocs.io/en/latest/index.html) and
  PEP 517/518. Note a build system (e.g. `setuptools` or `flit`) should still
  be added as `nativeBuildInput`.
- `pipInstallHook` to install wheels.
- `pytestCheckHook` to run tests with `pytest`. See [example usage](#using-pytestcheckhook).
- `pythonCatchConflictsHook` to check whether a Python package is not already existing.
+1 −1
Original line number Diff line number Diff line
@@ -26,10 +26,10 @@ buildPythonApplication {

  nativeBuildInputs = [
    wrapGAppsHook
    gobject-introspection
  ];

  buildInputs = [
    gobject-introspection
    gtk3
    libappindicator
    libpulseaudio
+4 −4
Original line number Diff line number Diff line
{ lib
, python3
, fetchPypi
, python3
}:

python3.pkgs.buildPythonPackage rec {
  pname = "ledfx";
  version = "2.0.67";
  version = "2.0.69";
  format = "setuptools";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-lFxAMjglQZXCySr83PtvStU6hw2ucQu+rSjIHo1yZBk=";
    hash = "sha256-gkO6XYiPMkU/zRLvc0yd3jJXVcAgAkR1W1ELTSN461o=";
  };

  postPatch = ''
@@ -52,7 +52,7 @@ python3.pkgs.buildPythonPackage rec {
  doCheck = false;

  meta = with lib; {
    description = "LedFx is a network based LED effect controller with support for advanced real-time audio effects";
    description = "Network based LED effect controller with support for advanced real-time audio effects";
    homepage = "https://github.com/LedFx/LedFx";
    changelog = "https://github.com/LedFx/LedFx/blob/${version}/CHANGELOG.rst";
    license = licenses.gpl3Only;
+2 −2
Original line number Diff line number Diff line
@@ -34,9 +34,9 @@ python3Packages.buildPythonApplication rec {

  propagatedBuildInputs = with python3Packages; [ toml pygobject3 ];

  nativeBuildInputs = [ wrapGAppsHook ];
  nativeBuildInputs = [ wrapGAppsHook gobject-introspection ];

  buildInputs = [ gtk3 gobject-introspection sox ];
  buildInputs = [ gtk3 sox ];

  dontWrapGApps = true;
  makeWrapperArgs = [
+1 −1
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ stdenv.mkDerivation rec {
    itstool
    wrapGAppsHook
    desktop-file-utils
    gobject-introspection
  ];

  buildInputs = [
@@ -72,7 +73,6 @@ stdenv.mkDerivation rec {
    brasero
    grilo

    gobject-introspection
    python3.pkgs.pygobject3

    gst_all_1.gstreamer
Loading