summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/jpype1/default.nix
blob: bfb58b5382d5284bd001f26fb3741a09c4ea0a6a (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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  ant,
  openjdk,
  packaging,
  pyinstaller,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "jpype1";
  version = "1.6.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "originell";
    repo = "jpype";
    tag = "v${version}";
    hash = "sha256-CDiVQugxLgmUwAG0e0ryamWvrjUaJxJrU0YSFIIWS1I=";
  };

  build-system = [ setuptools ];

  nativeBuildInputs = [
    ant
    openjdk
  ];

  preBuild = ''
    ant -f native/build.xml jar
  '';

  dependencies = [ packaging ];

  nativeCheckInputs = [
    pyinstaller
    pytestCheckHook
  ];

  # Cannot find various classes. If you want to fix this
  # take a look at the opensuse packaging:
  # https://build.opensuse.org/projects/openSUSE:Factory/packages/python-JPype1/files/python-JPype1.spec?expand=1
  doCheck = false;

  preCheck = ''
    ant -f test/build.xml compile
  '';

  pythonImportsCheck = [
    "jpype"
    "jpype.imports"
    "jpype.types"
  ];

  meta = {
    homepage = "https://github.com/originell/jpype/";
    sourceProvenance = with lib.sourceTypes; [
      fromSource
      binaryBytecode
    ];
    license = lib.licenses.asl20;
    description = "Python to Java bridge";
  };
}