Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gnome-shell-extensions-3.28 are broken on unstable #38377

Closed
hedning opened this issue Apr 3, 2018 · 7 comments · Fixed by #38390
Closed

gnome-shell-extensions-3.28 are broken on unstable #38377

hedning opened this issue Apr 3, 2018 · 7 comments · Fixed by #38390
Labels
0.kind: bug 6.topic: GNOME GNOME desktop environment and its underlying platform

Comments

@hedning
Copy link
Contributor

hedning commented Apr 3, 2018

Issue description

The meson build doesn't compile the schemas, opting to do it instead in a package shell script. Unfortunately it seems that compiling the schemas aren't enough to make all the extensions work. In particular at least user-theme and apps-menu still won't work (seems to fix window-list though).

With the schemas installed Tweaks simply complains that the user-theme extension is incorrectly installed.

apps-menu complains about lacking any typelib file for GMenu.

I'm not sure how well these extensions worked before 3.28, but a report on irc indicated that user-theme at least worked before.

cc @jtojnar

Steps to reproduce

Run Tweaks on nixos-unstable, try to enable eg. the User Themes extension under Extensions or Applications Menu.

Technical details

Running a schema fix on top of 80e730c

  • system: "x86_64-linux"
  • host os: Linux 4.15.14, NixOS, 18.09.git.e1635e06580 (Jellyfish)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.0
  • channels(hed): "unstable-18.03pre126246.a4f433c03cc"
  • channels(root): "nixos-17.09.2498.a9ffb7b0b5a"
  • nixpkgs: /home/hed/nixpkgs/channel
@jtojnar
Copy link
Member

jtojnar commented Apr 3, 2018

The user-theme extension works for me when I manually change the directory structure to:

result
└── share
   └── gnome-shell
      └── extensions
         ├── alternate-tab@gnome-shell-extensions.gcampax.github.com
         │  ├── convenience.js
         │  ├── extension.js
         │  ├── metadata.json
         │  ├── prefs.js
         │  └── stylesheet.css
         ├── apps-menu@gnome-shell-extensions.gcampax.github.com
         │  ├── convenience.js
         │  ├── extension.js
         │  ├── metadata.json
         │  └── stylesheet.css
         ├── auto-move-windows@gnome-shell-extensions.gcampax.github.com
         │  ├── convenience.js
         │  ├── extension.js
         │  ├── metadata.json
         │  ├── prefs.js
         │  ├── schemas
         │  │  ├── gschemas.compiled
         │  │  └── org.gnome.shell.extensions.auto-move-windows.gschema.xml
         │  └── stylesheet.css
         ├── drive-menu@gnome-shell-extensions.gcampax.github.com
         │  ├── convenience.js
         │  ├── extension.js
         │  ├── metadata.json
         │  └── stylesheet.css
         ├── example@gnome-shell-extensions.gcampax.github.com
         │  ├── convenience.js
         │  ├── extension.js
         │  ├── metadata.json
         │  ├── prefs.js
         │  ├── schemas
         │  │  ├── gschemas.compiled
         │  │  └── org.gnome.shell.extensions.example.gschema.xml
         │  └── stylesheet.css
         ├── launch-new-instance@gnome-shell-extensions.gcampax.github.com
         │  ├── convenience.js
         │  ├── extension.js
         │  ├── metadata.json
         │  └── stylesheet.css
         ├── native-window-placement@gnome-shell-extensions.gcampax.github.com
         │  ├── convenience.js
         │  ├── extension.js
         │  ├── metadata.json
         │  ├── schemas
         │  │  ├── gschemas.compiled
         │  │  └── org.gnome.shell.extensions.native-window-placement.gschema.xml
         │  └── stylesheet.css
         ├── places-menu@gnome-shell-extensions.gcampax.github.com
         │  ├── convenience.js
         │  ├── extension.js
         │  ├── metadata.json
         │  ├── placeDisplay.js
         │  └── stylesheet.css
         ├── screenshot-window-sizer@gnome-shell-extensions.gcampax.github.com
         │  ├── convenience.js
         │  ├── extension.js
         │  ├── metadata.json
         │  ├── schemas
         │  │  ├── gschemas.compiled
         │  │  └── org.gnome.shell.extensions.screenshot-window-sizer.gschema.xml
         │  └── stylesheet.css
         ├── user-theme@gnome-shell-extensions.gcampax.github.com
         │  ├── convenience.js
         │  ├── extension.js
         │  ├── metadata.json
         │  ├── schemas
         │  │  ├── gschemas.compiled
         │  │  └── org.gnome.shell.extensions.user-theme.gschema.xml
         │  └── stylesheet.css
         ├── window-list@gnome-shell-extensions.gcampax.github.com
         │  ├── convenience.js
         │  ├── extension.js
         │  ├── metadata.json
         │  ├── prefs.js
         │  ├── schemas
         │  │  ├── gschemas.compiled
         │  │  └── org.gnome.shell.extensions.window-list.gschema.xml
         │  └── stylesheet.css
         ├── windowsNavigator@gnome-shell-extensions.gcampax.github.com
         │  ├── convenience.js
         │  ├── extension.js
         │  ├── metadata.json
         │  └── stylesheet.css
         └── workspace-indicator@gnome-shell-extensions.gcampax.github.com
            ├── convenience.js
            ├── extension.js
            ├── metadata.json
            ├── prefs.js
            └── stylesheet.css

