summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/python-efl/default.nix
blob: ca1e4306bd4e1228eb457c1c2e62f90792abda8d (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
{
  lib,
  fetchurl,
  buildPythonPackage,
  pythonAtLeast,

  pkg-config,

  enlightenment,

  packaging,
  setuptools,

  dbus-python,

  pytestCheckHook,

  directoryListingUpdater,
}:

# Should be bumped along with EFL!

buildPythonPackage rec {
  pname = "python-efl";
  version = "1.26.1";
  pyproject = true;

  # As of 1.26.1, native extensions fail to build with python 3.13+
  disabled = pythonAtLeast "3.13";

  src = fetchurl {
    url = "http://download.enlightenment.org/rel/bindings/python/python-efl-${version}.tar.xz";
    hash = "sha256-3Ns5fhIHihnpDYDnxvPP00WIZL/o1UWLzgNott4GKNc=";
  };

  nativeBuildInputs = [ pkg-config ];

  buildInputs = [ enlightenment.efl ];

  build-system = [
    packaging
    setuptools
  ];

  dependencies = [
    dbus-python
  ];

  preConfigure = ''
    NIX_CFLAGS_COMPILE="$(pkg-config --cflags efl evas) $NIX_CFLAGS_COMPILE"
  '';

  nativeCheckInputs = [
    pytestCheckHook
  ];

  preCheck = ''
    # make sure we load the library from $out instead of the cwd
    # because cwd doesn't contain the built extensions
    rm -r efl/

    patchShebangs tests/ecore/exe_helper.sh

    # use the new name instead of the removed alias
    substituteInPlace tests/evas/test_01_rect.py \
      --replace-fail ".assert_(" ".assertTrue("
  '';

  enabledTestPaths = [ "tests/" ];

  disabledTestPaths = [
    "tests/dbus/test_01_basics.py" # needs dbus daemon
    "tests/ecore/test_09_file_download.py" # uses network
    "tests/ecore/test_11_con.py" # uses network
    "tests/elementary/test_02_image_icon.py" # RuntimeWarning: Setting standard icon failed
  ];

  passthru.updateScript = directoryListingUpdater { };

  meta = {
    description = "Python bindings for Enlightenment Foundation Libraries";
    homepage = "https://github.com/DaveMDS/python-efl";
    platforms = lib.platforms.linux;
    license = with lib.licenses; [
      gpl3
      lgpl3
    ];
    maintainers = with lib.maintainers; [
      matejc
      ftrvxmtrx
    ];
    teams = [ lib.teams.enlightenment ];
  };
}