summary refs log tree commit diff
path: root/pkgs/desktops
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2018-01-19 13:40:42 +0100
committerGitHub <noreply@github.com>2018-01-19 13:40:42 +0100
commitd2d1a2dfbabaf723ebc2102a3c7baa5138303bc2 (patch)
tree13824f58f2d356b1a8fc58fd79b7f70c77387d76 /pkgs/desktops
parent899714ae964c3e446c2de081bf007ef238c9f3d6 (diff)
parent062cafab8cffa984f6e8b1a287d6a66c83238801 (diff)
downloadnixlib-d2d1a2dfbabaf723ebc2102a3c7baa5138303bc2.tar
nixlib-d2d1a2dfbabaf723ebc2102a3c7baa5138303bc2.tar.gz
nixlib-d2d1a2dfbabaf723ebc2102a3c7baa5138303bc2.tar.bz2
nixlib-d2d1a2dfbabaf723ebc2102a3c7baa5138303bc2.tar.lz
nixlib-d2d1a2dfbabaf723ebc2102a3c7baa5138303bc2.tar.xz
nixlib-d2d1a2dfbabaf723ebc2102a3c7baa5138303bc2.tar.zst
nixlib-d2d1a2dfbabaf723ebc2102a3c7baa5138303bc2.zip
Merge pull request #28882 from jtojnar/chrome-gnome-shell
chrome-gnome-shell: refactor
Diffstat (limited to 'pkgs/desktops')
-rw-r--r--pkgs/desktops/gnome-3/extensions/chrome-gnome-shell/default.nix51
1 files changed, 28 insertions, 23 deletions
diff --git a/pkgs/desktops/gnome-3/extensions/chrome-gnome-shell/default.nix b/pkgs/desktops/gnome-3/extensions/chrome-gnome-shell/default.nix
index bda356cf4c37..11d891b67434 100644
--- a/pkgs/desktops/gnome-3/extensions/chrome-gnome-shell/default.nix
+++ b/pkgs/desktops/gnome-3/extensions/chrome-gnome-shell/default.nix
@@ -1,31 +1,36 @@
-{stdenv, lib, python, dbus, fetchgit, cmake, coreutils, jq, gobjectIntrospection, python27Packages, makeWrapper, gnome3, wrapGAppsHook}:
+{stdenv, fetchurl, cmake, ninja, jq, python3, gnome3, wrapGAppsHook}:
 
-stdenv.mkDerivation rec {
-name="chrome-gnome-shell";
-  src = fetchgit {
-    url = "git://git.gnome.org/chrome-gnome-shell";
-    rev = "7d99523e90805cb65027cc2f5f1191a957dcf276";
-    sha256 = "0qc34dbhsz5yf4z5bx6py08h561rcxw9928drgk9256g3vnygnbc";
-  };
+let
+  version = "9";
 
- buildInputs = [ gnome3.gnome_shell makeWrapper jq dbus gobjectIntrospection
- python python27Packages.requests python27Packages.pygobject3 wrapGAppsHook];
+  inherit (python3.pkgs) python pygobject3 requests;
+in stdenv.mkDerivation rec {
+  name = "chrome-gnome-shell-${version}";
 
- preConfigure = ''
-   mkdir build usr etc
-   cd build
-   ${cmake}/bin/cmake -DCMAKE_INSTALL_PREFIX=$out/usr -DBUILD_EXTENSION=OFF ../
-   substituteInPlace cmake_install.cmake --replace "/etc" "$out/etc"
- '';
+  src = fetchurl {
+    url = "mirror://gnome/sources/chrome-gnome-shell/${version}/${name}.tar.xz";
+    sha256 = "0j6lzlp3jvkpnkk8s99y3m14xiq94rjwjzy2pbfqgv084ahzmz8i";
+  };
 
- postInstall = ''
-    rm $out/etc/opt/chrome/policies/managed/chrome-gnome-shell.json
-    rm $out/etc/chromium/policies/managed/chrome-gnome-shell.json
-    wrapProgram $out/usr/bin/chrome-gnome-shell \
-      --prefix PATH : '"${dbus}/bin"' \
-      --prefix PATH : '"${gnome3.gnome_shell}/bin"' \
-      --prefix PYTHONPATH : "$PYTHONPATH"
+  nativeBuildInputs = [ cmake ninja jq wrapGAppsHook ];
+  buildInputs = [ gnome3.gnome_shell python pygobject3 requests ];
 
+  preConfigure = ''
+    substituteInPlace CMakeLists.txt --replace "/etc" "$out/etc"
   '';
+  # cmake setup hook changes /etc/opt into /var/empty
+  dontFixCmake = true;
 
+  cmakeFlags = [ "-DBUILD_EXTENSION=OFF" ];
+  wrapPrefixVariables = [ "PYTHONPATH" ];
+
+  meta = with stdenv.lib; {
+    description = "GNOME Shell integration for Chrome";
+    longDescription = ''
+      To use the integration, install the <link xlink:href="https://wiki.gnome.org/Projects/GnomeShellIntegrationForChrome/Installation">browser extension</link>, and then set <option>services.gnome3.chrome-gnome-shell.enable</option> to <literal>true</literal>. For Firefox based browsers, you will also need to build the wrappers with <option>nixpkgs.config.firefox.enableGnomeExtensions</option> set to <literal>true</literal>.
+    '';
+    license = licenses.gpl3;
+    maintainers = gnome3.maintainers;
+    platforms = platforms.linux;
+  };
 }