nixpkgs/pkgs/desktops/gnome-3/extensions/chrome-gnome-shell/default.nix
Jan Tojnar 5df7471c14
chrome-gnome-shell: Fix missing introspection data
It was crashing with:

    TypeError: gobject `__main__+ChromeGNOMEShell' doesn't support property `application_id'

– that is the constructor of parent class Gio.Application does not recognize the kwarg.

This is typically caused by missing pygobject overrides but I think ones for Gio are built-in into pygobject.

Even weirder, adding just `${gobject-introspection}/lib/girepository-1.0` seems to fix the issue so it might be missing the whole typelib.
But then why does not it fail when importing it?

	from gi.repository import GLib, Gio

For now, I am adding the Gio typelib which should been done from the start but more debugging should be done since weirdness like this can bring more bugs.

Fixes: https://github.com/NixOS/nixpkgs/issues/87740
2020-05-13 17:02:53 +02:00

71 lines
1.6 KiB
Nix

{ stdenv
, fetchurl
, cmake
, ninja
, jq
, python3
, gnome3
, wrapGAppsHook
, gobject-introspection
}:
let
inherit (python3.pkgs) python pygobject3 requests;
in
stdenv.mkDerivation rec {
pname = "chrome-gnome-shell";
version = "10.1";
src = fetchurl {
url = "mirror://gnome/sources/chrome-gnome-shell/${version}/${pname}-${version}.tar.xz";
sha256 = "0f54xyamm383ypbh0ndkza0pif6ljddg2f947p265fkqj3p4zban";
};
nativeBuildInputs = [
cmake
ninja
jq
wrapGAppsHook
gobject-introspection # for setup-hook
];
buildInputs = [
gnome3.gnome-shell
python
pygobject3
requests
gobject-introspection # for Gio typelib
];
cmakeFlags = [
"-DBUILD_EXTENSION=OFF"
];
wrapPrefixVariables = [
"PYTHONPATH"
];
# cmake setup hook changes /etc/opt into /var/empty
dontFixCmake = true;
preConfigure = ''
substituteInPlace CMakeLists.txt --replace "/etc" "$out/etc"
'';
passthru = {
updateScript = gnome3.updateScript {
packageName = "chrome-gnome-shell";
};
};
meta = with stdenv.lib; {
description = "GNOME Shell integration for Chrome";
homepage = "https://wiki.gnome.org/Projects/GnomeShellIntegrationForChrome";
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>.
'';
license = licenses.gpl3;
maintainers = teams.gnome.members;
platforms = platforms.linux;
};
}