summary refs log tree commit diff
path: root/pkgs/desktops/enlightenment/enlightenment.nix
diff options
context:
space:
mode:
authorJosé Romildo Malaquias <malaquias@gmail.com>2018-05-18 12:28:16 -0300
committerxeji <36407913+xeji@users.noreply.github.com>2018-05-18 17:28:16 +0200
commite8b8ba148e6966b367e293d85b0b2bb15a02e472 (patch)
treeab2168b11f4400780f192842d1e37d6a8cbf3069 /pkgs/desktops/enlightenment/enlightenment.nix
parente80957d5163932c9cc46bfd8b20878a3a0e9a136 (diff)
downloadnixpkgs-e8b8ba148e6966b367e293d85b0b2bb15a02e472.tar
nixpkgs-e8b8ba148e6966b367e293d85b0b2bb15a02e472.tar.gz
nixpkgs-e8b8ba148e6966b367e293d85b0b2bb15a02e472.tar.bz2
nixpkgs-e8b8ba148e6966b367e293d85b0b2bb15a02e472.tar.lz
nixpkgs-e8b8ba148e6966b367e293d85b0b2bb15a02e472.tar.xz
nixpkgs-e8b8ba148e6966b367e293d85b0b2bb15a02e472.tar.zst
nixpkgs-e8b8ba148e6966b367e293d85b0b2bb15a02e472.zip
enlightenment: add xkeyboard-config dependency (#40690)
- Add runtime dependence on xkeyboard-config

- Add base.lst from xkeyboard-config to the list of keyboard layout
files. Something similar to this has been removed in a previous patch
by mistake.

- Fix location of binary edge_cc. This has been removed in a previous
patch by mastake.

- Make the explanation for the wrapping of some binaries more clear.
Diffstat (limited to 'pkgs/desktops/enlightenment/enlightenment.nix')
-rw-r--r--pkgs/desktops/enlightenment/enlightenment.nix41
1 files changed, 35 insertions, 6 deletions
diff --git a/pkgs/desktops/enlightenment/enlightenment.nix b/pkgs/desktops/enlightenment/enlightenment.nix
index b0fd5f3db2b..dc538625bf0 100644
--- a/pkgs/desktops/enlightenment/enlightenment.nix
+++ b/pkgs/desktops/enlightenment/enlightenment.nix
@@ -35,15 +35,44 @@ stdenv.mkDerivation rec {
     gdbm
     pcre
     mesa_noglu
+    xkeyboard_config
   ] ++
     stdenv.lib.optionals stdenv.isLinux [ libcap ];
 
-  # Instead of setting owner to root and permissions to setuid/setgid
-  # (which is not allowed for files in /nix/store) of some
-  # enlightenment programs, the file $out/e-wrappers.nix is created,
-  # containing the needed configuration for that purpose. It can be
-  # used in the enlightenment module.
-  patches = [ ./enlightenment.suid-exes.patch ];
+  patches = [
+    # Some programs installed by enlightenment (to set the cpu frequency,
+    # for instance) need root ownership and setuid/setgid permissions, which
+    # are not allowed for files in /nix/store. Instead of allowing the
+    # installer to try to do this, the file $out/e-wrappers.nix is created,
+    # containing the needed configuration for wrapping those programs. It
+    # can be used in the enlightenment module. The idea is:
+    # 
+    #  1) rename the original binary adding the extension .orig
+    #  2) wrap the renamed binary at /run/wrappers/bin/
+    #  3) create a new symbolic link using the original binary name (in the
+    #     original directory where enlightenment wants it) pointing to the
+    #     wrapper
+
+    ./enlightenment.suid-exes.patch
+  ];
+
+  postPatch = ''
+    # In order to get the available keyboard layouts Enlightenment looks for
+    # the file xorg.lst, that should be provided by xkeyboard-config (when
+    # configured with option --with-xkb-rules-symlink=xorg). Currently
+    # xkeyboard-config is not configured with this option in
+    # NixOS. Therefore it is needed to add base.lst (which xorg.lst would be
+    # a symbolic link to) explicitly as an alternative.
+
+    sed "/#ifdef XKB_BASE/a XKB_BASE \"\/rules\/base.lst\"," \
+      -i src/modules/wizard/page_011.c src/modules/xkbswitch/e_mod_parse.c
+
+    # edge_cc is a binary provided by efl and cannot be found at the directory
+    # given by e_prefix_bin_get(), which is $out/bin
+
+    substituteInPlace src/bin/e_import_config_dialog.c \
+      --replace "e_prefix_bin_get()" "\"${efl}/bin\""
+  '';
 
   mesonFlags = [ "-Dsystemdunitdir=lib/systemd/user" ];