Skip to content

Commit

Permalink
archivebox: modernize
Browse files Browse the repository at this point in the history
  • Loading branch information
pyrox0 committed Nov 12, 2024
1 parent 22393b1 commit be80485
Showing 1 changed file with 37 additions and 28 deletions.
65 changes: 37 additions & 28 deletions pkgs/by-name/ar/archivebox/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
readability-extractor,
chromium,
yt-dlp,
versionCheckHook,
nix-update-script,
}:

let
Expand Down Expand Up @@ -66,15 +68,17 @@ python.pkgs.buildPythonApplication rec {
fetchSubmodules = true;
};

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

propagatedBuildInputs =
dependencies =
with python.pkgs;
[
# Core Libraries
django
# Tests do not pass in the Nix build environment, so disable them.
# It still works properly
(django-ninja.overridePythonAttrs { doCheck = false; })
django-extensions
mypy-extensions
Expand Down Expand Up @@ -117,11 +121,9 @@ python.pkgs.buildPythonApplication rec {
pocket
sonic-client
yt-dlp
# Plugin dependencies

]
++ python.pkgs.python-benedict.optional-dependencies.io
++ python.pkgs.python-benedict.optional-dependencies.parse;
++ lib.flatten (lib.attrValues python.pkgs.python-benedict.optional-dependencies);

optional-dependencies = {
ldap = with python.pkgs; [
Expand All @@ -137,36 +139,43 @@ python.pkgs.buildPythonApplication rec {
];
};

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 yt-dlp}"
]
++ (
nativeInstallCheckInputs = [
versionCheckHook
];

pythonImportsCheck = [ "archivebox" ];

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

passthru = {
updateScript = nix-update-script { };
};

meta = with lib; {
meta = {
description = "Open source self-hosted web archiving";
homepage = "https://archivebox.io";
license = licenses.mit;
maintainers = with maintainers; [
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
siraben
viraptor
pyrox0
];
platforms = platforms.unix;
platforms = lib.platforms.unix;
mainProgram = "archivebox";
};
}

0 comments on commit be80485

Please sign in to comment.