Unverified Commit cbb270b4 authored by OTABI Tomoya's avatar OTABI Tomoya Committed by GitHub
Browse files

Merge pull request #333058 from deshaw/upstream-python-krb5

Detangle Python `krb5` dependency mess
parents 936b2614 21faf599
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
  fetchPypi,
  git,
  gitpython,
  krb5,
  krb5-c, # C krb5 library, not PyPI krb5
  mock,
  pytestCheckHook,
  pythonOlder,
@@ -23,7 +23,7 @@ buildPythonPackage rec {
    hash = "sha256-YzKjG43biRbTZKtzSUHHhtzOfcZfzISHDFolqzrBjL8=";
  };

  buildInputs = [ krb5 ];
  buildInputs = [ krb5-c ];

  propagatedBuildInputs = [
    git
+3 −3
Original line number Diff line number Diff line
@@ -7,7 +7,6 @@

  # build-system
  cython,
  krb5,
  setuptools,

  # dependencies
@@ -15,6 +14,7 @@

  # native dependencies
  GSS,
  krb5-c, # C krb5 library, not PyPI krb5

  # tests
  parameterized,
@@ -38,7 +38,7 @@ buildPythonPackage rec {

  postPatch = ''
    substituteInPlace setup.py \
      --replace 'get_output(f"{kc} gssapi --prefix")' '"${lib.getDev krb5}"'
      --replace 'get_output(f"{kc} gssapi --prefix")' '"${lib.getDev krb5-c}"'
  '';

  env = lib.optionalAttrs (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) {
@@ -47,7 +47,7 @@ buildPythonPackage rec {

  build-system = [
    cython
    krb5
    krb5-c
    setuptools
  ];

+6 −5
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  pythonOlder,
  fetchPypi,
  substituteAll,
  findutils,
  krb5,
  krb5-c,
  pythonOlder,
  setuptools,
  substituteAll,
}:

buildPythonPackage rec {
@@ -24,9 +24,10 @@ buildPythonPackage rec {
  patches = [
    (substituteAll {
      src = ./fix-paths.patch;
      inherit findutils krb5;
      inherit findutils;
      krb5 = krb5-c;
      # krb5-config is in dev output
      krb5Dev = krb5.dev;
      krb5Dev = krb5-c.dev;
    })
  ];

+46 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  cython,
  fetchPypi,
  k5test,
  krb5-c, # C krb5 library
  pytestCheckHook,
  pythonOlder,
  setuptools,
}:

buildPythonPackage rec {
  pname = "krb5";
  version = "0.6.0";
  pyproject = true;

  disabled = pythonOlder "3.7";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-cSugkvvjoo7BiCC7Gx7SzBA3t1xccDP5cMaoyXu9Egk=";
  };

  build-system = [
    cython
    setuptools
  ];

  nativeBuildInputs = [ krb5-c ];

  nativeCheckInputs = [
    k5test
    pytestCheckHook
  ];

  pythonImportsCheck = [ "krb5" ];

  meta = with lib; {
    changelog = "https://github.com/jborean93/pykrb5/blob/v${version}/CHANGELOG.md";
    description = "Kerberos API bindings for Python";
    homepage = "https://github.com/jborean93/pykrb5";
    license = licenses.mit;
    maintainers = teams.deshaw.members;
  };
}
+4 −3
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
  lib,
  fetchPypi,
  buildPythonPackage,
  krb5,
  krb5-c, # C krb5 library, not PyPI krb5
}:

buildPythonPackage rec {
@@ -15,12 +15,13 @@ buildPythonPackage rec {
    hash = "sha256-nXAevY/FlsmdMVXVukWBO9WQjSbvg7oK3SUO22IqvtQ=";
  };

  nativeBuildInputs = [ krb5 ]; # for krb5-config
  nativeBuildInputs = [ krb5-c ]; # for krb5-config

  buildInputs = [ krb5 ];
  buildInputs = [ krb5-c ];

  # there are no tests
  doCheck = false;

  pythonImportsCheck = [ "kerberos" ];

  meta = with lib; {
Loading