summary refs log tree commit diff
path: root/pkgs/desktops/enlightenment/enlightenment/default.nix
blob: 76beac1392d804d3244d934806dfb145ca8c4463 (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
{ lib, stdenv
, fetchurl
, meson
, ninja
, pkg-config
, gettext
, alsa-lib
, acpid
, bc
, ddcutil
, efl
, pam
, xkeyboard_config
, udisks2

, waylandSupport ? false, wayland-protocols, xwayland
, bluetoothSupport ? true, bluez5
, pulseSupport ? !stdenv.isDarwin, libpulseaudio
}:

stdenv.mkDerivation rec {
  pname = "enlightenment";
  version = "0.24.2";

  src = fetchurl {
    url = "http://download.enlightenment.org/rel/apps/${pname}/${pname}-${version}.tar.xz";
    sha256 = "1wfz0rwwsx7c1mkswn4hc9xw1i6bsdirhxiycf7ha2vcipqy465y";
  };

  nativeBuildInputs = [
    gettext
    meson
    ninja
    pkg-config
  ];

  buildInputs = [
    alsa-lib
    acpid # for systems with ACPI for lid events, AC/Battery plug in/out etc
    bc # for the Everything module calculator mode
    ddcutil # specifically libddcutil.so.2 for backlight control
    efl
    pam
    xkeyboard_config
    udisks2 # for removable storage mounting/unmounting
  ]
  ++ lib.optional bluetoothSupport bluez5 # for bluetooth configuration and control
  ++ lib.optional pulseSupport libpulseaudio # for proper audio device control and redirection
  ++ lib.optionals waylandSupport [ wayland-protocols xwayland ]
  ;

  patches = [
    # Executables cannot be made setuid in nix store. They should be
    # wrapped in the enlightenment service module, and the wrapped
    # executables should be used instead.
    ./0001-wrapped-setuid-executables.patch
    ./0003-setuid-missing-path.patch
  ];

  postPatch = ''
    substituteInPlace src/modules/everything/evry_plug_calc.c \
      --replace "ecore_exe_pipe_run(\"bc -l\"" "ecore_exe_pipe_run(\"${bc}/bin/bc -l\""
  '';

  mesonFlags = [
    "-D systemdunitdir=lib/systemd/user"
  ] ++ lib.optional waylandSupport "-Dwl=true";

  passthru.providedSessions = [ "enlightenment" ];

  meta = with lib; {
    description = "The Compositing Window Manager and Desktop Shell";
    homepage = "https://www.enlightenment.org";
    license = licenses.bsd2;
    platforms = platforms.linux;
    maintainers = with maintainers; [ matejc tstrobel ftrvxmtrx romildo ];
  };
}