anchor.diff:    prePatch = ''
       substituteInPlace setup.py \
         --replace "from setuptools_rust import Binding, RustExtension" "" \
  -      --replace "RustExtension(\"portmod.portmod\", binding=Binding.PyO3, strip=True)" ""
  +      --replace "RustExtension(\"portmodlib.portmod\", binding=Binding.PyO3, strip=True)" ""
     '';
  +
  +  patches = [
  +    (fetchpatch {
  +      # fix error when symlinks are present in the path (https://gitlab.com/portmod/portmod/-/merge_requests/393)
  +      # happen with ~/.nix-profile
  +      url = "https://gitlab.com/portmod/portmod/-/merge_requests/393.patch";
  +      sha256 = "sha256-XHifwD/Nh7UiMZdvSNudVF7qpBOpjGTKSr4VVdJqUdA=";
  +    })
  +  ];
   
     propagatedBuildInputs = with python3Packages; [
       setuptools-scm
  
positive.code:     redbaron
      patool
      packaging
    ];
  
    checkInputs = with python3Packages; [
  
negative.code:     "test_execute_network_permissions"
      "test_execute_permissions_bleed"
      "test_git"
      "test_sync"
      "test_manifest"
      "test_add_repo"
    ];
  
    # for some reason, installPhase doesn't copy the compiled binary
    postInstall = ''
      cp ${portmod-rust}/lib/libportmod.so $out/${python3Packages.python.sitePackages}/portmodlib/portmod.so
  
      makeWrapperArgs+=("--prefix" "GIT_SSL_CAINFO" ":" "${cacert}/etc/ssl/certs/ca-bundle.crt" \
        "--prefix" "PATH" ":" "${lib.makeBinPath bin-programs }")
  