As for the apps-menu, I removed gnome-menus from gnome-shell dependencies so that might explain this failure. The extension should probably be fixed like #36410.

@jtojnar jtojnar added 0.kind: bug 6.topic: GNOME GNOME desktop environment and its underlying platform labels Apr 3, 2018
@hedning
Copy link
Contributor Author

hedning commented Apr 3, 2018

You're able to switch switch themes in Appearance -> Shell in Tweaks? Might be something wrong on my end.

I'll submit a PR fixing the schemas at least.

@hedning
Copy link
Contributor Author

hedning commented Apr 3, 2018

Testing out a fix for apps-menu.

@jtojnar
Copy link
Member

jtojnar commented Apr 3, 2018

Hmm, I can enable it but the theme switching does not work. I seems to require the extension schemas in XDG_DATA_DIRS when running Tweaks. Maybe it got picked up from global XDG_DATA_DIRS for bash users, but the option was always disabled for me with fish.

@jtojnar
Copy link
Member

jtojnar commented Apr 3, 2018

We might want to add gnome-shell-extensions as a dependency to Tweaks so that it could work for non-bash users. Then we will need to fix the schemas:

  1. Keep the schemas in $out/share/glib-2.0/schemas and find a hack similar to gnomeExtensions.system-monitor: fix this package and upgrade to v33 #36410 to add the schemas path to the extension.
  2. Something like the following to put the schemas where extensions can find them and add symlink for Tweaks.
--- a/pkgs/desktops/gnome-3/core/gnome-shell-extensions/default.nix
+++ b/pkgs/desktops/gnome-3/core/gnome-shell-extensions/default.nix
@@ -21,6 +21,26 @@
   nativeBuildInputs = [ meson ninja pkgconfig gettext glib ];
   buildInputs = [ spidermonkey_52 ];
 
+  postInstall = let
+    extensionsWithSchemas = [
+      "auto-move-windows"
+      "example"
+      "native-window-placement"
+      "screenshot-window-sizer"
+      "user-theme"
+      "window-list"
+    ];
+  in ''
+    for e in ${stdenv.lib.concatStringsSep " " extensionsWithSchemas}; do
+      schemadir="$out/share/gnome-shell/extensions/''${e}@gnome-shell-extensions.gcampax.github.com/schemas"
+      mkdir "$schemadir"
+      mv "$out/share/glib-2.0/schemas/org.gnome.shell.extensions.''${e}.gschema.xml" "$schemadir"
+      glib-compile-schemas "$schemadir"
+    done
+    ln -s "$out/share/gnome-shell/extensions/user-theme@gnome-shell-extensions.gcampax.github.com/schemas/org.gnome.shell.extensions.user-theme.gschema.xml" $out/share/glib-2.0/schemas
+    glib-compile-schemas  $out/share/glib-2.0/schemas
+  '';
+
   mesonFlags = [ "-Dextension_set=all" ];
 
   meta = with stdenv.lib; {
  1. The same thing as the second point but accomplished by patching meson.build files.

@hedning
Copy link
Contributor Author

hedning commented Apr 3, 2018

Your suggested fix worked for apps-menu at least :) 9a22ff414aef602888f2f903fc3d3d8328b7a8bc

I went with basically adding the code from export-zips.sh to preFixup to fix the schema problem. Generating the directory structure you quoted above seems the most sane and keeping with upstream.

Tested things out in a vm with bash, and user-theme didn't seem to work there either. So not sure if the problem is non bash. Anyway, adding gnome-shell-extensions to gnome-tweaks buildInputs fixes user-theme, so I think that's appropriate.

I should've got everything now, will submit a PR :)

@jtojnar
Copy link
Member

jtojnar commented Apr 3, 2018

I think it only works in bash and globally installed packages or something. I would not rely on it since I consider it an ugly impurity.

I would prefer the first solution since it will be the cleanest and could be possibly automated in the future, but number two is fine too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug 6.topic: GNOME GNOME desktop environment and its underlying platform
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants