summary refs log tree commit diff
path: root/pkgs/desktops/enlightenment/enlightenment.nix
blob: 753b939bd486a6f991d01840de68456c54e94c30 (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
{ stdenv, fetchurl, pkgconfig, efl, xcbutilkeysyms, libXrandr, libXdmcp,
libxcb, libffi, pam, alsaLib, luajit, bzip2, libpthreadstubs, gdbm, libcap,
mesa_glu , xkeyboard_config }:

stdenv.mkDerivation rec {
  name = "enlightenment-${version}";
  version = "0.21.5";

  src = fetchurl {
    url = "http://download.enlightenment.org/rel/apps/enlightenment/${name}.tar.xz";
    sha256 = "1fslq70z4s6v9ipahnk8s5fgqnqq4njv4rlqv951r1bh1xk5lx7h";
  };

  nativeBuildInputs = [ pkgconfig ];

  buildInputs = [
    efl libXdmcp libxcb xcbutilkeysyms libXrandr libffi pam alsaLib
    luajit bzip2 libpthreadstubs gdbm
  ] ++
    stdenv.lib.optionals stdenv.isLinux [ libcap ];

  NIX_CFLAGS_COMPILE = [
    "-I${efl}/include/ecore-imf-1"
    "-I${efl}/include/emile-1"
    "-I${efl}/include/eo-1"
    "-I${efl}/include/ethumb-1"
    "-I${efl}/include/ethumb-client-1"
  ];

  preConfigure = ''
    export USER_SESSION_DIR=$prefix/lib/systemd/user

    substituteInPlace src/modules/xkbswitch/e_mod_parse.c \
      --replace "/usr/share/X11/xkb/rules/xorg.lst" "${xkeyboard_config}/share/X11/xkb/rules/base.lst"

    substituteInPlace "src/bin/e_import_config_dialog.c" \
      --replace "e_prefix_bin_get()" "\"${efl}/bin\""
  '';

  enableParallelBuilding = true;

  # this is a hack and without this cpufreq module is not working. does the following:
  #   1. moves the "freqset" binary to "e_freqset",
  #   2. linkes "e_freqset" to enlightenment/bin so that,
  #   3. permissionsWrappers.setuid detects it and places wrappers in /var/permissions-wrappers/e_freqset,
  #   4. and finally, links /var/permissions-wrappers/e_freqset to original destination where enlightenment wants it
  postInstall = ''
    export CPUFREQ_DIRPATH=`readlink -f $out/lib/enlightenment/modules/cpufreq/linux-gnu-*`;
    mv $CPUFREQ_DIRPATH/freqset $CPUFREQ_DIRPATH/e_freqset
    ln -sv $CPUFREQ_DIRPATH/e_freqset $out/bin/e_freqset
    ln -sv /var/permissions-wrappers/e_freqset $CPUFREQ_DIRPATH/freqset
  '';

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