Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

unity: Add Unity core package and dependencies.

Well, what a mess! Finally it's building successfully and even managed to do
some cleanups.

Probably most people might be wondering why I'm doing a port of Unity to Nix
while I personally don't use and/or even like it. The main reason is because I
tried to introduce someone to Nix and NixOS who actively uses Unity and doesn't
want to switch to something more sane^H^H^H^Hlightweight.

So let me introduce him: @gradel

He will be the new maintainer of the Unity desktop packages in Nix and I'm going
to mentor him during this process.

Enough about introduction, there still is a lot of work to do:

 * Improve directory structure of pkgs/desktop/unity.
 * Add more packages to propagatedBuildInputs to keep things DRY.
 * Maybe clean up my GIR compiler patch.
 * Add an update script to update all that stuff at once.
 * Separate the ugly sed hacks into nice clean patches.
 * Check build warnings and maybe fix them instead of removing -Werror.
 * Add missing dependencies.
 * Add missing meta information (I pretty much omitted about all of them).
 * The packages ibus, libgee and PackageKit obviously don't belong to unity,
   move them to the right locations.

And the biggest TODO:

Actually *test* it, as it is only UnityCore, I presume there is quite a bunch of
packages missing at this point.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
  • Loading branch information...
commit 69df841783c021d4052a84f8de07168e942fecea 1 parent 827752a
aszlig aszlig authored
28 pkgs/desktops/unity/bamf.nix
View
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl, gnome, pkgconfig, gtk2, gtk3, gobjectIntrospection
+, dbus_glib, libwnck3, libgtop, libunityWebapps, vala
+}:
+
+stdenv.mkDerivation rec {
+ name = "bamf-${version}";
+ version = "0.3.4";
+
+ src = fetchurl {
+ url = "http://launchpad.net/bamf/0.3/${version}/+download/${name}.tar.gz";
+ sha256 = "0a4l91vqyqzzkgcahbaqg1hbh2fd53za3i187q1944i1g32kx9r5";
+ };
+
+ VALA_API_GEN = with stdenv.lib; let
+ pkgs = [ gobjectIntrospection ];
+ argify = p: "--girdir=${p}/share/gir-1.0 --vapidir=${p}/share/vala/vapi";
+ args = map argify pkgs;
+ in "${vala}/bin/vapigen ${concatStringsSep " " args}";
+
+ buildInputs = [
+ pkgconfig gnome.gtkdoc gtk2 gtk3 gobjectIntrospection dbus_glib libgtop
+ libunityWebapps vala
+ ];
+
+ propagatedBuildInputs = [
+ libwnck3
+ ];
+}
13 pkgs/desktops/unity/dee.nix
View
@@ -0,0 +1,13 @@
+{ stdenv, fetchurl, python, pkgconfig, glib, gobjectIntrospection, icu }:
+
+stdenv.mkDerivation rec {
+ name = "dee-${version}";
+ version = "1.0.14";
+
+ src = fetchurl {
+ url = "http://launchpad.net/dee/1.0/${version}/+download/${name}.tar.gz";
+ sha256 = "0302lfndmplvv5crf70myhxh5vsisjs1czdqx2xnrvylnxz1hwqi";
+ };
+
+ buildInputs = [ python pkgconfig glib gobjectIntrospection icu ];
+}
21 pkgs/desktops/unity/default.nix
View
@@ -0,0 +1,21 @@
+{ callPackage, pkgs }:
+
+rec {
+ bamf = callPackage ./bamf.nix { };
+ dee = callPackage ./dee.nix { };
+ frame = callPackage ./frame.nix { };
+ geis = callPackage ./geis.nix { };
+ grail = callPackage ./grail.nix { };
+ ibus = callPackage ./ibus.nix { };
+ indicatorMessages = callPackage ./indicator-messages.nix { };
+ libdbusmenu = callPackage ./libdbusmenu.nix { };
+ libgee = callPackage ./libgee.nix { };
+ libindicator = callPackage ./libindicator.nix { };
+ libunity = callPackage ./libunity.nix { };
+ libunityMisc = callPackage ./libunity-misc.nix { };
+ libunityWebapps = callPackage ./libunity-webapps.nix { };
+ libzeitgeist = callPackage ./libzeitgeist.nix { };
+ nux = callPackage ./nux.nix { };
+ packagekit = callPackage ./packagekit.nix { };
+ unity = callPackage ./unity.nix { };
+}
81 pkgs/desktops/unity/disable-pointerbarrier.patch
View
@@ -0,0 +1,81 @@
+This is patch is from ArchLinux and can be found here as well:
+
+https://aur.archlinux.org/packages/unity/
+
+diff -Naur unity-6.12.0.orig/launcher/PointerBarrier.cpp unity-6.12.0/launcher/PointerBarrier.cpp
+--- unity-6.12.0.orig/launcher/PointerBarrier.cpp 2012-11-06 15:34:13.000000000 +0100
++++ unity-6.12.0/launcher/PointerBarrier.cpp 2012-11-22 10:45:28.046339668 +0100
+@@ -65,18 +65,8 @@
+ int maj,min;
+ XFixesQueryVersion(dpy, &maj, &min);
+
+- barrier = XFixesCreatePointerBarrierVelocity(dpy,
+- DefaultRootWindow(dpy),
+- x1, y1,
+- x2, y2,
+- static_cast<int>(direction),
+- threshold,
+- 0,
+- NULL);
+-
+ if (!local::is_selected_for)
+ {
+- XFixesSelectBarrierInput(dpy, DefaultRootWindow(dpy), 0xdeadbeef);
+ local::is_selected_for = true;
+ }
+
+@@ -104,7 +94,7 @@
+
+ void PointerBarrierWrapper::ReleaseBarrier(int event_id)
+ {
+- XFixesBarrierReleasePointer(nux::GetGraphicsDisplay()->GetX11Display(), barrier, event_id);
++ return;
+ }
+
+ void PointerBarrierWrapper::EmitCurrentData(int event_id, int x, int y)
+@@ -123,45 +113,6 @@
+
+ bool PointerBarrierWrapper::HandleEvent(XEvent xevent)
+ {
+- if (xevent.type - event_base_ == XFixesBarrierNotify)
+- {
+- auto notify_event = reinterpret_cast<XFixesBarrierNotifyEvent*>(&xevent);
+-
+- if (notify_event->barrier == barrier && notify_event->subtype == XFixesBarrierHitNotify)
+- {
+- smoothing_accum_ += notify_event->velocity;
+- smoothing_count_++;
+-
+- if (released)
+- {
+- /* If the barrier is released, just emit the current event without
+- * waiting, so there won't be any delay on releasing the barrier. */
+- smoothing_timeout_.reset();
+- auto event = std::make_shared<BarrierEvent>(notify_event->x, notify_event->y,
+- notify_event->velocity, notify_event->event_id);
+- barrier_event.emit(this, event);
+- }
+- else if (!smoothing_timeout_)
+- {
+- int x = notify_event->x;
+- int y = notify_event->y;
+- int event = notify_event->event_id;
+-
+- auto smoothing_cb = [&, event, x, y] ()
+- {
+- EmitCurrentData(event, x, y);
+-
+- smoothing_timeout_.reset();
+- return false;
+- };
+-
+- smoothing_timeout_.reset(new glib::Timeout(smoothing, smoothing_cb));
+- }
+- }
+-
+- return notify_event->barrier == barrier;
+- }
+-
+ return false;
+ }
+
14 pkgs/desktops/unity/frame.nix
View
@@ -0,0 +1,14 @@
+{ stdenv, fetchurl, pkgconfig, x11, xorgserver, libXi }:
+
+stdenv.mkDerivation rec {
+ name = "frame-${version}";
+ version = "2.4.4";
+
+ src = fetchurl {
+ url = "http://launchpad.net/frame/trunk/${version}"
+ + "/+download/${name}.tar.xz";
+ sha256 = "1pbnl9l84ca17641lrwzidkkl7ysffl26mbp1r245y0kf4kdxqi3";
+ };
+
+ buildInputs = [ pkgconfig x11 xorgserver libXi ];
+}
19 pkgs/desktops/unity/geis.nix
View
@@ -0,0 +1,19 @@
+{ stdenv, fetchurl, pkgconfig, python, dbus, grail, x11, libxcb, libXi
+, xorgserver
+}:
+
+stdenv.mkDerivation rec {
+ name = "geis-${version}";
+ version = "2.2.14";
+
+ src = fetchurl {
+ url = "http://launchpad.net/geis/trunk/${version}/+download/${name}.tar.xz";
+ sha256 = "1xrn267cr4d9q0akd02wvpjv1cjvyxzp1f2fi3191m3ph556m5f6";
+ };
+
+ buildInputs = [ pkgconfig python dbus grail x11 libxcb libXi xorgserver ];
+
+ preConfigure = ''
+ sed -i -e 's/ -Werror//g' configure
+ '';
+}
15 pkgs/desktops/unity/grail.nix
View
@@ -0,0 +1,15 @@
+{ stdenv, fetchurl, pkgconfig, frame, x11, libXi }:
+
+stdenv.mkDerivation rec {
+ name = "grail-${version}";
+ version = "3.0.9";
+
+ src = fetchurl {
+ url = "http://launchpad.net/grail/trunk/${version}"
+ + "/+download/${name}.tar.bz2";
+ sha256 = "0gri8vcknxg0rj2jmsxipim2dd9zfs53q552k7i9dyn9sjwxip6p";
+ };
+
+ buildInputs = [ pkgconfig x11 libXi ];
+ propagatedBuildInputs = [ frame ];
+}
18 pkgs/desktops/unity/ibus.nix
View
@@ -0,0 +1,18 @@
+{ stdenv, fetchurl, pkgconfig, intltool, glib, gtk2, gtk3, dbus
+, gnome, python, pythonDBus, isocodes
+}:
+
+stdenv.mkDerivation rec{
+ name = "ibus-${version}";
+ version = "1.4.2";
+
+ src = fetchurl {
+ url = "http://ibus.googlecode.com/files/${name}.tar.gz";
+ sha1 = "a2d11d8bb64761691df918e9e50f0b35c711760d";
+ };
+
+ buildInputs = [
+ pkgconfig intltool glib gtk2 gtk3 dbus
+ gnome.GConf python pythonDBus isocodes
+ ];
+}
16 pkgs/desktops/unity/indicator-messages.nix
View
@@ -0,0 +1,16 @@
+{ stdenv, fetchurl, pkgconfig, intltool, gtk3, libindicator }:
+
+stdenv.mkDerivation rec {
+ name = "indicator-messages-${version}";
+ version = "12.10.5";
+
+ src = fetchurl {
+ url = "http://launchpad.net/indicator-messages/12.10/${version}"
+ + "/+download/${name}.tar.gz";
+ sha256 = "0bq4bbacjlpixf5h229y2998b703qb6cv11mrv0wzs4rydz77zkx";
+ };
+
+ configureFlags = [ "--enable-localinstall" ];
+
+ buildInputs = [ pkgconfig intltool gtk3 libindicator ];
+}
20 pkgs/desktops/unity/libdbusmenu.nix
View
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl, pkgconfig, intltool, glib, gnome, gnome_doc_utils
+, gtk2, gtk3, atk, json_glib, gobjectIntrospection
+}:
+
+let
+ gtk3gir = gtk3.override { enableIntrospection = true; };
+in stdenv.mkDerivation rec {
+ name = "libdbusmenu-${version}";
+ version = "12.10.2";
+
+ src = fetchurl {
+ url = "http://launchpad.net/dbusmenu/12.10/${version}/+download/${name}.tar.gz";
+ sha256 = "1j84klglil1227f6vvhcrc0vcph9ib70q8z95snl5cqqp6hd8slx";
+ };
+
+ buildInputs = [
+ pkgconfig intltool glib gnome.gtkdoc gnome_doc_utils
+ gtk2 gtk3gir atk json_glib gobjectIntrospection
+ ];
+}
24 pkgs/desktops/unity/libgee.nix
View
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, pkgconfig, glib, vala, gobjectIntrospection }:
+
+stdenv.mkDerivation rec {
+ name = "libgee-${version}";
+ version = "0.6.7";
+
+ src = fetchurl {
+ url = "mirror://gnome/sources/libgee/0.6/${name}.tar.xz";
+ sha256 = "0v8h2ha1pc55kvqy68hbav69ckidqhjw7yp59ck6mfzvhlbvy4mm";
+ };
+
+ prePatch = ''
+ sed -i -r \
+ -e "s|(INTROSPECTION_TYPELIBDIR=).*|\1\"$out/lib/girepository-1.0\"|" \
+ -e "s|(INTROSPECTION_GIRDIR=).*|\1\"$out/share/gir-1.0\"|" \
+ configure
+ '';
+
+ buildInputs = [ pkgconfig glib vala gobjectIntrospection ];
+
+ meta = {
+ description = "GObject collection library";
+ };
+}
14 pkgs/desktops/unity/libindicator.nix
View
@@ -0,0 +1,14 @@
+{ stdenv, fetchurl, pkgconfig, intltool, gtk3 }:
+
+stdenv.mkDerivation rec {
+ name = "libindicator-${version}";
+ version = "12.10.1";
+
+ src = fetchurl {
+ url = "http://launchpad.net/libindicator/12.10/${version}"
+ + "/+download/${name}.tar.gz";
+ sha256 = "0zs4z7l9b57jldwz0ban77f3c2zq43ambd0dssf5qg9i216f9lmj";
+ };
+
+ buildInputs = [ pkgconfig intltool gtk3 ];
+}
14 pkgs/desktops/unity/libunity-misc.nix
View
@@ -0,0 +1,14 @@
+{ stdenv, fetchurl, pkgconfig, glib, gtk3 }:
+
+stdenv.mkDerivation rec {
+ name = "libunity-misc-${version}";
+ version = "4.0.4";
+
+ src = fetchurl {
+ url = "https://launchpad.net/libunity-misc/trunk/"
+ + "${version}/+download/${name}.tar.gz";
+ sha256 = "1jd08ksxb9wq08kc8y10z6hik1zbnxc9bqkz7p8i7rfrsaqprsld";
+ };
+
+ buildInputs = [ pkgconfig glib gtk3 ];
+}
26 pkgs/desktops/unity/libunity-webapps.nix
View
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl, pkgconfig, intltool, glib, gobjectIntrospection
+, gdk_pixbuf, libwnck3, json_glib, libsoup, packagekit, polkit, telepathy_glib
+, libnotify, libunity, indicatorMessages, geoclue, libdbusmenu, gtk2
+}:
+
+stdenv.mkDerivation rec {
+ name = "libunity-webapps-${version}";
+ version = "2.4.3";
+
+ src = fetchurl {
+ url = "http://launchpad.net/libunity-webapps/2.4/${version}"
+ + "/+download/unity_webapps-2.4.3.tar.gz";
+ sha256 = "1jr0ci7azp6x4p7gnq5pfvpnrawdr3bdidahl52qvglf49127i5y";
+ };
+
+ prePatch = ''
+ sed -i -e 's/notify_notification_new[^)]*/&, NULL/' \
+ src/context-daemon/unity-webapps-notification-context.c
+ '';
+
+ buildInputs = [
+ intltool pkgconfig glib gobjectIntrospection gdk_pixbuf libwnck3 json_glib
+ libsoup packagekit polkit telepathy_glib libnotify libunity
+ indicatorMessages geoclue libdbusmenu gtk2
+ ];
+}
27 pkgs/desktops/unity/libunity.nix
View
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, pkgconfig, intltool, gnome, glib, gobjectIntrospection
+, vala, python, libgee, dee, libdbusmenu, gtk3
+}:
+
+stdenv.mkDerivation rec {
+ name = "libunity-${version}";
+ version = "6.12.0";
+
+ src = fetchurl {
+ url = "http://launchpad.net/libunity/6.0/${version}"
+ + "/+download/${name}.tar.gz";
+ sha256 = "1nadapl3390x98q1wv2yarh60hzi7ck0d1s8zz9xsiq3zz6msbjd";
+ };
+
+ VALAC = with stdenv.lib; let
+ pkgs = [ gobjectIntrospection libgee dee libdbusmenu ];
+ argify = p: "--girdir=${p}/share/gir-1.0 --vapidir=${p}/share/vala/vapi";
+ args = map argify pkgs;
+ in "${vala}/bin/valac ${concatStringsSep " " args}";
+
+ buildInputs = [
+ pkgconfig intltool gnome.gnome_common glib gobjectIntrospection vala python
+ libdbusmenu gtk3
+ ];
+
+ propagatedBuildInputs = [ dee libgee ];
+}
14 pkgs/desktops/unity/libzeitgeist.nix
View
@@ -0,0 +1,14 @@
+{ stdenv, fetchurl, pkgconfig, glib }:
+
+stdenv.mkDerivation rec {
+ name = "libzeitgeist-${version}";
+ version = "0.3.18";
+
+ src = fetchurl {
+ url = "http://launchpad.net/libzeitgeist/0.3/${version}"
+ + "/+download/${name}.tar.gz";
+ sha256 = "0wqgz3yw0czpgxy9gyjx7mzwa8xisps5xrp3p0c0aq38gbcjihc2";
+ };
+
+ buildInputs = [ pkgconfig glib ];
+}
23 pkgs/desktops/unity/nux.nix
View
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl, pkgconfig, libtool, glib, libsigcxx, gdk_pixbuf, cairo
+, mesa, glew, x11, libXext, libXxf86vm, libXinerama, libXcomposite
+, libXdamage, pango, pciutils, ibus, boost, geis
+}:
+
+stdenv.mkDerivation rec {
+ name = "nux-${version}";
+ version = "3.10.0";
+
+ src = fetchurl {
+ url = "http://launchpad.net/nux/3.0/3.10/+download/${name}.tar.gz";
+ sha256 = "1h06hv74fv0a7fwcr91ca8f16qq70igyxgwbcs0xmbn94vzbjjnn";
+ };
+
+ buildInputs = [
+ libtool pkgconfig glib libsigcxx gdk_pixbuf cairo mesa x11 libXext
+ libXinerama libXcomposite libXdamage pango pciutils ibus boost
+ ];
+
+ propagatedBuildInputs = [ geis glew libXxf86vm ];
+
+ enableParallelBuilding = true;
+}
23 pkgs/desktops/unity/packagekit.nix
View
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl, pkgconfig, intltool, gnome, glib, sqlite, python
+, systemd, polkit
+}:
+
+stdenv.mkDerivation rec {
+ name = "PackageKit-${version}";
+ version = "0.8.6";
+
+ src = fetchurl {
+ url = "http://www.packagekit.org/releases/${name}.tar.xz";
+ sha256 = "0y52di6y4j9wxsjpnarmgv84a8ap7bzzg8aplfblp0f5j5ykxzik";
+ };
+
+ configureFlags = [
+ "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
+ "--with-systemdutildir=$(out)/lib/systemd/system-sleep"
+ ];
+
+ buildInputs = [
+ pkgconfig intltool gnome.gtkdoc glib sqlite python systemd
+ polkit
+ ];
+}
40 pkgs/desktops/unity/unity.nix
View
@@ -0,0 +1,40 @@
+{ stdenv, fetchurl, cmake, pkgconfig, gettext, compiz, nux, bamf, dee, glib
+, libdbusmenu, x11, gnome, libindicator, atk, at_spi2_atk, dbus_glib, gtk2, gtk3
+, libsigcxx, json_glib, libnotify, libzeitgeist, libunity, libunityMisc
+, libXdamage, libXdmcp, libXau, libxml2, libxslt, libpthreadstubs, glibmm
+, libdrm, mesa, boost
+}:
+
+stdenv.mkDerivation rec {
+ name = "unity-${version}";
+ version = "6.12.0";
+
+ src = fetchurl {
+ url = "http://launchpad.net/unity/6.0/${version}/+download/${name}.tar.gz";
+ sha256 = "1h8qch4339pyyiikv0f0jzfhysmknfcazy26pbf1lya5ih62yhag";
+ };
+
+ prePatch = ''
+ find . -name "CMakeLists.txt" -exec sed -i 's/-Werror *//g' '{}' +
+ sed -e '/notify_notification_new(/,/nullptr)/s/nullptr/&, nullptr/' \
+ -e 's/\(notify_notification_set_\)image\(_from_pixbuf\)/\1icon\2/' \
+ -e 's/\(notify_notification_set_hint\) *(.*/\/* XXX: & *\//' \
+ -i launcher/DeviceNotificationDisplayImp.cpp
+ '';
+
+ patches = [ ./disable-pointerbarrier.patch ];
+
+ enableParallelBuilding = true;
+
+ cmakeFlags = [
+ "-DGSETTINGS_LOCALINSTALL=1"
+ "-DCMAKE_MODULE_PATH=${compiz}/share/cmake-2.8"
+ ];
+
+ buildInputs = [
+ cmake pkgconfig gettext compiz nux bamf dee glib libdbusmenu x11
+ gnome.startupnotification libindicator atk at_spi2_atk dbus_glib gtk2 gtk3
+ libsigcxx json_glib libnotify libzeitgeist libunity libunityMisc libXdamage
+ libXdmcp libXau libxml2 libxslt libpthreadstubs glibmm libdrm mesa boost
+ ];
+}
7 pkgs/top-level/all-packages.nix
View
@@ -8545,6 +8545,13 @@ let
oxygen_gtk = callPackage ../misc/themes/gtk2/oxygen-gtk { };
+ unity = let
+ callPackage = newScope pkgs.unity;
+ unityPkgs = import ../desktops/unity {
+ inherit callPackage pkgs;
+ };
+ in recurseIntoAttrs unityPkgs;
+
xfce = xfce48;
xfce48 = recurseIntoAttrs
Please sign in to comment.
Something went wrong with that request. Please try again.