Unverified Commit 211bc94a authored by Rob's avatar Rob
Browse files

python311Packages.nuitka: add propagatedBuildInputs and enable pythonImportsCheck and checkPhase

parent 61df5d13
Loading
Loading
Loading
Loading
+22 −20
Original line number Diff line number Diff line
{ lib, stdenv
{ lib
, stdenv
, buildPythonPackage
, ccache
, fetchFromGitHub
, vmprof
, isPyPy
, pkgs
, scons
, chrpath
, ordered-set
, python3
, setuptools
, zstandard
}:

buildPythonPackage rec {
  pname = "nuitka";
  version = "1.8.4";
  format = "setuptools";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "Nuitka";
@@ -20,30 +22,30 @@ buildPythonPackage rec {
    hash = "sha256-spa3V9KEjqmwnHSuxLLIu9hJk5PrRwNyOw72sfxBVKo=";
  };

  nativeCheckInputs = [ vmprof ];
  nativeBuildInputs = [ scons ];
  propagatedBuildInputs = [ chrpath ];
  nativeBuildInputs = [ setuptools ];
  nativeCheckInputs = [ ccache  ];

  postPatch = ''
    patchShebangs tests/run-tests
  '' + lib.optionalString stdenv.isLinux ''
    substituteInPlace nuitka/plugins/standard/ImplicitImports.py --replace 'locateDLL("uuid")' '"${lib.getLib pkgs.util-linux}/lib/libuuid.so"'
  '';

  # We do not want any wrappers here.
  postFixup = "";
  propagatedBuildInputs = [
    ordered-set
    zstandard
  ];

  checkPhase = ''
    tests/run-tests
    runHook preCheck

    ${python3.interpreter} tests/basics/run_all.py search

    runHook postCheck
  '';

  # Problem with a subprocess (parts)
  doCheck = false;
  pythonImportsCheck = [ "nuitka" ];

  # Requires CPython
  disabled = isPyPy;

  meta = with lib; {
    # tests fail with linker errors on darwin
    broken = stdenv.isDarwin;
    description = "Python compiler with full language support and CPython compatibility";
    license = licenses.asl20;
    homepage = "https://nuitka.net/";