about summary refs log tree commit diff
path: root/pkgs/by-name/we/web-archives/package.nix
blob: 2c052474489bc10f72a5503270278265e6c27601 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{
  lib,
  stdenv,
  fetchFromGitHub,
  fetchurl,
  meson,
  ninja,
  vala,
  pkg-config,
  wrapGAppsHook3,
  libzim-glib,
  sqlite,
  webkitgtk_4_1,
  tracker,
  libxml2,
  libisocodes,
  libhandy,
  glib-networking,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "web-archives";
  version = "0.5.0";

  src = fetchFromGitHub {
    owner = "birros";
    repo = "web-archives";
    rev = "v${finalAttrs.version}";
    hash = "sha256-EYHChI+4tpjRp4KveHTB+5BSLtw0YLp5z2JJmA0xTlM=";
  };

  web-archive-darkreader = fetchurl {
    # This is the same with build-aux/darkreader/Makefile
    url = "https://github.com/birros/web-archives-darkreader/releases/download/v0.0.1/web-archives-darkreader_v0.0.1.js";
    hash = "sha256-juhAqs2eCYZKerLnX3NvaW3NS0uOhqB7pyf/PRDvMqE=";
  };

  postPatch = ''
    substituteInPlace meson.build \
      --replace-fail \
        "'make', '-C', 'build-aux/darkreader'" \
        "'cp', '${finalAttrs.web-archive-darkreader}', 'build-aux/darkreader/web-archives-darkreader.js'"
  '';

  nativeBuildInputs = [
    meson
    ninja
    vala
    pkg-config
    wrapGAppsHook3
  ];

  buildInputs = [
    libzim-glib
    sqlite
    webkitgtk_4_1
    tracker
    libxml2
    libisocodes
    libhandy
    glib-networking
  ];

  strictDeps = true;

  passthru = {
    inherit (finalAttrs) web-archive-darkreader;
  };

  meta = {
    description = "Web archives reader offering the ability to browse offline millions of articles";
    homepage = "https://github.com/birros/web-archives";
    license = lib.licenses.gpl3Plus;
    mainProgram = "web-archives";
    maintainers = with lib.maintainers; [ aleksana ];
    platforms = lib.platforms.unix;
  };
})