summary refs log tree commit diff
path: root/pkgs/development/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r--pkgs/development/libraries/dbus-glib/default.nix2
-rw-r--r--pkgs/development/libraries/dbus/default.nix122
-rw-r--r--pkgs/development/libraries/dbus/no-create-dirs.patch26
-rw-r--r--pkgs/development/libraries/dbus/ucred-dirty-hack.patch18
-rw-r--r--pkgs/development/libraries/gvfs/default.nix2
-rw-r--r--pkgs/development/libraries/policykit/default.nix2
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/default.nix2
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtbase.nix4
-rw-r--r--pkgs/development/libraries/qt-5/5.5/qtbase/default.nix4
9 files changed, 53 insertions, 129 deletions
diff --git a/pkgs/development/libraries/dbus-glib/default.nix b/pkgs/development/libraries/dbus-glib/default.nix
index 28df5593695..1d91faa6817 100644
--- a/pkgs/development/libraries/dbus-glib/default.nix
+++ b/pkgs/development/libraries/dbus-glib/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ expat libiconv ];
 
-  propagatedBuildInputs = [ dbus.libs glib ];
+  propagatedBuildInputs = [ dbus glib ];
 
   doCheck = true;
 
diff --git a/pkgs/development/libraries/dbus/default.nix b/pkgs/development/libraries/dbus/default.nix
index 4a0f98d262a..b569fc187e2 100644
--- a/pkgs/development/libraries/dbus/default.nix
+++ b/pkgs/development/libraries/dbus/default.nix
@@ -1,5 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, autoconf, automake, libtool
-, expat, systemd, glib, dbus_glib, python
+{ stdenv, lib, fetchurl, pkgconfig, expat, systemd, glib, dbus_glib, python
 , libX11 ? null, libICE ? null, libSM ? null, x11Support ? (stdenv.isLinux || stdenv.isDarwin) }:
 
 assert x11Support -> libX11 != null
@@ -10,107 +9,76 @@ let
   version = "1.8.20";
   sha256 = "0fkh3d5r57a659hw9lqnw4v0bc5556vx54fsf7l9c732ci6byksw";
 
