summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2016-06-16 19:18:09 +0000
committerMatthew Bauer <mjbauer95@gmail.com>2016-07-05 20:26:59 +0000
commit4e50880c828a771ab9ea72739bb70017b724358c (patch)
treef037fc9a2f796591b4f616d4f33ea4e1bb35e8b0
parentdedfc00204ba1a35ae620ceb25709d4618bca17a (diff)
downloadnixpkgs-4e50880c828a771ab9ea72739bb70017b724358c.tar
nixpkgs-4e50880c828a771ab9ea72739bb70017b724358c.tar.gz
nixpkgs-4e50880c828a771ab9ea72739bb70017b724358c.tar.bz2
nixpkgs-4e50880c828a771ab9ea72739bb70017b724358c.tar.lz
nixpkgs-4e50880c828a771ab9ea72739bb70017b724358c.tar.xz
nixpkgs-4e50880c828a771ab9ea72739bb70017b724358c.tar.zst
nixpkgs-4e50880c828a771ab9ea72739bb70017b724358c.zip
packagekit: add latest from hughsie's github repo
- currently pulled in from Git until the next release of PackageKit
  has Nix support
- also: add in a service module to start packagekit properly
- nixos service can be enabled via services.packagekit.enable
- packagekit requires nixunstable to build properly
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/services/misc/packagekit.nix61
-rw-r--r--pkgs/tools/package-management/packagekit/default.nix81
-rw-r--r--pkgs/top-level/all-packages.nix4
4 files changed, 104 insertions, 43 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index 67178e765c8..a59997da9d8 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -249,6 +249,7 @@
   ./services/misc/nix-ssh-serve.nix
   ./services/misc/nzbget.nix
   ./services/misc/octoprint.nix
+  ./services/misc/packagekit.nix
   ./services/misc/parsoid.nix
   ./services/misc/phd.nix
   ./services/misc/plex.nix
