python310Packages.cx_Freeze: fix build

This commit is contained in:
figsoda
2023-05-17 14:04:35 -04:00
parent 4376e41af0
commit 2b47cedec6
@@ -1,4 +1,12 @@
{ stdenv, lib, buildPythonPackage, pythonOlder, fetchPypi, ncurses, importlib-metadata }:
{ lib
, buildPythonPackage
, fetchPypi
, pythonOlder
, ncurses
, importlib-metadata
, setuptools
, patchelf
}:
buildPythonPackage rec {
pname = "cx-freeze";
@@ -15,23 +23,33 @@ buildPythonPackage rec {
propagatedBuildInputs = [
importlib-metadata # upstream has this for 3.8 as well
ncurses
setuptools
];
# timestamp need to come after 1980 for zipfiles and nix store is set to epoch
postPatch = ''
substituteInPlace cx_Freeze/freezer.py --replace "os.stat(module.file).st_mtime" "time.time()"
# 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()"
substituteInPlace setup.cfg \
--replace "setuptools>=59.0.1,<=60.10.0" "setuptools>=59.0.1"
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; {
broken = (stdenv.isLinux && stdenv.isAarch64);
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";
};
}