1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchPypi,
6
7 # build-system
8 setuptools,
9
10 # native dependencies
11 zlib,
12
13 # dependencies
14 altgraph,
15 macholib,
16 packaging,
17 pyinstaller-hooks-contrib,
18
19 # tests
20 binutils,
21 glibc,
22 pyinstaller,
23 testers,
24}:
25
26buildPythonPackage rec {
27 pname = "pyinstaller";
28 version = "6.15.0";
29 pyproject = true;
30
31 src = fetchPypi {
32 inherit pname version;
33 hash = "sha256-pI/EZE7kqiqio157UfSW+PvX7s9qIVBka78WE60HvC0=";
34 };
35
36 build-system = [ setuptools ];
37
38 buildInputs = [ zlib.dev ];
39
40 dependencies = [
41 altgraph
42 packaging
43 macholib
44 pyinstaller-hooks-contrib
45 ];
46
47 makeWrapperArgs = lib.optionals stdenv.hostPlatform.isLinux [
48 "--prefix"
49 "PATH"
50 ":"
51 (lib.makeBinPath [
52 glibc
53 binutils
54 ])
55 ];
56
57 pythonImportsCheck = [ "PyInstaller" ];
58
59 passthru.tests.version = testers.testVersion {
60 package = pyinstaller;
61 };
62
63 meta = {
64 description = "Tool to bundle a python application with dependencies into a single package";
65 homepage = "https://pyinstaller.org/";
66 changelog = "https://pyinstaller.org/en/v${version}/CHANGES.html";
67 downloadPage = "https://pypi.org/project/pyinstaller/";
68 license = with lib.licenses; [
69 mit
70 asl20
71 gpl2Plus
72 ];
73 maintainers = with lib.maintainers; [ h7x4 ];
74 mainProgram = "pyinstaller";
75 };
76}