about summary refs log tree commit diff
path: root/pkgs/by-name/li/librum/package.nix
blob: 928bc7e0439c05b7cc48a120827598ff92c00bcc (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
{ lib
, mupdf
, stdenv
, fetchFromGitHub
, substituteAll
, cmake
, qt6
, desktopToDarwinBundle
}:

let
  mupdf-cxx = mupdf.override { enableCxx = true; };
in
stdenv.mkDerivation rec {
  pname = "librum";
  version = "0.12.2";

  src = fetchFromGitHub {
    owner = "Librum-Reader";
    repo = "Librum";
    rev = "v.${version}";
    fetchSubmodules = true;
    hash = "sha256-Iwcbcz8LrznFP8rfW6mg9p7klAtTx4daFxylTeFKrH0=";
  };

  patches = [
    (substituteAll {
      src = ./use_mupdf_in_nixpkgs.patch;
      nixMupdfLibPath = "${mupdf-cxx.out}/lib";
      nixMupdfIncludePath = "${mupdf-cxx.dev}/include";
    })
  ];

  nativeBuildInputs = [
    cmake
    qt6.qttools
    qt6.wrapQtAppsHook
  ] ++ lib.optionals stdenv.isDarwin [
    desktopToDarwinBundle
  ];

  buildInputs = [
    qt6.qtbase
    qt6.qtsvg
  ] ++ lib.optionals stdenv.isLinux [
    qt6.qtwayland
  ];

  meta = with lib; {
    description = "An application designed to make reading enjoyable and straightforward";
    longDescription = ''
      Librum is an application designed to make reading enjoyable
      and straightforward for everyone. It's not just an e-book
      reader. With Librum, you can manage your own online library
      and access it from any device anytime, anywhere. It has
      features like note-taking, AI tooling, and highlighting,
      while offering customization to make it as personal as you
      want! Librum also provides free access to over 70,000 books
      and personal reading statistics while being free and
      completely open source.
    '';
    homepage = "https://librumreader.com";
    license = licenses.gpl3Plus;
    mainProgram = "librum";
    maintainers = with maintainers; [ aleksana oluceps ];
    platforms = platforms.unix;
  };
}