Unverified Commit 86bc8060 authored by Fabian Affolter's avatar Fabian Affolter Committed by GitHub
Browse files

Merge pull request #259962 from panicgh/nitrokey-app2

nitrokey-app2: switch to pypaBuildHook and fix the build
parents 293ce593 48e6a7c7
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -8,7 +8,9 @@
python3.pkgs.buildPythonApplication rec {
  pname = "nitrokey-app2";
  version = "2.1.2";
  format = "flit";
  pyproject = true;

  disabled = python3.pythonOlder "3.9";

  src = fetchFromGitHub {
    owner = "Nitrokey";
@@ -17,11 +19,22 @@ python3.pkgs.buildPythonApplication rec {
    hash = "sha256-VyhIFNXxH/FohgjhBeZXoQYppP7PEz+ei0qzsWz1xhk=";
  };

  # https://github.com/Nitrokey/nitrokey-app2/issues/152
  #
  # pythonRelaxDepsHook does not work here, because it runs in postBuild and
  # only modifies the dependencies in the built distribution.
  postPatch = ''
    substituteInPlace pyproject.toml --replace "pynitrokey ==" "pynitrokey >="
  '';

  # The pyproject.toml file seems to be incomplete and does not generate
  # resources (i.e. run pyrcc5 and pyuic5) but the Makefile does.
  preBuild = ''
    make build-ui
  '';

  nativeBuildInputs = with python3.pkgs; [
    flit-core
    pyqt5
    wrapQtAppsHook
  ];
@@ -41,9 +54,14 @@ python3.pkgs.buildPythonApplication rec {
      --set-default CRYPTOGRAPHY_OPENSSL_NO_LEGACY 1
  '';

  pythonImportsCheck = [
    "nitrokeyapp"
  ];

  meta = with lib; {
    description = "This application allows to manage Nitrokey 3 devices";
    homepage = "https://github.com/Nitrokey/nitrokey-app2";
    changelog = "https://github.com/Nitrokey/nitrokey-app2/releases/tag/v${version}";
    license = licenses.asl20;
    maintainers = with maintainers; [ _999eagle ];
    mainProgram = "nitrokeyapp";