diff options
Diffstat (limited to 'pkgs/desktops')
-rw-r--r-- | pkgs/desktops/enlightenment/enlightenment.nix | 41 | ||||
-rw-r--r-- | pkgs/desktops/maxx/default.nix | 29 |
2 files changed, 48 insertions, 22 deletions
diff --git a/pkgs/desktops/enlightenment/enlightenment.nix b/pkgs/desktops/enlightenment/enlightenment.nix index b0fd5f3db2b2..dc538625bf09 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" ]; diff --git a/pkgs/desktops/maxx/default.nix b/pkgs/desktops/maxx/default.nix index 69d16c9b20a1..10fa745d9787 100644 --- a/pkgs/desktops/maxx/default.nix +++ b/pkgs/desktops/maxx/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchurl, makeWrapper, libredirect, gcc-unwrapped, bash, gtk-engine-murrine, gtk_engines, librsvg +{ stdenv, fetchurl, makeWrapper, autoPatchelfHook +, libredirect, gcc-unwrapped, bash, gtk-engine-murrine, gtk_engines, librsvg , libX11, libXext, libXi, libXau, libXrender, libXft, libXmu, libSM, libXcomposite, libXfixes, libXpm , libXinerama, libXdamage, libICE, libXtst, libXaw, fontconfig, pango, cairo, glib, libxml2, atk, gtk2 @@ -9,11 +10,6 @@ let version = "Indy-1.1.0"; - deps = [ - stdenv.cc.cc libX11 libXext libXi libXau libXrender libXft libXmu libSM libXcomposite libXfixes libXpm - libXinerama libXdamage libICE libXtst libXaw fontconfig pango cairo glib libxml2 atk gtk2 - gdk_pixbuf libGL ncurses - ]; runtime_deps = [ xclock xsettingsd ]; @@ -31,7 +27,12 @@ in stdenv.mkDerivation { }) ]; - nativeBuildInputs = [ makeWrapper ]; + nativeBuildInputs = [ makeWrapper autoPatchelfHook ]; + buildInputs = [ + stdenv.cc.cc libX11 libXext libXi libXau libXrender libXft libXmu libSM libXcomposite libXfixes libXpm + libXinerama libXdamage libICE libXtst libXaw fontconfig pango cairo glib libxml2 atk gtk2 + gdk_pixbuf libGL ncurses + ]; buildPhase = '' while IFS= read -r -d ''$'\0' i; do @@ -58,15 +59,11 @@ in stdenv.mkDerivation { --prefix PATH : ${stdenv.lib.makeBinPath runtime_deps} while IFS= read -r -d ''$'\0' i; do - if isELF "$i"; then - bin=`patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$i"; echo $?` - patchelf --set-rpath "$maxx/lib64:$maxx/OpenMotif-2.1.32/lib64:$maxx/OpenMotif-2.3.1/lib64:${stdenv.lib.makeLibraryPath deps}" "$i" - if [ "$bin" -eq 0 ]; then - wrapProgram "$i" \ - --set LD_PRELOAD "${libredirect}/lib/libredirect.so" \ - --set NIX_REDIRECTS /opt/MaXX=$maxx \ - --prefix PATH : $maxx/sbin - fi + if isExecutable "$i"; then + wrapProgram "$i" \ + --set LD_PRELOAD "${libredirect}/lib/libredirect.so" \ + --set NIX_REDIRECTS /opt/MaXX=$maxx \ + --prefix PATH : $maxx/sbin fi done < <(find "$maxx" -type f -print0) |