Commit 17746630 authored by Doron Behar's avatar Doron Behar
Browse files

linien-gui: fix build

parent d29eae89
Loading
Loading
Loading
Loading
+18 −4
Original line number Diff line number Diff line
@@ -4,15 +4,23 @@
  qt5,
}:

python3.pkgs.buildPythonApplication rec {
let
  python = python3.override {
    self = python;
    packageOverrides = self: super: {
      numpy = super.numpy_1;
    };
  };
in
python.pkgs.buildPythonApplication rec {
  pname = "linien-gui";
  pyproject = true;

  inherit (python3.pkgs.linien-common) src version;
  inherit (python.pkgs.linien-common) src version;

  sourceRoot = "${src.name}/linien-gui";

  build-system = with python3.pkgs; [
  build-system = with python.pkgs; [
    setuptools
  ];
  nativeBuildInputs = [
@@ -25,7 +33,7 @@ python3.pkgs.buildPythonApplication rec {
    qt5.qtwayland
  ];

  dependencies = with python3.pkgs; [
  dependencies = with python.pkgs; [
    appdirs
    click
    pyqtgraph
@@ -41,6 +49,12 @@ python3.pkgs.buildPythonApplication rec {
    makeWrapperArgs+=("''${qtWrapperArgs[@]}")
  '';

  passthru = {
    # Useful for creating .withPackages environments, see NOTE near
    # `python3Packages.linien-common.meta.broken`.
    inherit python;
  };

  meta = {
    description = "Graphical user interface of the Linien spectroscopy lock application";
    mainProgram = "linien";
+10 −8
Original line number Diff line number Diff line
@@ -70,19 +70,21 @@ buildPythonPackage rec {
    #
    # To evaluate this package with python3.withPackages, use:
    #
    # pythonEnv = python3.override {
    #   packageOverrides = self: super: {
    #     numpy = super.numpy_1;
    #   };
    # }.withPackages(ps: {
    # pythonEnv = pkgs.linien-gui.passthru.python.withPackages(ps: {
    #   ps.linien-common
    #   # Other packages...
    # });
    #
    # NOTE that the above Python environment will use Numpy 1 throughout all
    # packages wrapped there, and this may trigger rebuilds for dependencies
    # that depend on Numpy too. Be ready to also add more `packageOverrides` to
    # make sure these other dependencies do build with numpy_1.
    # packages wrapped there (see expression in linien-gui), and this may
    # trigger rebuilds for dependencies that depend on Numpy too. Be ready to
    # also add more `packageOverrides` to make sure these other dependencies do
    # build with numpy_1.
    #
    # Last NOTE: If you need more packageOverrides besides those provided in
    # the `linien-gui` expression, beware of:
    #
    # - https://github.com/NixOS/nixpkgs/issues/44426
    broken = lib.versionAtLeast numpy.version "2";
  };
}