diff --git a/nixos/modules/services/misc/packagekit.nix b/nixos/modules/services/misc/packagekit.nix
new file mode 100644
index 00000000000..2d1ff7bb411
--- /dev/null
+++ b/nixos/modules/services/misc/packagekit.nix
@@ -0,0 +1,61 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+
+  cfg = config.services.packagekit;
+
+  backend = "nix";
+
+  packagekitConf = ''
+[Daemon]
+DefaultBackend=${backend}
+KeepCache=false
+    '';
+
+  vendorConf = ''
+[PackagesNotFound]
+DefaultUrl=https://github.com/NixOS/nixpkgs
+CodecUrl=https://github.com/NixOS/nixpkgs
+HardwareUrl=https://github.com/NixOS/nixpkgs
+FontUrl=https://github.com/NixOS/nixpkgs
+MimeUrl=https://github.com/NixOS/nixpkgs
+      '';
+
+in
+
+{
+
+  options = {
+
+    services.packagekit = {
+      enable = mkEnableOption
+        ''
+          PackageKit provides a cross-platform D-Bus abstraction layer for
+          installing software. Software utilizing PackageKit can install
+          software regardless of the package manager.
+        '';
+    };
+
+  };
+
+  config = mkIf cfg.enable {
+
+    services.dbus.packages = [ pkgs.packagekit ];
+
+    systemd.services.packagekit = {
+      description = "PackageKit Daemon";
+      wantedBy = [ "multi-user.target" ];
+      serviceConfig.ExecStart = "${pkgs.packagekit}/libexec/packagekitd";
+      serviceConfig.User = "root";
+      serviceConfig.BusName = "org.freedesktop.PackageKit";
+      serviceConfig.Type = "dbus";
+    };
+
+    environment.etc."PackageKit/PackageKit.conf".text = packagekitConf;
+    environment.etc."PackageKit/Vendor.conf".text = vendorConf;
+
+  };
+
+}
diff --git a/pkgs/tools/package-management/packagekit/default.nix b/pkgs/tools/package-management/packagekit/default.nix
index bdd02e58cbb..a56d3f6aebc 100644
--- a/pkgs/tools/package-management/packagekit/default.nix
+++ b/pkgs/tools/package-management/packagekit/default.nix
@@ -1,57 +1,54 @@
-{ stdenv, fetchurl, intltool, glib, pkgconfig, polkit, python, sqlite }:
+{ stdenv, fetchFromGitHub, intltool, glib, pkgconfig, polkit, python, sqlite, systemd
+, gobjectIntrospection, vala, gtk_doc, autoreconfHook, autoconf-archive
+, nix, boost
+, enableCommandNotFound ? false
+, enableBashCompletion ? false, bashCompletion ? null }:
+
+with stdenv.lib;
 
 stdenv.mkDerivation rec {
-  name = "packagekit-${version}";
-  version = "1.1.1";
+  name = "packagekit-2016-06-03";
 
-  src = fetchurl {
-    sha256 = "1i6an483vmm6y39szr2alq5vf6kfxhk3j5ca79qrshcj9jjlhcs8";
-    url = "http://www.freedesktop.org/software/PackageKit/releases/PackageKit-${version}.tar.xz";
+  src = fetchFromGitHub {
+    owner = "hughsie";
+    repo = "PackageKit";
+    rev = "99fd83bbb26badf43c6a17a9f0c6dc054c7484c8";
+    sha256 = "0y42vl6r1wh57sbjfkn4khjs78q54wshf4p0v4nly9s7hydxpi6a";
   };
 
-  buildInputs = [ glib polkit python ];
-  propagatedBuildInputs = [ sqlite ];
-  nativeBuildInputs = [ intltool pkgconfig ];
+  buildInputs = [ glib polkit systemd python gobjectIntrospection vala ]
+                  ++ optional enableBashCompletion bashCompletion;
+  propagatedBuildInputs = [ sqlite nix boost ];
+  nativeBuildInputs = [ intltool pkgconfig autoreconfHook autoconf-archive gtk_doc ];
+
+  preAutoreconf = ''
+    gtkdocize
+    intltoolize
+  '';
 
   configureFlags = [
-    "--disable-static"
-    "--disable-python3"
-    "--disable-networkmanager"
-    "--disable-connman"
-    "--disable-systemd"
-    "--disable-bash-completion"
-    "--disable-gstreamer-plugin"
-    "--disable-gtk-module"
-    "--disable-command-not-found"
+    "--enable-systemd"
+    "--enable-nix"
+    "--disable-dummy"
     "--disable-cron"
-    "--disable-daemon-tests"
-    "--disable-alpm"
-    "--disable-aptcc"
-    "--enable-dummy"
-    "--disable-entropy"
-    "--disable-hif"
-    "--disable-pisi"
-    "--disable-poldek"
-    "--disable-portage"
-    "--disable-ports"
-    "--disable-katja"
-    "--disable-urpmi"
-    "--disable-yum"
-    "--disable-zypp"
-  ];
+    "--disable-introspection"
+    "--disable-offline-update"
+    "--localstatedir=/var"
+    "--sysconfdir=/etc"
+    "--with-dbus-sys=$(out)/etc/dbus-1/system.d"
+    "--with-systemdsystemunitdir=$(out)/lib/systemd/system/"
+  ]
+  ++ optional (!enableBashCompletion) "--disable-bash-completion"
+  ++ optional (!enableCommandNotFound) "--disable-command-not-found";
 
   enableParallelBuilding = true;
 
-  preInstall = ''
-    # Don't install anything to e.g. $out/var/cache:
-    for dir in src data; do
-      substituteInPlace $dir/Makefile \
-        --replace " install-data-hook" "" \
-        --replace " install-databaseDATA" ""
-    done
-  '';
+  installFlags = [
+    "sysconfdir=\${out}/etc"
+    "localstatedir=\${TMPDIR}"
+  ];
 
-  meta = with stdenv.lib; {
+  meta = {
     description = "System to facilitate installing and updating packages";
     longDescription = ''
       PackageKit is a system designed to make installing and updating software
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index b056fa69990..37d0b23f45a 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -2877,7 +2877,9 @@ in
 
   p7zip = callPackage ../tools/archivers/p7zip { };
 
-  packagekit = callPackage ../tools/package-management/packagekit { };
+  packagekit = callPackage ../tools/package-management/packagekit {
+    nix = nixUnstable;
+  };
 
   pal = callPackage ../tools/misc/pal { };