1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 ant,
7 openjdk,
8 packaging,
9 pyinstaller,
10 pytestCheckHook,
11}:
12
13buildPythonPackage rec {
14 pname = "jpype1";
15 version = "1.6.0";
16 pyproject = true;
17
18 src = fetchFromGitHub {
19 owner = "originell";
20 repo = "jpype";
21 tag = "v${version}";
22 hash = "sha256-CDiVQugxLgmUwAG0e0ryamWvrjUaJxJrU0YSFIIWS1I=";
23 };
24
25 build-system = [ setuptools ];
26
27 nativeBuildInputs = [
28 ant
29 openjdk
30 ];
31
32 preBuild = ''
33 ant -f native/build.xml jar
34 '';
35
36 dependencies = [ packaging ];
37
38 nativeCheckInputs = [
39 pyinstaller
40 pytestCheckHook
41 ];
42
43 # Cannot find various classes. If you want to fix this
44 # take a look at the opensuse packaging:
45 # https://build.opensuse.org/projects/openSUSE:Factory/packages/python-JPype1/files/python-JPype1.spec?expand=1
46 doCheck = false;
47
48 preCheck = ''
49 ant -f test/build.xml compile
50 '';
51
52 pythonImportsCheck = [
53 "jpype"
54 "jpype.imports"
55 "jpype.types"
56 ];
57
58 meta = with lib; {
59 homepage = "https://github.com/originell/jpype/";
60 sourceProvenance = with sourceTypes; [
61 fromSource
62 binaryBytecode
63 ];
64 license = licenses.asl20;
65 description = "Python to Java bridge";
66 };
67}