1{
2 lib,
3 buildPythonPackage,
4 darwin,
5 fetchFromGitHub,
6 pythonOlder,
7 setuptools,
8 setuptools-scm,
9 unittestCheckHook,
10}:
11
12buildPythonPackage rec {
13 pname = "rubicon-objc";
14 version = "0.4.9";
15 pyproject = true;
16
17 disabled = pythonOlder "3.8";
18
19 src = fetchFromGitHub {
20 owner = "beeware";
21 repo = "rubicon-objc";
22 rev = "refs/tags/v${version}";
23 hash = "sha256-jQ/q2yIXJp+X4ajcbEqxXuYtYeyZJ1xTBjSlzqLuRpg=";
24 };
25
26 postPatch = ''
27 substituteInPlace pyproject.toml \
28 --replace-fail "setuptools==69.5.1" "setuptools" \
29 --replace-fail "setuptools_scm==8.0.4" "setuptools_scm"
30 '';
31
32 build-system = [
33 setuptools
34 setuptools-scm
35 ];
36
37 preCheck = ''
38 make -C tests/objc
39 '';
40
41 nativeCheckInputs = [ unittestCheckHook ];
42
43 checkInputs = [ darwin.apple_sdk.frameworks.Foundation ];
44
45 pythonImportsCheck = [ "rubicon.objc" ];
46
47 __darwinAllowLocalNetworking = true;
48
49 meta = {
50 description = "Bridge interface between Python and Objective-C";
51 homepage = "https://github.com/beeware/rubicon-objc/";
52 changelog = "https://github.com/beeware/rubicon-objc/releases/tag/v${version}";
53 license = lib.licenses.bsd3;
54 maintainers = with lib.maintainers; [ natsukium ];
55 platforms = lib.platforms.darwin;
56 };
57}