about summary refs log tree commit diff
path: root/pkgs/applications/terminal-emulators/guake/default.nix
blob: 239d9a2fe04869ff0a537040be05d0836efb8c18 (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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
{ lib
, fetchFromGitHub
, fetchpatch
, python3
, glibcLocales
, gobject-introspection
, wrapGAppsHook3
, gtk3
, keybinder3
, libnotify
, libutempter
, vte
, libwnck
, dconf
, nixosTests
}:

python3.pkgs.buildPythonApplication rec {
  pname = "guake";
  version = "3.10";

  pyproject = false;

  src = fetchFromGitHub {
    owner = "Guake";
    repo = "guake";
    rev = "refs/tags/${version}";
    hash = "sha256-e6Bf4HDftHBxFPcw9z02CqgZhSIvt6wlLF6dnIh9fEc=";
  };

  patches = [
    # Avoid trying to recompile schema at runtime,
    # the package should be responsible for ensuring it is up to date.
    # Without this, the package will try to run glib-compile-schemas
    # on every update, which is pointless and will crash
    # unless user has it installed.
    ./no-compile-schemas.patch

    # Avoid using pip since it fails on not being able to find setuptools.
    # Note: This is not a long-term solution, setup.py is deprecated.
    (fetchpatch {
      url = "https://github.com/Guake/guake/commit/14abaa0c69cfab64fe3467fbbea211d830042de8.patch";
      hash = "sha256-RjGRFJDTQX2meAaw3UZi/3OxAtIHbRZVpXTbcJk/scY= ";
      revert = true;
    })

    # Revert switch to FHS.
    (fetchpatch {
      url = "https://github.com/Guake/guake/commit/8c7a23ba62ee262c033dfa5b0b18d3df71361ff4.patch";
      hash = "sha256-0asXI08XITkFc73EUenV9qxY/Eak+TzygRRK7GvhQUc=";
      revert = true;
    })
  ];

  nativeBuildInputs = [
    gobject-introspection
    wrapGAppsHook3
    python3.pkgs.pip
  ];

  buildInputs = [
    glibcLocales
    gtk3
    keybinder3
    libnotify
    libwnck
    python3
    vte
  ];

  makeWrapperArgs = [ "--set LOCALE_ARCHIVE ${glibcLocales}/lib/locale/locale-archive" ];

  propagatedBuildInputs = with python3.pkgs; [
    dbus-python
    pycairo
    pygobject3
    setuptools-scm
    pyyaml
  ];

  makeFlags = [
    "PREFIX=${placeholder "out"}"
  ];

  preFixup = ''
    gappsWrapperArgs+=(
      --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libutempter ]}"
      # For settings migration.
      --prefix PATH : "${lib.makeBinPath [ dconf ]}"
    )
  '';

  passthru.tests.test = nixosTests.terminal-emulators.guake;

  meta = with lib; {
    description = "Drop-down terminal for GNOME";
    homepage = "http://guake-project.org";
    license = licenses.gpl2Plus;
    maintainers = [ maintainers.msteen ];
    platforms = platforms.linux;
  };
}