Revert Merge x-updates into master due to mesa bloat

See #490 discussion.

This reverts commit 1278859d31, reversing
changes made to 0c020c98f9.

Conflicts:
	pkgs/desktops/xfce/core/xfce4-session.nix (take master)
	pkgs/lib/misc.nix (auto)
This commit is contained in:
Vladimír Čunát
2013-05-09 13:58:08 +02:00
parent 84b0bf63b7
commit ec3965d8d0
135 changed files with 1595 additions and 2722 deletions

View File

@@ -1,104 +1,71 @@
{ stdenv, fetchurl, pkgconfig, autoconf, automake, libtool
, expat, systemd, glib, dbus_glib, python
, libX11, libICE, libSM, useX11 ? true }:
{ stdenv, fetchurl, pkgconfig, expat, libX11, libICE, libSM, useX11 ? true }:
let
version = "1.6.10"; # 1.7.* isn't recommended, even for gnome 3.8
sha256 = "11jyj6aw8yf75hqv7v0601n2xms08k0mys6dyql164m7ad56yg8z";
version = "1.6.4";
inherit (stdenv) lib;
buildInputsX = lib.optionals useX11 [ libX11 libICE libSM ];
# also other parts than "libs" need this statically linked lib
makeInternalLib = "(cd dbus && make libdbus-internal.la)";
# A generic builder for individual parts (subdirs) of D-Bus
dbus_drv = name: subdirs: merge: stdenv.mkDerivation (lib.mergeAttrsByFuncDefaultsClean [{
name = "dbus-${name}-${version}";
src = fetchurl {
url = "http://dbus.freedesktop.org/releases/dbus/dbus-${version}.tar.gz";
inherit sha256;
};
configureFlags = [
"--localstatedir=/var"
"--sysconfdir=/etc"
"--with-session-socket-dir=/tmp"
"--with-systemdsystemunitdir=$(out)/lib/systemd"
];
preConfigure = ''
patchShebangs .
substituteInPlace tools/Makefile.am --replace 'install-localstatelibDATA:' 'disabled:'
autoreconf -fi
'';
installFlags = "sysconfdir=$(out)/etc";
doCheck = true;
patches = [
./ignore-missing-includedirs.patch ./implement-getgrouplist.patch
./ucred-dirty-hack.patch ./no-create-dirs.patch
];
nativeBuildInputs = [ pkgconfig ];
propagatedBuildInputs = [ expat ];
buildInputs = [ autoconf automake libtool ]; # ToDo: optional selinux?
# build only the specified subdirs
postPatch = "sed '/SUBDIRS/s/=.*/=" + subdirs + "/' -i Makefile.am\n"
# use already packaged libdbus instead of trying to build it again
+ lib.optionalString (name != "libs") ''
for mfile in */Makefile.am; do
sed 's,\$(top_builddir)/dbus/\(libdbus-[0-9]\),${libs}/lib/\1,g' -i "$mfile"
done
'';
} merge ]);
libs = dbus_drv "libs" "dbus" {
buildInputs = [ systemd.headers ];
patches = [ ./systemd.patch ]; # bypass systemd detection
# Enable X11 autolaunch support in libdbus. This doesn't actually depend on X11
# (it just execs dbus-launch in dbus.tools), contrary to what the configure script demands.
NIX_CFLAGS_COMPILE = "-DDBUS_ENABLE_X11_AUTOLAUNCH=1";
src = fetchurl {
url = "http://dbus.freedesktop.org/releases/dbus/dbus-${version}.tar.gz";
sha256 = "1wacqyfkcpayg7f8rvx9awqg275n5pksxq5q7y21lxjx85x6pfjz";
};
patches = [ ./ignore-missing-includedirs.patch ];
configureFlags = "--localstatedir=/var --sysconfdir=/etc --with-session-socket-dir=/tmp";
in rec {
# This package has been split because most applications only need dbus.lib
# which serves as an interface to a *system-wide* daemon,
# see e.g. http://en.wikipedia.org/wiki/D-Bus#Architecture .
# Also some circular dependencies get split by this (like with systemd).
libs = stdenv.mkDerivation {
name = "dbus-library-" + version;
inherit libs;
nativeBuildInputs = [ pkgconfig ];
tools = dbus_drv "tools" "tools" {
configureFlags = [ "--with-dbus-daemondir=${daemon}/bin" ];
buildInputs = buildInputsX ++ [ libs daemon systemd dbus_glib ];
NIX_CFLAGS_LINK = "-Wl,--as-needed -ldbus-1";
buildInputs = [ expat ];
# FIXME: dbus has optional systemd integration when checking
# at_console policies. How to enable this without introducing a
# circular dependency between dbus and systemd?
inherit src patches configureFlags;
preConfigure =
''
sed -i '/mkinstalldirs.*localstatedir/d' bus/Makefile.in
sed -i '/SUBDIRS/s/ tools//' Makefile.in
'';
# Enable X11 autolaunch support in libdbus. This doesn't actually
# depend on X11 (it just execs dbus-launch in dbus.tools),
# contrary to what the configure script demands.
NIX_CFLAGS_COMPILE = "-DDBUS_ENABLE_X11_AUTOLAUNCH=1";
installFlags = "sysconfdir=$(out)/etc";
};
daemon = dbus_drv "daemon" "bus" {
preBuild = makeInternalLib;
buildInputs = [ systemd ];
tools = stdenv.mkDerivation {
name = "dbus-tools-" + version;
inherit src patches;
configureFlags = "${configureFlags} --with-dbus-daemondir=${daemon}/bin";
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ expat libs ]
++ stdenv.lib.optionals useX11 [ libX11 libICE libSM ];
NIX_LDFLAGS = "-ldbus-1";
preConfigure =
''
sed -i 's@$(top_builddir)/dbus/libdbus-1.la@@' tools/Makefile.in
substituteInPlace tools/Makefile.in --replace 'install-localstatelibDATA:' 'disabled:'
'';
postConfigure = "cd tools";
installFlags = "localstatedir=$TMPDIR/var";
};
# Some of the tests don't work yet; in fact, @vcunat tried several packages
# containing dbus testing, and all of them have some test failure.
tests = dbus_drv "tests" "test" {
preBuild = makeInternalLib;
buildInputs = buildInputsX ++ [ systemd libs tools daemon dbus_glib python ];
NIX_CFLAGS_LINK = "-Wl,--as-needed -ldbus-1";
};
docs = dbus_drv "docs" "doc" {
postInstall = ''rm -r "$out/lib"'';
};
# I'm too lazy to separate daemon and libs now.
daemon = libs;
}

View File

@@ -1,108 +0,0 @@
Compatibility patch for Illumos/Solaris and possibly other platforms.
Implements getgrouplist when not provided by OS.
Without it, only the user's primary group is used in authentication!
--- 1970-01-01 00:00:00.000000000 +0000
+++ dbus-1.6.8/dbus/getgrouplist.c 2013-02-28 13:10:51.081792722 +0000
@@ -0,0 +1,89 @@
+/* $OpenBSD: getgrouplist.c,v 1.12 2005/08/08 08:05:34 espie Exp $ */
+/*
+ * Copyright (c) 1991, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/* OPENBSD ORIGINAL: lib/libc/gen/getgrouplist.c */
+
+/*
+ * get credential
+ */
+#include <sys/types.h>
+#include <string.h>
+#include <unistd.h>
+#include <grp.h>
+
+int
+getgrouplist(const char *uname, gid_t agroup, gid_t *groups, int *grpcnt)
+{
+ struct group *grp;
+ int i, ngroups;
+ int ret, maxgroups;
+ int bail;
+
+ ret = 0;
+ ngroups = 0;
+ maxgroups = *grpcnt;
+
+ /*
+ * install primary group
+ */
+ if (ngroups >= maxgroups) {
+ *grpcnt = ngroups;
+ return (-1);
+ }
+ groups[ngroups++] = agroup;
+
+ /*
+ * Scan the group file to find additional groups.
+ */
+ setgrent();
+ while ((grp = getgrent())) {
+ if (grp->gr_gid == agroup)
+ continue;
+ for (bail = 0, i = 0; bail == 0 && i < ngroups; i++)
+ if (groups[i] == grp->gr_gid)
+ bail = 1;
+ if (bail)
+ continue;
+ for (i = 0; grp->gr_mem[i]; i++) {
+ if (!strcmp(grp->gr_mem[i], uname)) {
+ if (ngroups >= maxgroups) {
+ ret = -1;
+ goto out;
+ }
+ groups[ngroups++] = grp->gr_gid;
+ break;
+ }
+ }
+ }
+out:
+ endgrent();
+ *grpcnt = ngroups;
+ return (ret);
+}
--- dbus-1.6.8/dbus/dbus-sysdeps-unix.c.orig 2013-02-28 13:08:52.171215237 +0000
+++ dbus-1.6.8/dbus/dbus-sysdeps-unix.c 2013-02-28 13:13:52.224615146 +0000
@@ -21,6 +21,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
+#ifndef HAVE_GETGROUPLIST
+#include "getgrouplist.c"
+#define HAVE_GETGROUPLIST
+#endif
#include <config.h>

View File

@@ -1,26 +0,0 @@
diff --git a/bus/Makefile.am b/bus/Makefile.am
index 6cbc09a..be60bb8 100644
--- a/bus/Makefile.am
+++ b/bus/Makefile.am
@@ -212,7 +212,6 @@ clean-local:
/bin/rm *.bb *.bbg *.da *.gcov || true
install-data-hook:
- $(mkinstalldirs) $(DESTDIR)$(localstatedir)/run/dbus
$(mkinstalldirs) $(DESTDIR)$(configdir)/system.d
$(mkinstalldirs) $(DESTDIR)$(configdir)/session.d
$(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/services
diff --git a/tools/Makefile.am b/tools/Makefile.am
index cfd54b8..b6e28f9 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -74,7 +74,7 @@ CLEANFILES = \
# create the /var/lib/dbus directory for dbus-uuidgen
install-data-local:
- $(MKDIR_P) $(DESTDIR)$(localstatedir)/lib/dbus
+ :
installcheck-local:
- test -d $(DESTDIR)$(localstatedir)/lib/dbus
+ :

View File

@@ -1,14 +0,0 @@
diff --git a/configure.ac b/configure.ac
index 24fcc9e..98e0459 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1167,7 +1167,8 @@ else
PKG_CHECK_MODULES(SYSTEMD,
[libsystemd-login >= 32, libsystemd-daemon >= 32],
have_systemd=yes,
- have_systemd=no)
+ have_systemd=yes)
+ AC_MSG_NOTICE([NixOS: do not care whether we found systemd or not])
fi
if test x$have_systemd = xyes; then

View File

@@ -1,18 +0,0 @@
diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c
index b4ecc96..267984a 100644
--- a/dbus/dbus-sysdeps-unix.c
+++ b/dbus/dbus-sysdeps-unix.c
@@ -1635,6 +1635,13 @@ write_credentials_byte (int server_fd,
}
}
+struct ucred
+{
+ pid_t pid; /* PID of sending process. */
+ uid_t uid; /* UID of sending process. */
+ gid_t gid; /* GID of sending process. */
+};
+
/**
* Reads a single byte which must be nul (an error occurs otherwise),
* and reads unix credentials if available. Clears the credentials