Unverified Commit f92e3f1e authored by Martin Weinelt's avatar Martin Weinelt
Browse files

archivebox: drop

Stuck on Django 3 and the upstream project has no stable release
supporting a newer version.
parent 6537eec3
Loading
Loading
Loading
Loading
+0 −120
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  python3,
  fetchFromGitHub,
  fetchPypi,
  curl,
  wget,
  git,
  ripgrep,
  single-file-cli,
  postlight-parser,
  readability-extractor,
  chromium,
}:

let
  python = python3.override {
    self = python;
    packageOverrides = self: super: {
      django = super.django_3.overridePythonAttrs (old: rec {
        version = "3.1.14";
        src = old.src.override {
          inherit version;
          hash = "sha256-cqSloTaiFMOc8BbM3Wtp4qoIx0ecZtk/OpteS7nYo0c=";
        };
        meta = old.meta // {
          knownVulnerabilities = [
            "CVE-2021-45115"
            "CVE-2021-45116"
            "CVE-2021-45452"
            "CVE-2022-23833"
            "CVE-2022-22818"
            "CVE-2022-28347"
            "CVE-2022-28346"
          ];
        };
        dependencies =
          (old.dependencies or [ ])
          ++ (lib.optionals (python.pythonAtLeast "3.12") [ python.pkgs.distutils ]);
      });
      django-extensions = super.django-extensions.overridePythonAttrs (old: rec {
        version = "3.1.5";
        src = fetchFromGitHub {
          inherit version;
          owner = "django-extensions";
          repo = "django-extensions";
          rev = "e43f383dae3a35237e42f6acfe1207a8e7e7bdf5";
          hash = "sha256-NAMa78KhAuoJfp0Cb0Codz84sRfRQ1JhSLNYRI4GBPM=";
        };
        patches = [ ];
        postPatch = null;

        # possibly a real issue, but that version is not supported anymore
        doCheck = false;
      });
    };
  };
in

python.pkgs.buildPythonApplication rec {
  pname = "archivebox";
  version = "0.7.2";
  pyproject = true;

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-hdBUEX2tOWN2b11w6aG3x7MP7KQTj4Rwc2w8XvABGf4=";
  };

  build-system = with python.pkgs; [
    pdm-backend
  ];

  dependencies = with python.pkgs; [
    croniter
    dateparser
    django
    django-extensions
    ipython
    mypy-extensions
    python-crontab
    requests
    w3lib
    yt-dlp
  ];

  makeWrapperArgs = [
    "--set USE_NODE True" # used through dependencies, not needed explicitly
    "--set READABILITY_BINARY ${lib.meta.getExe readability-extractor}"
    "--set MERCURY_BINARY ${lib.meta.getExe postlight-parser}"
    "--set CURL_BINARY ${lib.meta.getExe curl}"
    "--set RIPGREP_BINARY ${lib.meta.getExe ripgrep}"
    "--set WGET_BINARY ${lib.meta.getExe wget}"
    "--set GIT_BINARY ${lib.meta.getExe git}"
    "--set YOUTUBEDL_BINARY ${lib.meta.getExe python.pkgs.yt-dlp}"
    "--set SINGLEFILE_BINARY ${lib.meta.getExe single-file-cli}"
  ]
  ++ (
    if (lib.meta.availableOn stdenv.hostPlatform chromium) then
      [
        "--set CHROME_BINARY ${chromium}/bin/chromium-browser"
      ]
    else
      [
        "--set-default USE_CHROME False"
      ]
  );

  meta = with lib; {
    description = "Open source self-hosted web archiving";
    homepage = "https://archivebox.io";
    license = licenses.mit;
    maintainers = with maintainers; [
      siraben
      viraptor
    ];
    platforms = platforms.unix;
  };
}
+1 −0
Original line number Diff line number Diff line
@@ -303,6 +303,7 @@ mapAliases {
  arb = throw "'arb' has been removed as it has been merged into 'flint3'"; # Added 2025-03-28
  arcanist = throw "arcanist was removed as phabricator is not supported and does not accept fixes"; # Added 2024-06-07
  archipelago-minecraft = throw "archipelago-minecraft has been removed, as upstream no longer ships minecraft as a default APWorld."; # Added 2025-07-15
  archivebox = throw "archivebox has been removed, since the packaged version was stuck on django 3."; # Added 2025-08-01
  argo = argo-workflows; # Added 2025-02-01
  aria = aria2; # Added 2024-03-26
  artim-dark = aritim-dark; # Added 2025-07-27