-  inherit (stdenv) lib;
-
-  buildInputsX = lib.optionals x11Support [ libX11 libICE libSM ];
-
-  # also other parts than "libs" need this statically linked lib
-  makeInternalLib = "(cd dbus && make libdbus-internal.la)";
-
-  systemdOrEmpty = lib.optional stdenv.isLinux systemd;
-
-  # A generic builder for individual parts (subdirs) of D-Bus
-  dbus_drv = name: subdirs: merge: stdenv.mkDerivation (lib.mergeAttrsByFuncDefaultsClean [{
-
-    name = "dbus-${name}-${version}";
+self =  stdenv.mkDerivation {
+    name = "dbus-${version}";
 
     src = fetchurl {
       url = "http://dbus.freedesktop.org/releases/dbus/dbus-${version}.tar.gz";
       inherit sha256;
     };
 
-    patches = [
-        ./ignore-missing-includedirs.patch
-        ./ucred-dirty-hack.patch
-        ./no-create-dirs.patch
-      ]
-      ++ lib.optional (stdenv.isSunOS || stdenv.isLinux) ./implement-getgrouplist.patch
-      ;
-
-    # 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
-        '';
+    patches = [ ./ignore-missing-includedirs.patch ]
+      ++ lib.optional stdenv.isSunOS ./implement-getgrouplist.patch;
+    postPatch = ''
+      substituteInPlace tools/Makefile.in \
+        --replace 'install-localstatelibDATA:' 'disabled:' \
+        --replace 'install-data-local:' 'disabled:' \
+        --replace 'installcheck-local:' 'disabled:'
+      substituteInPlace bus/Makefile.in \
+        --replace '$(mkinstalldirs) $(DESTDIR)$(localstatedir)/run/dbus' ':'
+    '' + /* cleanup of runtime references */ ''
+      substituteInPlace ./dbus/dbus-sysdeps-unix.c \
+        --replace 'DBUS_BINDIR "/dbus-launch"' "\"$lib/bin/dbus-launch\""
+      substituteInPlace ./tools/dbus-launch.c \
+        --replace 'DBUS_DAEMONDIR"/dbus-daemon"' '"/run/current-system/sw/bin/dbus-daemon"'
+    '';
+
+    outputs = [ "dev" "out" "lib" "doc" ];
 
     nativeBuildInputs = [ pkgconfig ];
     propagatedBuildInputs = [ expat ];
-    buildInputs = [ autoconf automake libtool ]; # ToDo: optional selinux?
-
-    preConfigure = ''
-      patchShebangs .
-      substituteInPlace tools/Makefile.am --replace 'install-localstatelibDATA:' 'disabled:'
-      autoreconf -fi
-    '';
+    buildInputs = lib.optional stdenv.isLinux systemd
+      ++ lib.optionals x11Support [ libX11 libICE libSM ];
+    # ToDo: optional selinux?
 
     configureFlags = [
       "--localstatedir=/var"
       "--sysconfdir=/etc"
       "--with-session-socket-dir=/tmp"
       "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
+      # this package installs nothing into those dirs and they create a dependency
+      "--datadir=/run/current-system/sw/share"
+      "--libexecdir=$(out)/libexec" # we don't need dbus-daemon-launch-helper
     ] ++ lib.optional (!x11Support) "--without-x";
 
-    enableParallelBuilding = true;
-
-    doCheck = true;
-
-    installFlags = "sysconfdir=$(out)/etc";
-
-  } merge ]);
-
-  libs = dbus_drv "libs" "dbus" {
     # 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";
-    buildInputs = [ systemdOrEmpty ];
-    meta.platforms = stdenv.lib.platforms.all;
-  };
-
-
-  attrs = rec {
-  # If you change much fix indentation
+    NIX_CFLAGS_LINK = lib.optionalString (!stdenv.isDarwin) "-Wl,--as-needed";
 
-  # 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 .
+    enableParallelBuilding = true;
 
-  inherit libs;
+    doCheck = true;
 
-  tools = dbus_drv "tools" "tools bus" {
-    preBuild = makeInternalLib;
-    buildInputs = buildInputsX ++ systemdOrEmpty ++ [ libs ];
-    NIX_CFLAGS_LINK =
-      stdenv.lib.optionalString (!stdenv.isDarwin) "-Wl,--as-needed "
-      + "-ldbus-1";
+    installFlags = "sysconfdir=$(out)/etc datadir=$(out)/share";
 
-    # don't provide another dbus-1.pc (with incorrect include and link dirs),
-    # also remove useless empty dirs
-    postInstall = ''
-      rm "$out"/lib/pkgconfig/dbus-1.pc
-      rmdir --parents --ignore-fail-on-non-empty "$out"/{lib/pkgconfig,share/dbus-1/*}
+    # it's executed from $lib by absolute path
+    postFixup = ''
+      _moveToOutput bin/dbus-launch "$lib"
+      ln -s "$lib/bin/dbus-launch" "$out/bin/"
     '';
 
-    meta.platforms = with stdenv.lib.platforms; allBut darwin;
-  };
-
-  daemon = tools;
+    passthru = {
+      dbus-launch = "${self.lib}/bin/dbus-launch";
+      daemon = self.out;
+    };
 
-  docs = dbus_drv "docs" "doc" {
-    postInstall = ''rm -r "$out/lib"'';
+    meta = with stdenv.lib; {
+      description = "Simple interprocess messaging system";
+      homepage = http://www.freedesktop.org/wiki/Software/dbus/;
+      license = licenses.gpl2Plus; # most is also under AFL-2.1
+      platforms = platforms.unix;
+    };
   };
-};
-in attrs.libs // attrs
+in self
 
diff --git a/pkgs/development/libraries/dbus/no-create-dirs.patch b/pkgs/development/libraries/dbus/no-create-dirs.patch
deleted file mode 100644
index cf10d977599..00000000000
--- a/pkgs/development/libraries/dbus/no-create-dirs.patch
+++ /dev/null
@@ -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
-+	:
diff --git a/pkgs/development/libraries/dbus/ucred-dirty-hack.patch b/pkgs/development/libraries/dbus/ucred-dirty-hack.patch
deleted file mode 100644
index a07abcc15fb..00000000000
--- a/pkgs/development/libraries/dbus/ucred-dirty-hack.patch
+++ /dev/null
@@ -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
diff --git a/pkgs/development/libraries/gvfs/default.nix b/pkgs/development/libraries/gvfs/default.nix
index d2a958faed8..37403f50e2b 100644
--- a/pkgs/development/libraries/gvfs/default.nix
+++ b/pkgs/development/libraries/gvfs/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig intltool libtool ];
 
   buildInputs =
-    [ makeWrapper glib dbus.libs udev libgudev udisks2 libgcrypt
+    [ makeWrapper glib dbus udev libgudev udisks2 libgcrypt
       libgphoto2 avahi libarchive fuse libcdio
       libxml2 libxslt docbook_xsl samba libmtp
       # ToDo: a ligther version of libsoup to have FTP/HTTP support?
diff --git a/pkgs/development/libraries/policykit/default.nix b/pkgs/development/libraries/policykit/default.nix
index f494710be63..9f8b702f897 100644
--- a/pkgs/development/libraries/policykit/default.nix
+++ b/pkgs/development/libraries/policykit/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   buildInputs =
     [ pkgconfig glib dbus_glib pam intltool gettext libxslt ];
 
-  propagatedBuildInputs = [ expat dbus.libs ];
+  propagatedBuildInputs = [ expat dbus ];
 
   configureFlags = "--localstatedir=/var --sysconfdir=/etc";
 
diff --git a/pkgs/development/libraries/qt-4.x/4.8/default.nix b/pkgs/development/libraries/qt-4.x/4.8/default.nix
index 85ce97344a3..ccc486692e2 100644
--- a/pkgs/development/libraries/qt-4.x/4.8/default.nix
+++ b/pkgs/development/libraries/qt-4.x/4.8/default.nix
@@ -117,7 +117,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs =
     [ libXrender libXrandr libXinerama libXcursor libXext libXfixes libXv libXi
-      libSM zlib libpng openssl dbus.libs freetype fontconfig glib ]
+      libSM zlib libpng openssl dbus freetype fontconfig glib ]
         # Qt doesn't directly need GLU (just GL), but many apps use, it's small and doesn't remain a runtime-dep if not used
     ++ optional mesaSupported mesa_glu
     ++ optional ((buildWebkit || buildMultimedia) && stdenv.isLinux ) alsaLib
diff --git a/pkgs/development/libraries/qt-5/5.4/qtbase.nix b/pkgs/development/libraries/qt-5/5.4/qtbase.nix
index c333298e458..652814a3fd1 100644
--- a/pkgs/development/libraries/qt-5/5.4/qtbase.nix
+++ b/pkgs/development/libraries/qt-5/5.4/qtbase.nix
@@ -71,7 +71,7 @@ stdenv.mkDerivation {
       ./0006-tzdir.patch
       (substituteAll { src = ./0010-dlopen-libXcursor.patch; libXcursor = libXcursor.out; })
       (substituteAll { src = ./0011-dlopen-openssl.patch; openssl = openssl.out; })
-      (substituteAll { src = ./0012-dlopen-dbus.patch; dbus_libs = dbus.libs.out; })
+      (substituteAll { src = ./0012-dlopen-dbus.patch; dbus_libs = dbus.lib; })
       ./0013-xdg_config_dirs.patch
     ] ++ optional mesaSupported
       (substituteAll { src = ./0014-mkspecs-libgl.patch; mesa_inc = mesa.dev; mesa_lib = mesa.out; })
@@ -166,7 +166,7 @@ stdenv.mkDerivation {
 
   propagatedBuildInputs = [
     xorg.libXcomposite libX11 libxcb libXext libXrender libXi
-    fontconfig freetype openssl dbus.libs glib udev libxml2 libxslt pcre
+    fontconfig freetype openssl dbus glib udev libxml2 libxslt pcre
     zlib libjpeg libpng libtiff sqlite icu
     xcbutil xcbutilimage xcbutilkeysyms xcbutilwm libxkbcommon
   ]
diff --git a/pkgs/development/libraries/qt-5/5.5/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.5/qtbase/default.nix
index 4137a83754b..1aba5c98d9c 100644
--- a/pkgs/development/libraries/qt-5/5.5/qtbase/default.nix
+++ b/pkgs/development/libraries/qt-5/5.5/qtbase/default.nix
@@ -81,7 +81,7 @@ stdenv.mkDerivation {
         };
         dlopen-dbus = substituteAll {
           src = ./0007-dlopen-dbus.patch;
-          dbus_libs = dbus.libs.out;
+          dbus_libs = dbus.lib;
         };
         xdg-config-dirs = ./0008-xdg-config-dirs.patch;
         decrypt-ssl-traffic = ./0009-decrypt-ssl-traffic.patch;
@@ -187,7 +187,7 @@ stdenv.mkDerivation {
 
   propagatedBuildInputs = [
     xlibs.libXcomposite libX11 libxcb libXext libXrender libXi
-    fontconfig freetype openssl dbus.libs glib udev libxml2 libxslt pcre
+    fontconfig freetype openssl dbus glib udev libxml2 libxslt pcre
     zlib libjpeg libpng libtiff sqlite icu
     xcbutil xcbutilimage xcbutilkeysyms xcbutilwm libxkbcommon
   ]