summary refs log tree commit diff
path: root/pkgs/applications/office/foliate/default.nix
blob: a2d0d73f79034641435fe3824354e9c4abcd9bac (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
{ stdenv, lib, fetchFromGitHub, meson, gettext, glib, gjs, ninja, python3, gtk3
, webkitgtk, gsettings-desktop-schemas, wrapGAppsHook, desktop-file-utils
, gobject-introspection, glib-networking }:

stdenv.mkDerivation rec {
  pname = "foliate";
  version = "2.6.4";

  src = fetchFromGitHub {
    owner = "johnfactotum";
    repo = pname;
    rev = version;
    sha256 = "sha256-Pr2YA2MHXD4W7lyCxGAVLKyoZarZ8t92RSkWle3LNuc=";
  };

  nativeBuildInputs = [ meson ninja python3 wrapGAppsHook ];

  postPatch = ''
    patchShebangs build-aux/meson/postinstall.py
  '';

  postFixup = ''
    sed -i "1 a imports.package._findEffectiveEntryPointName = () => 'com.github.johnfactotum.Foliate';" $out/bin/.com.github.johnfactotum.Foliate-wrapped
    ln -s $out/bin/com.github.johnfactotum.Foliate $out/bin/foliate
  '';

  buildInputs = [
    gettext
    glib
    glib-networking
    gjs
    gtk3
    webkitgtk
    desktop-file-utils
    gobject-introspection
    gsettings-desktop-schemas
  ];

  meta = with lib; {
    description = "A simple and modern GTK eBook reader";
    homepage = "https://johnfactotum.github.io/foliate/";
    license = licenses.gpl3Only;
    maintainers = with maintainers; [ onny ];
  };
}