Unverified Commit 03de9fe8 authored by Yueh-Shun Li's avatar Yueh-Shun Li Committed by GitHub
Browse files

plover: fix crashes, move to `python3Packages`, and expose under pkgs/by-name (#512484)

parents b9379789 e2acb506
Loading
Loading
Loading
Loading
+0 −63
Original line number Diff line number Diff line
{
  lib,
  config,
  fetchFromGitHub,
  python3Packages,
  wmctrl,
  qtbase,
  mkDerivationWith,
}:

{
  dev =
    with python3Packages;
    mkDerivationWith buildPythonPackage rec {
      pname = "plover";
      version = "4.0.2";
      format = "setuptools";

      meta = {
        broken = stdenv.hostPlatform.isDarwin;
        description = "OpenSteno Plover stenography software";
        maintainers = with lib.maintainers; [
          twey
          kovirobi
        ];
        license = lib.licenses.gpl2;
      };

      src = fetchFromGitHub {
        owner = "openstenoproject";
        repo = "plover";
        tag = "v${version}";
        sha256 = "sha256-VpQT25bl8yPG4J9IwLkhSkBt31Y8BgPJdwa88WlreA8=";
      };

      # I'm not sure why we don't find PyQt5 here but there's a similar
      # sed on many of the platforms Plover builds for
      postPatch = "sed -i /PyQt5/d setup.cfg";

      nativeCheckInputs = [
        pytest
        mock
      ];
      propagatedBuildInputs = [
        babel
        pyqt5
        xlib
        pyserial
        appdirs
        wcwidth
        setuptools
      ];

      dontWrapQtApps = true;

      preFixup = ''
        makeWrapperArgs+=("''${qtWrapperArgs[@]}")
      '';
    };
}
// lib.optionalAttrs config.allowAliases {
  stable = throw "plover.stable was removed because it used Python 2. Use plover.dev instead."; # added 2022-06-05
}
+17 −0
Original line number Diff line number Diff line
{
  lib,
  config,
  python3Packages,
  # For aliases
  plover,
}:
python3Packages.toPythonApplication python3Packages.plover
# Aliases to now-dropped plover.stable and plover.dev
# Added 2026-04-22
# TODO(@ShamrockLee): remove after Nixpkgs 25.11 EOL
// lib.optionalAttrs (config.allowAliases && !(lib.oldestSupportedReleaseIsAtLeast 2605)) {
  dev =
    lib.throwIf (lib.oldestSupportedReleaseIsAtLeast 2511) "plover.dev was renamed. Use plover instead."
      plover; # Added 2026-04-26
  stable = throw "plover.stable was renamed. Use plover instead."; # Added 2022-06-05; updated 2026-04-26
}
+3 −0
Original line number Diff line number Diff line
{ python3Packages }:

python3Packages.toPythonApplication python3Packages.plover_4
+3 −0
Original line number Diff line number Diff line
{ python3Packages }:

python3Packages.toPythonApplication python3Packages.plover_5
+57 −0
Original line number Diff line number Diff line
{
  lib,
  python,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  pytestCheckHook,
  pytest-qt,
  pyside6,
  versionCheckHook,
  which,
}:

buildPythonPackage (finalAttrs: {
  __structuredAttrs = true;

  pname = "plover-stroke";
  version = "1.1.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "openstenoproject";
    repo = "plover_stroke";
    tag = finalAttrs.version;
    hash = "sha256-A75OMzmEn0VmDAvmQCp6/7uptxzwWJTwsih3kWlYioA=";
  };

  build-system = [ setuptools ];

  nativeCheckInputs = [
    pytestCheckHook
    pytest-qt
    pyside6
  ];

  doInstallCheck = true;

  nativeInstallCheckInputs = [
    versionCheckHook
    which
  ];

  versionCheckProgramArg = "${placeholder "out"}/${python.sitePackages}";

  preInstallCheck = ''
    versionCheckProgram="$(which ls)"
  '';

  pythonImportsCheck = [ "plover_stroke" ];

  meta = {
    description = "Helper class for working with steno strokes";
    homepage = "https://github.com/openstenoproject/plover_stroke";
    license = lib.licenses.gpl2Plus; # https://github.com/openstenoproject/plover_stroke/issues/4
    maintainers = with lib.maintainers; [ pandapip1 ];
  };
})
Loading