diff --git a/pkgs/development/python-modules/altgraph/default.nix b/pkgs/development/python-modules/altgraph/default.nix index 5e638c4aa9b0..932896f1beea 100644 --- a/pkgs/development/python-modules/altgraph/default.nix +++ b/pkgs/development/python-modules/altgraph/default.nix @@ -2,6 +2,7 @@ lib, buildPythonPackage, fetchPypi, + setuptools }: buildPythonPackage rec { @@ -15,6 +16,12 @@ buildPythonPackage rec { hash = "sha256-G1r7uY9sTcrbLirmq5+plLu4wddfT6ltNA+UN65FRAY="; }; + dependencies = [ + # setuptools in dependencies is intentional + # https://github.com/ronaldoussoren/altgraph/issues/21 + setuptools + ]; + pythonImportsCheck = [ "altgraph" ]; meta = with lib; { diff --git a/pkgs/development/python-modules/pyinstaller-hooks-contrib/default.nix b/pkgs/development/python-modules/pyinstaller-hooks-contrib/default.nix new file mode 100644 index 000000000000..59622dd05159 --- /dev/null +++ b/pkgs/development/python-modules/pyinstaller-hooks-contrib/default.nix @@ -0,0 +1,45 @@ +{ + lib +, buildPythonPackage +, fetchPypi +, setuptools +}: + +buildPythonPackage rec { + pname = "pyinstaller-hooks-contrib"; + version = "2024.7"; + + pyproject = true; + + src = fetchPypi { + pname = "pyinstaller_hooks_contrib"; + inherit version; + hash = "sha256-/V833Pmb7OGE5AZCr4i+Fqm4lhPsuViovRE2Y0/J+sU="; + }; + + build-system = [ setuptools ]; + + # There are tests for every hook, which means that + # new updates are going to require changes to test inputs + # and building tests creates a very big closure. + doCheck = false; + + meta = { + description = "Community maintained hooks for PyInstaller"; + longDescription = '' + A "hook" file extends PyInstaller to adapt it to the special needs and methods used by a Python package. + The word "hook" is used for two kinds of files. A runtime hook helps the bootloader to launch an app, + setting up the environment. A package hook (there are several types of those) tells PyInstaller + what to include in the final app - such as the data files and (hidden) imports mentioned above. + This repository is a collection of hooks for many packages, and allows PyInstaller to work with these packages seamlessly. + ''; + homepage = "https://github.com/pyinstaller/pyinstaller-hooks-contrib"; + # See https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/761 + changelog = "https://github.com/pyinstaller/pyinstaller-hooks-contrib/blob/master/CHANGELOG.rst"; + license = with lib.licenses; [ + gpl2Plus + asl20 + ]; + maintainers = with lib.maintainers; [ h7x4 ]; + }; +} diff --git a/pkgs/development/python-modules/pyinstaller/default.nix b/pkgs/development/python-modules/pyinstaller/default.nix new file mode 100644 index 000000000000..2c8fc65ebd28 --- /dev/null +++ b/pkgs/development/python-modules/pyinstaller/default.nix @@ -0,0 +1,67 @@ +{ + lib +, buildPythonPackage +, fetchPypi +, setuptools +, zlib +, altgraph +, packaging +, pyinstaller-hooks-contrib +, testers +, pyinstaller +, glibc +, binutils +, installShellFiles +}: + +buildPythonPackage rec { + pname = "pyinstaller"; + version = "6.8.0"; + pyproject = true; + + src = fetchPypi { + inherit pname version; + hash = "sha256-P0tlIPRCP+GbzC/WOrcjiFGuK9y8mPJbxdL5fMYgEuk="; + }; + + + build-system = [ setuptools ]; + + nativeBuildInputs = [ installShellFiles ]; + + buildInputs = [ zlib.dev ]; + + dependencies = [ + altgraph + packaging + pyinstaller-hooks-contrib + ]; + + makeWrapperArgs = [ + "--prefix" "PATH" ":" (lib.makeBinPath [ glibc binutils ]) + ]; + + postInstall = '' + installManPage doc/pyinstaller.1 doc/pyi-makespec.1 + ''; + + pythonImportsCheck = [ "PyInstaller" ]; + + passthru.tests.version = testers.testVersion { + package = pyinstaller; + }; + + meta = { + description = "A tool to bundle a python application with dependencies into a single package"; + homepage = "https://pyinstaller.org/"; + changelog = "https://pyinstaller.org/en/v${version}/CHANGES.html"; + downloadPage = "https://pypi.org/project/pyinstaller/"; + license = with lib.licenses; [ + mit + asl20 + gpl2Plus + ]; + maintainers = with lib.maintainers; [ h7x4 ]; + mainProgram = "pyinstaller"; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 68d57e2e7c77..4e8b8a35dcf0 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10182,6 +10182,10 @@ self: super: with self; { pyindego = callPackage ../development/python-modules/pyindego { }; + pyinstaller = callPackage ../development/python-modules/pyinstaller { }; + + pyinstaller-hooks-contrib = callPackage ../development/python-modules/pyinstaller-hooks-contrib { }; + pyinstaller-versionfile = callPackage ../development/python-modules/pyinstaller-versionfile { }; pyisemail = callPackage ../development/python-modules/pyisemail { };