about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/misc/sticky/default.nix
blob: 9e9df71ddf9ac83a5b8fe6bdb6922852575a24e2 (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
79
80
81
82
83
84
85
86
87
{ stdenv
, lib
, fetchFromGitHub
, gobject-introspection
, meson
, ninja
, python3
, wrapGAppsHook
, cinnamon
, glib
, gspell
, gtk3
, gitUpdater
}:

stdenv.mkDerivation rec {
  pname = "sticky";
  version = "1.19";

  src = fetchFromGitHub {
    owner = "linuxmint";
    repo = pname;
    rev = version;
    hash = "sha256-nvnft62vZ9ivijYnQGULW7ff2aAVJiIx9xq09My2NxE=";
  };

  postPatch = ''
    sed -i -e "s|/usr/bin|$out/bin|" data/org.x.sticky.service
    sed -i -e "s|/usr/lib|$out/lib|" usr/bin/sticky
    sed -i -e "s|/usr/share|$out/share|" usr/lib/sticky/*.py
  '';

  nativeBuildInputs = [
    gobject-introspection
    meson
    ninja
    python3.pkgs.wrapPython
    wrapGAppsHook
  ];

  buildInputs = [
    cinnamon.xapp
    glib
    gspell
    gtk3
    python3 # for patchShebangs
  ];

  pythonPath = with python3.pkgs; [
    pygobject3
    xapp
  ];

  postInstall = ''
    # https://github.com/linuxmint/sticky/pull/118
    cp -r ../etc $out
    cp -r ../usr/* $out

    glib-compile-schemas $out/share/glib-2.0/schemas
  '';

  dontWrapGApps = true;

  preFixup = ''
    buildPythonPath "$out $pythonPath"

    chmod +x $out/bin/sticky
    wrapProgram $out/bin/sticky \
      --prefix PYTHONPATH : "$program_PYTHONPATH" \
      ''${gappsWrapperArgs[@]}
  '';

  passthru = {
    updateScript = gitUpdater {
      ignoredVersions = ''master.*'';
    };
  };

  meta = with lib; {
    description = "A sticky notes app for the linux desktop";
    mainProgram = "sticky";
    homepage = "https://github.com/linuxmint/sticky";
    license = licenses.gpl2Only;
    platforms = platforms.linux;
    maintainers = with maintainers; [ linsui bobby285271 ];
  };
}