Skip to content

Commit

Permalink
unity: Add Unity core package and dependencies.
Browse files Browse the repository at this point in the history
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
aszlig committed Dec 12, 2012
1 parent 827752a commit 69df841
Show file tree
Hide file tree
Showing 20 changed files with 457 additions and 0 deletions.
28 changes: 28 additions & 0 deletions pkgs/desktops/unity/bamf.nix
@@ -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 changes: 13 additions & 0 deletions pkgs/desktops/unity/dee.nix
@@ -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 changes: 21 additions & 0 deletions pkgs/desktops/unity/default.nix
@@ -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 changes: 81 additions & 0 deletions pkgs/desktops/unity/disable-pointerbarrier.patch
@@ -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 changes: 14 additions & 0 deletions pkgs/desktops/unity/frame.nix
@@ -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 changes: 19 additions & 0 deletions pkgs/desktops/unity/geis.nix
@@ -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 changes: 15 additions & 0 deletions pkgs/desktops/unity/grail.nix
@@ -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 changes: 18 additions & 0 deletions pkgs/desktops/unity/ibus.nix
@@ -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 changes: 16 additions & 0 deletions pkgs/desktops/unity/indicator-messages.nix
@@ -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 changes: 20 additions & 0 deletions pkgs/desktops/unity/libdbusmenu.nix
@@ -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 changes: 24 additions & 0 deletions pkgs/desktops/unity/libgee.nix
@@ -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 changes: 14 additions & 0 deletions pkgs/desktops/unity/libindicator.nix
@@ -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 changes: 14 additions & 0 deletions pkgs/desktops/unity/libunity-misc.nix
@@ -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 changes: 26 additions & 0 deletions pkgs/desktops/unity/libunity-webapps.nix
@@ -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 changes: 27 additions & 0 deletions pkgs/desktops/unity/libunity.nix
@@ -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 changes: 14 additions & 0 deletions pkgs/desktops/unity/libzeitgeist.nix
@@ -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 ];
}

0 comments on commit 69df841

Please sign in to comment.