From c2c7fdfc54220feae3ef73c37b88e81bb3b22853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= Date: Wed, 13 May 2020 22:51:07 -0300 Subject: [PATCH 01/12] enlightenment.enlightenment: format --- pkgs/desktops/enlightenment/enlightenment.nix | 37 +++++++++++++++---- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/pkgs/desktops/enlightenment/enlightenment.nix b/pkgs/desktops/enlightenment/enlightenment.nix index 8ba0dffc8a4..e8199a9a8d7 100644 --- a/pkgs/desktops/enlightenment/enlightenment.nix +++ b/pkgs/desktops/enlightenment/enlightenment.nix @@ -1,10 +1,29 @@ -{ stdenv, fetchurl, meson, ninja, pkgconfig, gettext, alsaLib, bc, - bzip2, efl, gdbm, libXdmcp, libXrandr, libcap, libffi, - libpthreadstubs, libxcb, luajit, mesa, pam, pcre, xcbutilkeysyms, - xkeyboard_config, +{ stdenv +, fetchurl +, meson +, ninja +, pkgconfig +, gettext +, alsaLib +, bc +, bzip2 +, efl +, gdbm +, libXdmcp +, libXrandr +, libcap +, libffi +, libpthreadstubs +, libxcb +, luajit +, mesa +, pam +, pcre +, xcbutilkeysyms +, xkeyboard_config - bluetoothSupport ? true, bluez5, - pulseSupport ? !stdenv.isDarwin, libpulseaudio, +, bluetoothSupport ? true, bluez5 +, pulseSupport ? !stdenv.isDarwin, libpulseaudio }: stdenv.mkDerivation rec { @@ -25,7 +44,7 @@ stdenv.mkDerivation rec { buildInputs = [ alsaLib - bc # for the Everything module calculator mode + bc # for the Everything module calculator mode bzip2 efl gdbm @@ -74,7 +93,9 @@ stdenv.mkDerivation rec { --replace "ecore_exe_pipe_run(\"bc -l\"" "ecore_exe_pipe_run(\"${bc}/bin/bc -l\"" ''; - mesonFlags = [ "-Dsystemdunitdir=lib/systemd/user" ]; + mesonFlags = [ + "-D systemdunitdir=lib/systemd/user" + ]; enableParallelBuilding = true; From 298d37efa13b2d9b85326289a75ce48785e6a3e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= Date: Thu, 14 May 2020 08:36:52 -0300 Subject: [PATCH 02/12] enlightenment.enlightenment: 0.23.1 -> 0.24.0 --- pkgs/desktops/enlightenment/enlightenment.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/desktops/enlightenment/enlightenment.nix b/pkgs/desktops/enlightenment/enlightenment.nix index e8199a9a8d7..5cd5c6e9522 100644 --- a/pkgs/desktops/enlightenment/enlightenment.nix +++ b/pkgs/desktops/enlightenment/enlightenment.nix @@ -28,11 +28,11 @@ stdenv.mkDerivation rec { pname = "enlightenment"; - version = "0.23.1"; + version = "0.24.0"; src = fetchurl { url = "http://download.enlightenment.org/rel/apps/${pname}/${pname}-${version}.tar.xz"; - sha256 = "0d1cyl07w9pvi2pf029kablazks2q9aislzl46b6fq5m1465jc75"; + sha256 = "01053hxdmyjfb6gmz1pqmw0llrgc4356np515h5vsqcn59mhvfz7"; }; nativeBuildInputs = [ From 4e7552c5fdf206f87e0ac3f4a266ff43ab2b3eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= Date: Fri, 22 May 2020 09:37:20 -0300 Subject: [PATCH 03/12] enlightenment.enlightenment: update dependence list Some dependences are not needed anymore, and there are new dependences. --- pkgs/desktops/enlightenment/enlightenment.nix | 34 +++++-------------- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/pkgs/desktops/enlightenment/enlightenment.nix b/pkgs/desktops/enlightenment/enlightenment.nix index 5cd5c6e9522..e8033e5fc79 100644 --- a/pkgs/desktops/enlightenment/enlightenment.nix +++ b/pkgs/desktops/enlightenment/enlightenment.nix @@ -5,22 +5,13 @@ , pkgconfig , gettext , alsaLib +, acpid , bc -, bzip2 +, ddcutil , efl -, gdbm -, libXdmcp -, libXrandr -, libcap -, libffi -, libpthreadstubs -, libxcb -, luajit -, mesa , pam -, pcre -, xcbutilkeysyms , xkeyboard_config +, udisks2 , bluetoothSupport ? true, bluez5 , pulseSupport ? !stdenv.isDarwin, libpulseaudio @@ -44,25 +35,16 @@ stdenv.mkDerivation rec { buildInputs = [ alsaLib + acpid # for systems with ACPI for lid events, AC/Battery plug in/out etc bc # for the Everything module calculator mode - bzip2 + ddcutil # specifically libddcutil.so.2 for backlight control efl - gdbm - libXdmcp - libXrandr - libffi - libpthreadstubs - libxcb - luajit - mesa pam - pcre - xcbutilkeysyms xkeyboard_config + udisks2 # for removable storage mounting/unmounting ] - ++ stdenv.lib.optional stdenv.isLinux libcap - ++ stdenv.lib.optional bluetoothSupport bluez5 - ++ stdenv.lib.optional pulseSupport libpulseaudio + ++ stdenv.lib.optional bluetoothSupport bluez5 # for bluetooth configuration and control + ++ stdenv.lib.optional pulseSupport libpulseaudio # for proper audio device control and redirection ; patches = [ From 140eb221b2fdde3c2cb2a137b11798f17d9a564f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= Date: Fri, 22 May 2020 15:59:58 -0300 Subject: [PATCH 04/12] enlightenment.enlightenment: no need to fix edje_cc path Upstream looks for the edje_cc binary (which is provided by efl) in the bin subdirectory of the enlightenment package prefix. If not found it is called without giving a directory (that is, it defaults to $PATH). Therefore a fix is not needed anymore. --- pkgs/desktops/enlightenment/enlightenment.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pkgs/desktops/enlightenment/enlightenment.nix b/pkgs/desktops/enlightenment/enlightenment.nix index e8033e5fc79..a8a8c08b3e0 100644 --- a/pkgs/desktops/enlightenment/enlightenment.nix +++ b/pkgs/desktops/enlightenment/enlightenment.nix @@ -65,12 +65,6 @@ stdenv.mkDerivation rec { ]; postPatch = '' - # 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\"" - substituteInPlace src/modules/everything/evry_plug_calc.c \ --replace "ecore_exe_pipe_run(\"bc -l\"" "ecore_exe_pipe_run(\"${bc}/bin/bc -l\"" ''; From 05828a59a78ace8886da39ace60b545decf8d259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= Date: Fri, 22 May 2020 16:08:07 -0300 Subject: [PATCH 05/12] enlightenment.enlightenment: provides display manager session --- pkgs/desktops/enlightenment/enlightenment.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/desktops/enlightenment/enlightenment.nix b/pkgs/desktops/enlightenment/enlightenment.nix index a8a8c08b3e0..d8d3a9cf506 100644 --- a/pkgs/desktops/enlightenment/enlightenment.nix +++ b/pkgs/desktops/enlightenment/enlightenment.nix @@ -75,6 +75,8 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; + passthru.providedSessions = [ "enlightenment" ]; + meta = with stdenv.lib; { description = "The Compositing Window Manager and Desktop Shell"; homepage = "https://www.enlightenment.org"; From 5a73d925ca0f4d3ba1f32eb2d7271f40903e10e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= Date: Fri, 22 May 2020 16:09:51 -0300 Subject: [PATCH 06/12] nixos/enlightenment: use display manager session packages --- .../services/x11/desktop-managers/enlightenment.nix | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/nixos/modules/services/x11/desktop-managers/enlightenment.nix b/nixos/modules/services/x11/desktop-managers/enlightenment.nix index 1690a7d51a8..f43dd4538cf 100644 --- a/nixos/modules/services/x11/desktop-managers/enlightenment.nix +++ b/nixos/modules/services/x11/desktop-managers/enlightenment.nix @@ -50,9 +50,10 @@ in "/share/locale" ]; - services.xserver.desktopManager.session = [ - { name = "Enlightenment"; - start = '' + services.xserver.displayManager.sessionPackages = [ pkgs.enlightenment.enlightenment ]; + + services.xserver.displayManager.sessionCommands = '' + if test "$XDG_CURRENT_DESKTOP" = "Enlightenment"; then export XDG_MENU_PREFIX=e- export GST_PLUGIN_PATH="${GST_PLUGIN_PATH}" @@ -62,10 +63,8 @@ in # Update user dirs as described in http://freedesktop.org/wiki/Software/xdg-user-dirs/ ${pkgs.xdg-user-dirs}/bin/xdg-user-dirs-update - - exec ${e.enlightenment}/bin/enlightenment_start - ''; - }]; + fi + ''; security.wrappers = (import "${e.enlightenment}/e-wrappers.nix").security.wrappers; From b1676e5a96865ea8af63e8db6eba46cc96632b08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= Date: Fri, 22 May 2020 16:43:32 -0300 Subject: [PATCH 07/12] nixos/enlightenment: no need to explicitly set XDG_MENU_PREFIX It is already set in the source code upstream. --- nixos/modules/services/x11/desktop-managers/enlightenment.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/nixos/modules/services/x11/desktop-managers/enlightenment.nix b/nixos/modules/services/x11/desktop-managers/enlightenment.nix index f43dd4538cf..3a0a8d07f48 100644 --- a/nixos/modules/services/x11/desktop-managers/enlightenment.nix +++ b/nixos/modules/services/x11/desktop-managers/enlightenment.nix @@ -54,8 +54,6 @@ in services.xserver.displayManager.sessionCommands = '' if test "$XDG_CURRENT_DESKTOP" = "Enlightenment"; then - export XDG_MENU_PREFIX=e- - export GST_PLUGIN_PATH="${GST_PLUGIN_PATH}" # make available for D-BUS user services From 9c6322258ac4bed9ef470d50d7bd9ec73939f55e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= Date: Fri, 22 May 2020 17:18:34 -0300 Subject: [PATCH 08/12] nixos/enlightenment: remove some themes and xauth - E already comes with a default icon theme - There are already the gtk default Adwaita themes for gtk2, gtk3 and icons - Remove gnome-icon-theme (from old gtk2) - Remove tango-icon-theme - Remove xauth (used by kdesu), as kdesu is not a componnent of E. If really needed it should be added in the system configuration. --- .../modules/services/x11/desktop-managers/enlightenment.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/nixos/modules/services/x11/desktop-managers/enlightenment.nix b/nixos/modules/services/x11/desktop-managers/enlightenment.nix index 3a0a8d07f48..f51a84faf15 100644 --- a/nixos/modules/services/x11/desktop-managers/enlightenment.nix +++ b/nixos/modules/services/x11/desktop-managers/enlightenment.nix @@ -35,11 +35,6 @@ in environment.systemPackages = [ e.efl e.enlightenment e.terminology e.econnman - pkgs.xorg.xauth # used by kdesu - pkgs.gtk2 # To get GTK's themes. - pkgs.tango-icon-theme - - pkgs.gnome-icon-theme pkgs.xorg.xcursorthemes ]; From 182f587c2fd62ae9c0f6750b28b66455ef9ba938 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= Date: Fri, 22 May 2020 17:29:20 -0300 Subject: [PATCH 09/12] nixos/enlightenment: add ephoto and rage --- .../services/x11/desktop-managers/enlightenment.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/nixos/modules/services/x11/desktop-managers/enlightenment.nix b/nixos/modules/services/x11/desktop-managers/enlightenment.nix index f51a84faf15..ed8381f7d8d 100644 --- a/nixos/modules/services/x11/desktop-managers/enlightenment.nix +++ b/nixos/modules/services/x11/desktop-managers/enlightenment.nix @@ -32,10 +32,14 @@ in config = mkIf cfg.enable { - environment.systemPackages = [ - e.efl e.enlightenment - e.terminology e.econnman - pkgs.xorg.xcursorthemes + environment.systemPackages = with pkgs; [ + enlightenment.econnman + enlightenment.efl + enlightenment.enlightenment + enlightenment.ephoto + enlightenment.rage + enlightenment.terminology + xorg.xcursorthemes ]; environment.pathsToLink = [ From eec1f2ac5372c9b9148368a7ee4a5c3b2b358ff7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= Date: Sat, 23 May 2020 23:34:18 -0300 Subject: [PATCH 10/12] enlightenment.enlightenment: do not explicitly enable parallel building By default enableParallelBuilding is already enabled when building with meson. --- pkgs/desktops/enlightenment/enlightenment.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/desktops/enlightenment/enlightenment.nix b/pkgs/desktops/enlightenment/enlightenment.nix index d8d3a9cf506..7eb9c66b312 100644 --- a/pkgs/desktops/enlightenment/enlightenment.nix +++ b/pkgs/desktops/enlightenment/enlightenment.nix @@ -73,8 +73,6 @@ stdenv.mkDerivation rec { "-D systemdunitdir=lib/systemd/user" ]; - enableParallelBuilding = true; - passthru.providedSessions = [ "enlightenment" ]; meta = with stdenv.lib; { From fa8bd535fc659c7d2ce5d271c5002c83659ebc0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= Date: Thu, 14 May 2020 08:37:55 -0300 Subject: [PATCH 11/12] enlightenment.enlightenment: fix setuid wrappers --- .../x11/desktop-managers/enlightenment.nix | 7 +- .../0001-wrapped-setuid-executables.patch | 114 ++++++++++++++++++ pkgs/desktops/enlightenment/enlightenment.nix | 18 +-- .../enlightenment.suid-exes.patch | 25 ---- 4 files changed, 124 insertions(+), 40 deletions(-) create mode 100644 pkgs/desktops/enlightenment/0001-wrapped-setuid-executables.patch delete mode 100644 pkgs/desktops/enlightenment/enlightenment.suid-exes.patch diff --git a/nixos/modules/services/x11/desktop-managers/enlightenment.nix b/nixos/modules/services/x11/desktop-managers/enlightenment.nix index ed8381f7d8d..3a7ab64510b 100644 --- a/nixos/modules/services/x11/desktop-managers/enlightenment.nix +++ b/nixos/modules/services/x11/desktop-managers/enlightenment.nix @@ -63,7 +63,12 @@ in fi ''; - security.wrappers = (import "${e.enlightenment}/e-wrappers.nix").security.wrappers; + # Wrappers for programs installed by enlightenment that should be setuid + security.wrappers = { + enlightenment_ckpasswd.source = "${pkgs.enlightenment.enlightenment}/lib/enlightenment/utils/enlightenment_ckpasswd"; + enlightenment_sys.source = "${pkgs.enlightenment.enlightenment}/lib/enlightenment/utils/enlightenment_sys"; + enlightenment_system.source = "${pkgs.enlightenment.enlightenment}/lib/enlightenment/utils/enlightenment_system"; + }; environment.etc."X11/xkb".source = xcfg.xkbDir; diff --git a/pkgs/desktops/enlightenment/0001-wrapped-setuid-executables.patch b/pkgs/desktops/enlightenment/0001-wrapped-setuid-executables.patch new file mode 100644 index 00000000000..55a3501ef8b --- /dev/null +++ b/pkgs/desktops/enlightenment/0001-wrapped-setuid-executables.patch @@ -0,0 +1,114 @@ +From a1e54ae0097a3b6a0dabf4639fe8bc594c4f602d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= +Date: Thu, 14 May 2020 16:36:34 -0300 +Subject: [PATCH] wrapped setuid executables + +Installing programs with root ownership and setuid/setgid permissions +in /nix/store is not allowed. They should be wrapped in the +enlightenment service module, and the wrapped ones should be used +instead. +--- + meson/meson_inst.sh | 4 ++-- + src/bin/e_auth.c | 6 ++---- + src/bin/e_fm/e_fm_main_eeze.c | 6 +++--- + src/bin/e_start_main.c | 2 +- + src/bin/e_system.c | 2 +- + 5 files changed, 9 insertions(+), 11 deletions(-) + +diff --git a/meson/meson_inst.sh b/meson/meson_inst.sh +index 321143e40..cd2399306 100755 +--- a/meson/meson_inst.sh ++++ b/meson/meson_inst.sh +@@ -1,6 +1,6 @@ + #!/bin/sh + + for x in "$@" ; do +- chown root "$DESTDIR/$x" +- chmod a=rx,u+xs "$DESTDIR/$x" ++ echo TODO: chown root "$DESTDIR/$x" ++ echo TODO: chmod a=rx,u+xs "$DESTDIR/$x" + done +diff --git a/src/bin/e_auth.c b/src/bin/e_auth.c +index 8b0aa6641..63c68c4bc 100644 +--- a/src/bin/e_auth.c ++++ b/src/bin/e_auth.c +@@ -12,8 +12,7 @@ e_auth_begin(char *passwd) + if (pwlen == 0) goto out; + + snprintf(buf, sizeof(buf), +- "%s/enlightenment/utils/enlightenment_ckpasswd pw", +- e_prefix_lib_get()); ++ "/run/wrappers/bin/enlightenment_ckpasswd pw"); + exe = ecore_exe_pipe_run(buf, ECORE_EXE_PIPE_WRITE, NULL); + if (!exe) goto out; + if (ecore_exe_send(exe, passwd, pwlen) != EINA_TRUE) goto out; +@@ -47,8 +46,7 @@ e_auth_polkit_begin(char *passwd, const char *cookie, unsigned int uid) + if (pwlen == 0) goto out; + + snprintf(buf, sizeof(buf), +- "%s/enlightenment/utils/enlightenment_ckpasswd pk", +- e_prefix_lib_get()); ++ "/run/wrappers/bin/enlightenment_ckpasswd pk"); + exe = ecore_exe_pipe_run(buf, ECORE_EXE_PIPE_WRITE, NULL); + if (!exe) goto out; + snprintf(buf, sizeof(buf), "%s %u %s", cookie, uid, passwd); +diff --git a/src/bin/e_fm/e_fm_main_eeze.c b/src/bin/e_fm/e_fm_main_eeze.c +index 9b10b3117..0f0aa5b53 100644 +--- a/src/bin/e_fm/e_fm_main_eeze.c ++++ b/src/bin/e_fm/e_fm_main_eeze.c +@@ -318,7 +318,7 @@ _e_fm_main_eeze_volume_eject(E_Volume *v) + { + char buf[PATH_MAX]; + +- snprintf(buf, sizeof(buf), "%s/enlightenment/utils/enlightenment_sys", eina_prefix_lib_get(pfx)); ++ snprintf(buf, sizeof(buf), "/run/wrappers/bin/enlightenment_sys"); + eeze_disk_mount_wrapper_set(v->disk, buf); + } + v->guard = ecore_timer_loop_add(E_FM_EJECT_TIMEOUT, (Ecore_Task_Cb)_e_fm_main_eeze_vol_eject_timeout, v); +@@ -512,7 +512,7 @@ _e_fm_main_eeze_volume_unmount(E_Volume *v) + { + char buf[PATH_MAX]; + +- snprintf(buf, sizeof(buf), "%s/enlightenment/utils/enlightenment_sys", eina_prefix_lib_get(pfx)); ++ snprintf(buf, sizeof(buf), "/run/wrappers/bin/enlightenment_sys"); + eeze_disk_mount_wrapper_set(v->disk, buf); + } + v->guard = ecore_timer_loop_add(E_FM_UNMOUNT_TIMEOUT, (Ecore_Task_Cb)_e_fm_main_eeze_vol_unmount_timeout, v); +@@ -548,7 +548,7 @@ _e_fm_main_eeze_volume_mount(E_Volume *v) + { + char buf2[PATH_MAX]; + +- snprintf(buf2, sizeof(buf2), "%s/enlightenment/utils/enlightenment_sys", eina_prefix_lib_get(pfx)); ++ snprintf(buf2, sizeof(buf2), "/run/wrappers/bin/enlightenment_sys"); + eeze_disk_mount_wrapper_set(v->disk, buf2); + } + v->guard = ecore_timer_loop_add(E_FM_MOUNT_TIMEOUT, (Ecore_Task_Cb)_e_fm_main_eeze_vol_mount_timeout, v); +diff --git a/src/bin/e_start_main.c b/src/bin/e_start_main.c +index 8534a7a8e..f0f0061a4 100644 +--- a/src/bin/e_start_main.c ++++ b/src/bin/e_start_main.c +@@ -709,7 +709,7 @@ main(int argc, char **argv) + "E_ALERT_FONT_DIR=%s/data/fonts", eina_prefix_data_get(pfx)); + putenv(buf2); + snprintf(buf3, sizeof(buf3), +- "E_ALERT_SYSTEM_BIN=%s/enlightenment/utils/enlightenment_system", eina_prefix_lib_get(pfx)); ++ "E_ALERT_SYSTEM_BIN=/run/wrappers/bin/enlightenment_system"); + putenv(buf3); + + if ((valgrind_mode || valgrind_tool) && +diff --git a/src/bin/e_system.c b/src/bin/e_system.c +index 1e7aabb64..5084933a1 100644 +--- a/src/bin/e_system.c ++++ b/src/bin/e_system.c +@@ -132,7 +132,7 @@ _system_spawn(void) + else _respawn_count = 0; + if (_respawn_count > 5) return; + snprintf(buf, sizeof(buf), +- "%s/enlightenment/utils/enlightenment_system", e_prefix_lib_get()); ++ "/run/wrappers/bin/enlightenment_system"); + _system_exe = ecore_exe_pipe_run + (buf, ECORE_EXE_NOT_LEADER | ECORE_EXE_TERM_WITH_PARENT | + ECORE_EXE_PIPE_READ | ECORE_EXE_PIPE_WRITE, NULL); +-- +2.26.2 + diff --git a/pkgs/desktops/enlightenment/enlightenment.nix b/pkgs/desktops/enlightenment/enlightenment.nix index 7eb9c66b312..833a3ba29ac 100644 --- a/pkgs/desktops/enlightenment/enlightenment.nix +++ b/pkgs/desktops/enlightenment/enlightenment.nix @@ -48,20 +48,10 @@ stdenv.mkDerivation rec { ; 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 + # 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 ]; postPatch = '' diff --git a/pkgs/desktops/enlightenment/enlightenment.suid-exes.patch b/pkgs/desktops/enlightenment/enlightenment.suid-exes.patch deleted file mode 100644 index f53f6ffa7ca..00000000000 --- a/pkgs/desktops/enlightenment/enlightenment.suid-exes.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- enlightenment-0.22.0.orig/meson/meson_inst.sh 2017-09-25 10:55:43.000000000 -0300 -+++ enlightenment-0.22.0/meson/meson_inst.sh 2017-11-15 08:31:03.336844920 -0200 -@@ -1,6 +1,19 @@ --#!/bin/sh -+#!/bin/sh -x -+ -+w="$out"/e-wrappers.nix -+ -+echo "# Wrappers for programs installed by enlightenment that should be setuid" > $w -+echo "" >> $w -+echo "{" >> $w -+echo " security.wrappers = {" >> $w - - for x in "$@" ; do -- chown root "$DESTDIR/$x" -- chmod a=rx,u+xs "$DESTDIR/$x" -+ f="$DESTDIR$x"; -+ b=$(basename "$f".orig) -+ mv -v "$f" "$f".orig -+ ln -sv /run/wrappers/bin/"$b" "$f" -+ echo " \"$b\".source = \"$f.orig\";" >> $w - done -+ -+echo " };" >> $w -+echo "}" >> $w From 7add03458e6b5be734c288a2e3f8c5a70ef81006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= Date: Mon, 25 May 2020 09:50:24 -0300 Subject: [PATCH 12/12] nixos/tests/enlightenment: fix some steps in the first time wizard --- nixos/tests/enlightenment.nix | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/nixos/tests/enlightenment.nix b/nixos/tests/enlightenment.nix index 5fa8d765dd1..0132b98b1cb 100644 --- a/nixos/tests/enlightenment.nix +++ b/nixos/tests/enlightenment.nix @@ -41,28 +41,24 @@ import ./make-test-python.nix ({ pkgs, ...} : with subtest("First time wizard"): machine.wait_for_text("Default") # Language - machine.succeed("xdotool mousemove 512 185 click 1") # Default Language machine.screenshot("wizard1") machine.succeed("xdotool mousemove 512 740 click 1") # Next + machine.screenshot("wizard2") machine.wait_for_text("English") # Keyboard (default) - machine.screenshot("wizard2") - machine.succeed("xdotool mousemove 512 740 click 1") # Next - - machine.wait_for_text("Standard") # Profile (default) machine.screenshot("wizard3") machine.succeed("xdotool mousemove 512 740 click 1") # Next - machine.wait_for_text("Title") # Sizing (default) + machine.wait_for_text("Standard") # Profile (default) machine.screenshot("wizard4") machine.succeed("xdotool mousemove 512 740 click 1") # Next - machine.wait_for_text("clicked") # Windows Phocus - machine.succeed("xdotool mousemove 512 370 click 1") # Click + machine.wait_for_text("Title") # Sizing (default) machine.screenshot("wizard5") machine.succeed("xdotool mousemove 512 740 click 1") # Next - machine.wait_for_text("bindings") # Mouse Modifiers (default) + machine.wait_for_text("clicked") # Windows Focus + machine.succeed("xdotool mousemove 512 370 click 1") # Click machine.screenshot("wizard6") machine.succeed("xdotool mousemove 512 740 click 1") # Next @@ -74,7 +70,7 @@ import ./make-test-python.nix ({ pkgs, ...} : machine.screenshot("wizard8") machine.succeed("xdotool mousemove 512 740 click 1") # Next - machine.wait_for_text("Compositing") # Compositing (default) + machine.wait_for_text("OpenGL") # Compositing (default) machine.screenshot("wizard9") machine.succeed("xdotool mousemove 512 740 click 1") # Next