about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/cx-freeze/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/cx-freeze/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/cx-freeze/default.nix62
1 files changed, 62 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/cx-freeze/default.nix b/nixpkgs/pkgs/development/python-modules/cx-freeze/default.nix
new file mode 100644
index 000000000000..b30fa8e5659f
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/cx-freeze/default.nix
@@ -0,0 +1,62 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, pythonOlder
+, ncurses
+, importlib-metadata
+, setuptools
+, wheel
+, patchelf
+}:
+
+buildPythonPackage rec {
+  pname = "cx-freeze";
+  version = "6.14.4";
+  format = "pyproject";
+
+  disabled = pythonOlder "3.5";
+
+  src = fetchPypi {
+    pname = "cx_Freeze";
+    inherit version;
+    hash = "sha256-ydox+o4B0t/dYD+nDiY5CmWupt1iMzyU2fA4tCqgVcg=";
+  };
+
+  nativeBuildInputs = [
+    setuptools
+    wheel
+  ];
+
+  propagatedBuildInputs = [
+    importlib-metadata # upstream has this for 3.8 as well
+    ncurses
+    setuptools
+  ];
+
+  postPatch = ''
+    # timestamp need to come after 1980 for zipfiles and nix store is set to epoch
+    substituteInPlace cx_Freeze/freezer.py --replace "st.st_mtime" "time.time()"
+
+    sed -i /patchelf/d pyproject.toml
+    substituteInPlace pyproject.toml \
+      --replace 'setuptools>=61.2,<67' setuptools
+  '';
+
+  makeWrapperArgs = [
+    "--prefix"
+    "PATH"
+    ":"
+    (lib.makeBinPath [ patchelf ])
+  ];
+
+  # fails to find Console even though it exists on python 3.x
+  doCheck = false;
+
+  meta = with lib; {
+    description = "A set of scripts and modules for freezing Python scripts into executables";
+    homepage = "https://marcelotduarte.github.io/cx_Freeze/";
+    license = licenses.psfl;
+    maintainers = with maintainers; [ ];
+    mainProgram = "cxfreeze";
+  };
+}