about summary refs log tree commit diff
path: root/pkgs/development/python-modules/rubicon-objc/default.nix
blob: f12f08e0ad47f4ce7dca31ae5f1dcc08b244f150 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{ lib
, buildPythonPackage
, darwin
, fetchFromGitHub
, pythonOlder
, setuptools
, setuptools-scm
, unittestCheckHook
}:

buildPythonPackage rec {
  pname = "rubicon-objc";
  version = "0.4.8";
  pyproject = true;

  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "beeware";
    repo = "rubicon-objc";
    rev = "refs/tags/v${version}";
    hash = "sha256-aFKzLeVYn5u8hTEgXCum3XpZxI7C/Wql41jkWkCF0HQ=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail "setuptools==69.2.0" "setuptools" \
      --replace-fail "setuptools_scm==8.0.4" "setuptools_scm"
  '';

  build-system = [
    setuptools
    setuptools-scm
  ];

  preCheck = ''
    make -C tests/objc
  '';

  nativeCheckInputs = [
    unittestCheckHook
  ];

  checkInputs = [
    darwin.apple_sdk.frameworks.Foundation
  ];

  pythonImportsCheck = [
    "rubicon.objc"
  ];

  __darwinAllowLocalNetworking = true;

  meta = {
    description = "A bridge interface between Python and Objective-C";
    homepage = "https://github.com/beeware/rubicon-objc/";
    changelog = "https://github.com/beeware/rubicon-objc/releases/tag/v${version}";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ natsukium ];
    platforms = lib.platforms.darwin;
  };
}