{ runCommand, lib, makeWrapper, python3
, archivers ? [ python3.pkgs.mailman-hyperkitty ]
}:

let
  inherit (python3.pkgs) makePythonPath mailman;
in

runCommand "${mailman.name}-wrapped" {
  inherit (mailman) meta;
  buildInputs = [ makeWrapper ];
  passthru = mailman.passthru // { unwrapped = mailman; };
} ''
  mkdir -p "$out/bin"
  cd "${mailman}/bin"
  for exe in *; do
    makeWrapper "${mailman}/bin/$exe" "$out/bin/$exe" \
        --set PYTHONPATH ${makePythonPath ([ mailman python3.pkgs.urllib3 ] ++ archivers)}
  done
''

{ runCommand, lib, makeWrapper, python3
, archivers ? [ python3.pkgs.mailman-hyperkitty ]
}:

let
  inherit (python3.pkgs) makePythonPath mailman;
in

runCommand "${mailman.name}-wrapped" {
  inherit (mailman) meta;
  buildInputs = [ makeWrapper ];
  passthru = mailman.passthru // { unwrapped = mailman; };
} ''
  mkdir -p "$out/bin"
  cd "${mailman}/bin"
  for exe in *; do
    makeWrapper "${mailman}/bin/$exe" "$out/bin/$exe" \
        --set PYTHONPATH ${makePythonPath ([ mailman ] ++ archivers)}
  done
''

Revert "mailman-wrapper: crazy hack to work around the missing urllib3 dependency"
Revert "mailman-wrapper: crazy hack to work around the missing urllib3 dependency"

This reverts commit ce6b2419be6e16cc6b9096c99798a0d365b16486, which
was unnecessary (mailman worked just fine on its parent commit).

See #79222.
