summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/macholib/default.nix
blob: 7efe8a3d717ab599ea2543698b8f06f36f386497 (plain)
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
{
  lib,
  stdenv,
  buildPythonPackage,
  fetchFromGitHub,
  pythonOlder,
  unittestCheckHook,
  altgraph,
  setuptools,
  typing-extensions,
  pyinstaller,
}:

buildPythonPackage rec {
  pname = "macholib";
  version = "1.16.3";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "ronaldoussoren";
    repo = "macholib";
    rev = "v${version}";
    hash = "sha256-bTql10Ceny4fBCxnEWz1m1wi03EWMDW9u99IQiWYbnY=";
  };

  build-system = [ setuptools ];

  dependencies = [
    altgraph
  ]
  ++ lib.optionals (pythonOlder "3.11") [
    typing-extensions
  ];

  # Checks assume to find darwin specific libraries
  doCheck = stdenv.buildPlatform.isDarwin;
  nativeCheckInputs = [
    unittestCheckHook
  ];

  passthru.tests = {
    inherit pyinstaller; # Requires macholib for darwin
  };

  preCheck = ''
    export PATH="$PATH:$out/bin"
  '';

  meta = {
    description = "Analyze and edit Mach-O headers, the executable format used by Mac OS X";
    homepage = "https://github.com/ronaldoussoren/macholib";
    changelog = "https://github.com/ronaldoussoren/macholib/releases/tag/v${version}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ eveeifyeve ];
  };
}