about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/networking/instant-messengers/tangram/default.nix
blob: e7ca8c320ac60436f0ef5933a25dd4cad8fc2f4f (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
{ stdenv, lib, fetchFromGitHub, appstream-glib, desktop-file-utils, gdk-pixbuf
, gettext, gjs, glib, gobject-introspection, gsettings-desktop-schemas, gtk3
, hicolor-icon-theme, meson, ninja, pkg-config, python3, webkitgtk, wrapGAppsHook
}:

stdenv.mkDerivation rec {
  pname = "tangram";
  version = "1.3.1";

  src = fetchFromGitHub {
    owner = "sonnyp";
    repo = "Tangram";
    rev = "v${version}";
    sha256 = "0bhs9s6c2k06i3cx01h2102lgl7g6vxm3k63jkkhh2bwdpc9kvn3";
    fetchSubmodules = true;
  };

  buildInputs = [ gdk-pixbuf gjs glib gsettings-desktop-schemas gtk3 webkitgtk ];

  nativeBuildInputs = [
    appstream-glib
    desktop-file-utils
    gettext
    gobject-introspection
    hicolor-icon-theme
    meson
    ninja
    pkg-config
    python3
    wrapGAppsHook
  ];

  dontWrapGApps = true;

  # Fixes https://github.com/NixOS/nixpkgs/issues/31168
  postPatch = ''
    chmod +x build-aux/meson/postinstall.py
    patchShebangs build-aux/meson/postinstall.py
  '';

  postFixup = ''
    for file in $out/bin/re.sonny.Tangram; do
      sed -e $"2iimports.package._findEffectiveEntryPointName = () => \'$(basename $file)\' " \
         -i $file
      wrapGApp "$file"
     done
  '';

  meta = with lib; {
    description = "Run web apps on your desktop";
    homepage = "https://github.com/sonnyp/Tangram";
    license = licenses.gpl3Only;
    platforms = platforms.linux;
    maintainers = with maintainers; [ austinbutler ];
  };
}