From 3007cb41936117ea8d2be2d10fc12386faed18cb Mon Sep 17 00:00:00 2001 From: Septem9er Date: Thu, 13 Jun 2024 17:55:27 +0200 Subject: [PATCH 1/3] python3Packages.pyinstaller-hooks-contrib: init at 2024.7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: h7x4 Co-authored-by: Sandro Jäckel --- .../pyinstaller-hooks-contrib/default.nix | 45 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 47 insertions(+) create mode 100644 pkgs/development/python-modules/pyinstaller-hooks-contrib/default.nix 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/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ed6b0afba04e..a69e4715c0ce 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10031,6 +10031,8 @@ self: super: with self; { pyindego = callPackage ../development/python-modules/pyindego { }; + pyinstaller-hooks-contrib = callPackage ../development/python-modules/pyinstaller-hooks-contrib { }; + pyinstaller-versionfile = callPackage ../development/python-modules/pyinstaller-versionfile { }; pyisemail = callPackage ../development/python-modules/pyisemail { }; From 90d89c4c639e5ba87a924080c240f6dc0a2a654b Mon Sep 17 00:00:00 2001 From: h7x4 Date: Thu, 13 Jun 2024 17:57:01 +0200 Subject: [PATCH 2/3] python3Packages.altgraph: add missing dependency --- pkgs/development/python-modules/altgraph/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/python-modules/altgraph/default.nix b/pkgs/development/python-modules/altgraph/default.nix index e45be70d4a08..7a9ab0a71cf8 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 { sha256 = "sha256-G1r7uY9sTcrbLirmq5+plLu4wddfT6ltNA+UN65FRAY="; }; + dependencies = [ + # setuptools in dependencies is intentional + # https://github.com/ronaldoussoren/altgraph/issues/21 + setuptools + ]; + pythonImportsCheck = [ "altgraph" ]; meta = with lib; { From 99d791681bf20252d7db4a667428081f867c0cc2 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Thu, 13 Jun 2024 17:57:38 +0200 Subject: [PATCH 3/3] python3Packages.pyinstaller: init at 6.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sandro Jäckel --- .../python-modules/pyinstaller/default.nix | 67 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 69 insertions(+) create mode 100644 pkgs/development/python-modules/pyinstaller/default.nix 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 a69e4715c0ce..31fa33013dd6 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10031,6 +10031,8 @@ 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 { };