From 1613d6cca6a6d550883dbef10c3c94f6b72b3baf Mon Sep 17 00:00:00 2001 From: Thomas Strobel Date: Mon, 15 Sep 2014 21:54:02 +0200 Subject: [PATCH] Add package: Enlightenment E19! Wayland desktop shell is not enabled, yet. --- .../services/x11/desktop-managers/default.nix | 2 +- .../services/x11/desktop-managers/e19.nix | 94 +++++++++++++++++++ pkgs/desktops/e19/default.nix | 26 +++++ pkgs/desktops/e19/econnman.nix | 23 +++++ pkgs/desktops/e19/efl-setup-hook.sh | 8 ++ pkgs/desktops/e19/efl.nix | 33 +++++++ pkgs/desktops/e19/elementary.nix | 20 ++++ pkgs/desktops/e19/emotion.nix | 20 ++++ pkgs/desktops/e19/enlightenment.nix | 38 ++++++++ pkgs/desktops/e19/evas.nix | 17 ++++ pkgs/desktops/e19/terminology.nix | 23 +++++ pkgs/top-level/all-packages.nix | 5 + pkgs/top-level/python-packages.nix | 20 ++++ 13 files changed, 328 insertions(+), 1 deletion(-) create mode 100644 nixos/modules/services/x11/desktop-managers/e19.nix create mode 100644 pkgs/desktops/e19/default.nix create mode 100644 pkgs/desktops/e19/econnman.nix create mode 100755 pkgs/desktops/e19/efl-setup-hook.sh create mode 100644 pkgs/desktops/e19/efl.nix create mode 100644 pkgs/desktops/e19/elementary.nix create mode 100644 pkgs/desktops/e19/emotion.nix create mode 100644 pkgs/desktops/e19/enlightenment.nix create mode 100644 pkgs/desktops/e19/evas.nix create mode 100644 pkgs/desktops/e19/terminology.nix diff --git a/nixos/modules/services/x11/desktop-managers/default.nix b/nixos/modules/services/x11/desktop-managers/default.nix index c62beca60d84..ebdb2ad06491 100644 --- a/nixos/modules/services/x11/desktop-managers/default.nix +++ b/nixos/modules/services/x11/desktop-managers/default.nix @@ -19,7 +19,7 @@ in # E.g., if KDE is enabled, it supersedes xterm. imports = [ ./none.nix ./xterm.nix ./xfce.nix ./kde4.nix - ./e17.nix ./e18.nix ./gnome3.nix ./xbmc.nix + ./e17.nix ./e18.nix ./e19.nix ./gnome3.nix ./xbmc.nix ]; options = { diff --git a/nixos/modules/services/x11/desktop-managers/e19.nix b/nixos/modules/services/x11/desktop-managers/e19.nix new file mode 100644 index 000000000000..dd9becb0f6ca --- /dev/null +++ b/nixos/modules/services/x11/desktop-managers/e19.nix @@ -0,0 +1,94 @@ +{ config, pkgs, lib, ... }: + +with lib; + +let + + xcfg = config.services.xserver; + cfg = xcfg.desktopManager.e19; + e19_enlightenment = pkgs.e19.enlightenment.override { set_freqset_setuid = true; }; + +in + +{ + options = { + + services.xserver.desktopManager.e19.enable = mkOption { + default = false; + example = true; + description = "Enable the E19 desktop environment."; + }; + + }; + + config = mkIf (xcfg.enable && cfg.enable) { + + environment.systemPackages = [ + pkgs.e19.efl pkgs.e19.evas pkgs.e19.emotion pkgs.e19.elementary e19_enlightenment + pkgs.e19.terminology pkgs.e19.econnman + pkgs.xorg.xauth # used by kdesu + pkgs.gtk # To get GTK+'s themes. + pkgs.tango-icon-theme + pkgs.shared_mime_info + pkgs.gnome.gnomeicontheme + pkgs.xorg.xcursorthemes + ]; + + environment.pathsToLink = [ "/etc/enlightenment" "/etc/xdg" "/share/enlightenment" "/share/elementary" "/share/applications" "/share/locale" "/share/icons" "/share/themes" "/share/mime" "/share/desktop-directories" ]; + + services.xserver.desktopManager.session = [ + { name = "E19"; + start = '' + # Set GTK_DATA_PREFIX so that GTK+ can find the themes + export GTK_DATA_PREFIX=${config.system.path} + # find theme engines + export GTK_PATH=${config.system.path}/lib/gtk-3.0:${config.system.path}/lib/gtk-2.0 + export XDG_MENU_PREFIX=enlightenment + + # make available for D-BUS user services + #export XDG_DATA_DIRS=$XDG_DATA_DIRS''${XDG_DATA_DIRS:+:}:${config.system.path}/share:${pkgs.e19.efl}/share + + # Update user dirs as described in http://freedesktop.org/wiki/Software/xdg-user-dirs/ + ${pkgs.xdg-user-dirs}/bin/xdg-user-dirs-update + + ${e19_enlightenment}/bin/enlightenment_start + waitPID=$! + ''; + }]; + + security.setuidPrograms = [ "e19_freqset" ]; + + environment.etc = singleton + { source = "${pkgs.xkeyboard_config}/etc/X11/xkb"; + target = "X11/xkb"; + }; + + fonts.fonts = [ pkgs.dejavu_fonts pkgs.ubuntu_font_family ]; + + services.udisks2.enable = true; + services.upower.enable = config.powerManagement.enable; + + #services.dbus.packages = [ pkgs.efl ]; # dbus-1 folder is not in /etc but in /share, so needs fixing first + + systemd.user.services.efreet = + { enable = true; + description = "org.enlightenment.Efreet"; + serviceConfig = + { ExecStart = "${pkgs.e19.efl}/bin/efreetd"; + StandardOutput = "null"; + }; + }; + + systemd.user.services.ethumb = + { enable = true; + description = "org.enlightenment.Ethumb"; + serviceConfig = + { ExecStart = "${pkgs.e19.efl}/bin/ethumbd"; + StandardOutput = "null"; + }; + }; + + + }; + +} diff --git a/pkgs/desktops/e19/default.nix b/pkgs/desktops/e19/default.nix new file mode 100644 index 000000000000..5740337a11a1 --- /dev/null +++ b/pkgs/desktops/e19/default.nix @@ -0,0 +1,26 @@ +{ callPackage, pkgs }: +let + openjpeg_1 = with pkgs; lib.overrideDerivation openjpeg (oldAttrs: { + name = "openjpeg-1.5.1"; + src = fetchurl { + url = "http://openjpeg.googlecode.com/files/openjpeg-1.5.1.tar.gz"; + sha1 = "1b0b74d1af4c297fd82806a9325bb544caf9bb8b"; + }; + #passthru = { incDir = "openjpeg-1.5.1"; }; + }); +in +rec { + #### CORE EFL + efl = callPackage ./efl.nix { openjpeg=openjpeg_1; }; + evas = callPackage ./evas.nix { }; + emotion = callPackage ./emotion.nix { }; + elementary = callPackage ./elementary.nix { }; + + #### WINDOW MANAGER + enlightenment = callPackage ./enlightenment.nix { }; + + #### APPLICATIONS + econnman = callPackage ./econnman.nix { }; + terminology = callPackage ./terminology.nix { }; + +} diff --git a/pkgs/desktops/e19/econnman.nix b/pkgs/desktops/e19/econnman.nix new file mode 100644 index 000000000000..1e42895b4e22 --- /dev/null +++ b/pkgs/desktops/e19/econnman.nix @@ -0,0 +1,23 @@ +{ stdenv, fetchurl, pkgconfig, e19, python27, python27Packages, dbus, makeWrapper }: +stdenv.mkDerivation rec { + name = "econnman-${version}"; + version = "1.1"; + src = fetchurl { + url = "http://download.enlightenment.org/rel/apps/econnman/${name}.tar.gz"; + sha256 = "057pwwavlvrrq26bncqnfrf449zzaim0zq717xv86av4n940gwv0"; + }; + + buildInputs = [ makeWrapper pkgconfig e19.efl python27 dbus ]; + propagatedBuildInputs = [ python27Packages.pythonefl_1_11 python27Packages.dbus e19.elementary ]; + postInstall = '' + wrapProgram $out/bin/econnman-bin --prefix PYTHONPATH : ${python27Packages.dbus}/lib/python2.7/site-packages:${python27Packages.pythonefl_1_11}/lib/python2.7/site-packages + ''; + + meta = { + description = "Econnman is a user interface for the connman network connection manager"; + homepage = http://enlightenment.org/; + maintainers = [ stdenv.lib.maintainers.matejc ]; + platforms = stdenv.lib.platforms.linux; + license = stdenv.lib.licenses.lgpl3; + }; +} diff --git a/pkgs/desktops/e19/efl-setup-hook.sh b/pkgs/desktops/e19/efl-setup-hook.sh new file mode 100755 index 000000000000..d98f24b4c04b --- /dev/null +++ b/pkgs/desktops/e19/efl-setup-hook.sh @@ -0,0 +1,8 @@ +addDbusIncludePath () { + if test -d "$1/include/dbus-1.0" + then + export NIX_CFLAGS_COMPILE="${NIX_CFLAGS_COMPILE} -I$1/include/dbus-1.0 -I $1/lib/dbus-1.0/include" + fi +} + +envHooks=(${envHooks[@]} addDbusIncludePath) diff --git a/pkgs/desktops/e19/efl.nix b/pkgs/desktops/e19/efl.nix new file mode 100644 index 000000000000..2252bc919919 --- /dev/null +++ b/pkgs/desktops/e19/efl.nix @@ -0,0 +1,33 @@ +{ stdenv, fetchurl, pkgconfig, openssl, libjpeg, zlib, freetype, fontconfig, fribidi, SDL2, SDL, mesa, giflib, libpng, libtiff, glib, gst_all_1, pulseaudio, libsndfile, xlibs, wayland, libdrm, libxkbcommon, udev, utillinuxCurses, dbus, bullet, luajit, python27Packages, openjpeg, doxygen, expat, lua5_2, harfbuzz, jbig2dec, librsvg, dbus_libs, alsaLib, poppler, libraw, libspectre, xineLib, vlc, libwebp, curl }: + + +stdenv.mkDerivation rec { + name = "efl-${version}"; + version = "1.11.2"; + src = fetchurl { + url = "http://download.enlightenment.org/rel/libs/efl/${name}.tar.gz"; + sha256 = "123jrcifd7i0r9zh8qllqiz3d378fyy7fzkanyki9wbxlz91rk7k"; + }; + + buildInputs = [ pkgconfig openssl zlib freetype fontconfig fribidi SDL2 SDL mesa giflib libpng libtiff glib gst_all_1.gstreamer gst_all_1.gst-plugins-base gst_all_1.gst-libav pulseaudio libsndfile xlibs.libXcursor xlibs.printproto xlibs.libX11 libdrm udev utillinuxCurses luajit ]; + + propagatedBuildInputs = [ wayland libxkbcommon python27Packages.dbus dbus libjpeg xlibs.libXcomposite xlibs.libXdamage xlibs.libXinerama xlibs.libXp xlibs.libXtst xlibs.libXi xlibs.libXext bullet xlibs.libXScrnSaver ] ++ [ xlibs.libXrender xlibs.libXfixes xlibs.libXrandr xlibs.libxkbfile xlibs.libxcb xlibs.xcbutilkeysyms openjpeg doxygen expat lua5_2 harfbuzz jbig2dec librsvg dbus_libs alsaLib poppler libraw libspectre xineLib vlc libwebp curl ]; + + configureFlags = [ "--with-tests=none" "--enable-sdl" "--enable-drm" "--with-opengl=full" "--enable-image-loader-jp2k" "--enable-xinput22" "--enable-multisense" "--enable-systemd" "--enable-image-loader-webp" "--enable-harfbuzz" "--enable-wayland" "--enable-xine" "--enable-fb" "--disable-tslib" "--with-systemdunitdir=$out/systemd/user" ]; + + NIX_CFLAGS_COMPILE = [ "-I${xlibs.libXtst}" "-I${dbus_libs}/include/dbus-1.0" "-I${dbus_libs}/lib/dbus-1.0/include" ]; + + preConfigure = '' + export PKG_CONFIG_PATH="${gst_all_1.gst-plugins-base}/lib/pkgconfig/gstreamer-video-0.10.pc:$PKG_CONFIG_PATH" + ''; + + setupHook = ./efl-setup-hook.sh; + + meta = { + description = "Enlightenment Core libraries"; + homepage = http://enlightenment.org/; + maintainers = [ stdenv.lib.maintainers.matejc ]; + platforms = stdenv.lib.platforms.linux; + license = stdenv.lib.licenses.lgpl3; + }; +} diff --git a/pkgs/desktops/e19/elementary.nix b/pkgs/desktops/e19/elementary.nix new file mode 100644 index 000000000000..db335a156202 --- /dev/null +++ b/pkgs/desktops/e19/elementary.nix @@ -0,0 +1,20 @@ +{ stdenv, fetchurl, pkgconfig, e19, libcap, gdbm }: +stdenv.mkDerivation rec { + name = "elementary-${version}"; + version = "1.11.2"; + src = fetchurl { + url = "http://download.enlightenment.org/rel/libs/elementary/${name}.tar.gz"; + sha256 = "041hwp81qyq4wsw483g2jh52gcanqg046f91pmd0vzgwcgxyixqq"; + }; + buildInputs = [ pkgconfig e19.efl gdbm ] ++ stdenv.lib.optionals stdenv.isLinux [ libcap ]; + preConfigure = '' + export NIX_CFLAGS_COMPILE="-I${e19.efl}/include/ethumb-1 $NIX_CFLAGS_COMPILE" + ''; + meta = { + description = "Widget set/toolkit"; + homepage = http://enlightenment.org/; + maintainers = [ stdenv.lib.maintainers.matejc ]; + platforms = stdenv.lib.platforms.linux; + license = stdenv.lib.licenses.lgpl2; + }; +} diff --git a/pkgs/desktops/e19/emotion.nix b/pkgs/desktops/e19/emotion.nix new file mode 100644 index 000000000000..781d884fe3bd --- /dev/null +++ b/pkgs/desktops/e19/emotion.nix @@ -0,0 +1,20 @@ +{ stdenv, fetchurl, pkgconfig, e19, vlc }: +stdenv.mkDerivation rec { + name = "emotion_generic_players-${version}"; + version = "1.11.0"; + src = fetchurl { + url = "http://download.enlightenment.org/rel/libs/emotion_generic_players/${name}.tar.gz"; + sha256 = "0x6aigsqnfn9vcaj1rj6055s0vh811svzhwz5zghksg4lqipjbjx"; + }; + buildInputs = [ pkgconfig e19.efl vlc ]; + preConfigure = '' + export NIX_CFLAGS_COMPILE="-I${e19.efl}/include/eo-1 $NIX_CFLAGS_COMPILE" + ''; + meta = { + description = "Extra video decoders"; + homepage = http://enlightenment.org/; + maintainers = [ stdenv.lib.maintainers.matejc ]; + platforms = stdenv.lib.platforms.linux; + license = stdenv.lib.licenses.bsd2; + }; +} diff --git a/pkgs/desktops/e19/enlightenment.nix b/pkgs/desktops/e19/enlightenment.nix new file mode 100644 index 000000000000..95c5abdfa58c --- /dev/null +++ b/pkgs/desktops/e19/enlightenment.nix @@ -0,0 +1,38 @@ +{ stdenv, fetchurl, pkgconfig, e19, xlibs, libffi, pam, alsaLib, luajit, bzip2, libpthreadstubs, gdbm, libcap, set_freqset_setuid ? false }: + + + +stdenv.mkDerivation rec { + name = "enlightenment-${version}"; + version = "0.19.0"; + src = fetchurl { + url = "http://download.enlightenment.org/rel/apps/enlightenment/${name}.tar.xz"; + sha256 = "0d9s8gwma32hj8h000k1bzibr3zj8qajcf14va3w81k87gkilxfp"; + }; + buildInputs = [ pkgconfig e19.efl e19.elementary xlibs.libXdmcp xlibs.libxcb xlibs.xcbutilkeysyms xlibs.libXrandr libffi pam alsaLib luajit bzip2 libpthreadstubs gdbm ] ++ stdenv.lib.optionals stdenv.isLinux [ libcap ]; + preConfigure = '' + export NIX_CFLAGS_COMPILE="-I${e19.efl}/include/eo-1 -I${e19.efl}/include/ecore-imf-1 -I${e19.efl}/include/ethumb-client-1 -I${e19.efl}/include/ethumb-1 $NIX_CFLAGS_COMPILE" + export USER_SESSION_DIR=$prefix/lib/systemd/user + ''; + + # this is a hack and without this cpufreq module is not working: + # when set_freqset_setuid is true and "e19_freqset" is set in setuidPrograms (this is taken care of in e19 NixOS module), + # then this postInstall does the folowing: + # 1. moves the "freqset" binary to "e19_freqset", + # 2. linkes "e19_freqset" to enlightenment/bin so that, + # 3. setuidPrograms detects it and makes appropriate stuff to /var/setuid-wrappers/e19_freqset, + # 4. and finaly, linkes /var/setuid-wrappers/e19_freqset to original destination where enlightenment wants it + postInstall = if set_freqset_setuid then '' + export CPUFREQ_DIRPATH=`readlink -f $out/lib/enlightenment/modules/cpufreq/linux-gnu-*`; + mv $CPUFREQ_DIRPATH/freqset $CPUFREQ_DIRPATH/e19_freqset + ln -sv $CPUFREQ_DIRPATH/e19_freqset $out/bin/e19_freqset + ln -sv /var/setuid-wrappers/e19_freqset $CPUFREQ_DIRPATH/freqset + '' else ""; + meta = { + description = "The Compositing Window Manager and Desktop Shell"; + homepage = http://enlightenment.org/; + maintainers = [ stdenv.lib.maintainers.matejc ]; + platforms = stdenv.lib.platforms.linux; + license = stdenv.lib.licenses.bsd2; + }; +} diff --git a/pkgs/desktops/e19/evas.nix b/pkgs/desktops/e19/evas.nix new file mode 100644 index 000000000000..98b035f94e40 --- /dev/null +++ b/pkgs/desktops/e19/evas.nix @@ -0,0 +1,17 @@ +{ stdenv, fetchurl, pkgconfig, e19, zlib, libspectre, gstreamer, gst_plugins_base, gst_ffmpeg, gst_plugins_good, poppler, librsvg, libraw }: +stdenv.mkDerivation rec { + name = "evas_generic_loaders-${version}"; + version = "1.11.2"; + src = fetchurl { + url = "http://download.enlightenment.org/rel/libs/evas_generic_loaders/${name}.tar.gz"; + sha256 = "03p6v7l2fxvldiymqk16pqnbm9llygp6i19qhn3rmrqy1hkjkry6"; + }; + buildInputs = [ pkgconfig e19.efl zlib libspectre gstreamer gst_plugins_base gst_ffmpeg gst_plugins_good poppler librsvg libraw ]; + meta = { + description = "Extra image decoders"; + homepage = http://enlightenment.org/; + maintainers = [ stdenv.lib.maintainers.matejc ]; + platforms = stdenv.lib.platforms.linux; + license = stdenv.lib.licenses.gpl2; + }; +} diff --git a/pkgs/desktops/e19/terminology.nix b/pkgs/desktops/e19/terminology.nix new file mode 100644 index 000000000000..97bf07b298d5 --- /dev/null +++ b/pkgs/desktops/e19/terminology.nix @@ -0,0 +1,23 @@ +{ stdenv, fetchurl, pkgconfig, e19 }: +stdenv.mkDerivation rec { + name = "terminology-${version}"; + version = "0.6.1"; + src = fetchurl { + url = "http://download.enlightenment.org/rel/apps/terminology/${name}.tar.gz"; + sha256 = "1wi9njyfs95y4nb9jd30032qqka5cg7k0wacck8s1yqxwg5ng38x"; + }; + buildInputs = [ pkgconfig e19.efl e19.elementary ]; + preConfigure = '' + export NIX_CFLAGS_COMPILE="-I${e19.efl}/include/eo-1 $NIX_CFLAGS_COMPILE" + export NIX_CFLAGS_COMPILE="-I${e19.efl}/include/ecore-con-1 $NIX_CFLAGS_COMPILE" + export NIX_CFLAGS_COMPILE="-I${e19.efl}/include/eldbus-1 $NIX_CFLAGS_COMPILE" + export NIX_CFLAGS_COMPILE="-I${e19.efl}/include/ethumb-1 $NIX_CFLAGS_COMPILE" + ''; + meta = { + description = "The best terminal emulator written with the EFL"; + homepage = http://enlightenment.org/; + maintainers = [ stdenv.lib.maintainers.matejc ]; + platforms = stdenv.lib.platforms.linux; + license = stdenv.lib.licenses.bsd2; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 32ff5ecc00f7..394e97318afe 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10871,6 +10871,11 @@ let import ../desktops/e18 { inherit callPackage pkgs; } ); + e19 = recurseIntoAttrs ( + let callPackage = newScope pkgs.e19; in + import ../desktops/e19 { inherit callPackage pkgs; } + ); + gnome2 = callPackage ../desktops/gnome-2 { callPackage = pkgs.newScope pkgs.gnome2; self = pkgs.gnome2; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9c4778979019..4f4af56e0e87 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10654,6 +10654,26 @@ let }; }; + pythonefl_1_11 = buildPythonPackage rec { + name = "python-efl-${version}"; + version = "1.11.0"; + src = fetchurl { + url = "http://download.enlightenment.org/rel/bindings/python/${name}.tar.xz"; + sha256 = "1d4hj39alg6j7ah1bc8wvlka9d13i8iy3fxxraik2f60w6811i48"; + }; + preConfigure = '' + export NIX_CFLAGS_COMPILE="-I${pkgs.e19.efl}/include/eo-1 -I${pkgs.e19.efl}/include/eina-1 -I${pkgs.e19.efl}/include/eina-1/eina -I${pkgs.e19.efl}/include/evas-1 -I${dbus}/include/dbus-1.0 -I${pkgs.e19.efl}/include/efl-1 -I${pkgs.e19.efl}/include/eet-1 -I${pkgs.e19.efl}/include/ecore-1 -I${pkgs.e19.efl}/include/ecore-evas-1 -I${pkgs.e19.efl}/include/ecore-file-1 -I${pkgs.e19.efl}/include/ecore-input-1 -I${pkgs.e19.efl}/include/ecore-imf-1 -I${pkgs.e19.efl}/include/ecore-con-1 -I${pkgs.e19.efl}/include/edje-1 -I${pkgs.e19.efl}/include/eldbus-1 -I${pkgs.e19.efl}/include/efreet-1 -I${pkgs.e19.efl}/include/ethumb-client-1 -I${pkgs.e19.efl}/include/ethumb-1 -I${pkgs.e19.efl}/include/ecore-x-1 $NIX_CFLAGS_COMPILE" + ''; + buildInputs = [ pkgs.pkgconfig pkgs.e19.efl pkgs.e19.elementary ]; + meta = { + description = "Python bindings for EFL and Elementary."; + homepage = http://enlightenment.org/; + maintainers = [ stdenv.lib.maintainers.matejc ]; + platforms = stdenv.lib.platforms.linux; + license = stdenv.lib.licenses.gpl3; + }; + }; + pythonefl = buildPythonPackage rec { name = "python-efl-${version}"; version = "1.10.0";