NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.38k stars 13.6k forks source link

Missing icons in Gajim #330506

Open werner291 opened 1 month ago

werner291 commented 1 month ago

Describe the bug

There are icons missing in Gajim.

The one appearing in the screenshot should be user-info-symbolic which is found in the gnome-icon-theme-symbolic package.

It was not in nixpkgs, but I believe I got a package compiling?

See: https://github.com/werner291/nixpkgs/tree/master/pkgs/data/icons/gnome-icon-theme-symbolic

Following the lead of the Arch Linux package of the same name, I added this env.GTK_UPDATE_ICON_CACHE = "${coreutils}/bin/true"; horrible hack to patch out the gtk-update-icon-cache because that pack doesn't have a theme index, whatever that might be.

Unfortunately, the icons don't appear in Gajim despite adding that to the build-inputs... I'm stuck at that point. (I suspect my "hack" broke it; I'm kinda just doing what Arch did)

Steps To Reproduce

Steps to reproduce the behavior:

  1. Set up a NixOS system with Plasma 5 and Gajim.

Expected behavior

Icons show up.

Screenshots

image

Additional context

Add any other context about the problem here.

Notify maintainers

@abbradar

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.34, NixOS, 24.11 (Vicuna), 24.11.20240620.d603719`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - nixpkgs: `/nix/store/xfpiyfgf6y30fxk5ngv0cjn474qfr3sj-source`

Add a :+1: reaction to issues you find important.

werner291 commented 1 month ago

I have a hypothesis...

In Arch, that hack works fine because the system is managed imperatively, and that icon database update will happen eventually. In Nix(OS), purity prevents that from working. Instead, we get that the icon database is not updated.

There's an option in gtk-update-icon-cache to not require a theme index; worth a shot maybe?

werner291 commented 1 month ago

Changed it to env.GTK_UPDATE_ICON_CACHE = "${pkgs.gtk3}/bin/gtk-update-icon-cache --ignore-theme-index";

Icons do not show up either.

Not sure what to do at this point; I need someone who knows gtk better, I'm just throwing stuff at the wall to see what sticks.

werner291 commented 1 month ago

FYI, I'm testing it with a flake based on the package in nixpkgs, does that matter?

{
  description = "A very basic flake";

  inputs = {
    nixpkgs.url = "github:werner291/nixpkgs?ref=master";
  };

  outputs =
    { self, nixpkgs }:
    let
      system = "x86_64-linux";
      pkgs = nixpkgs.legacyPackages.${system};
      enableJingle = true;
      enableE2E = true;
      enableSecrets = true;
      enableRST = true;
      enableSpelling = true;
      enableUPnP = true;
      enableAppIndicator = true;
    in
    {
      formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;

      packages.x86_64-linux.default = with pkgs; with gst_all_1; python3.pkgs.buildPythonApplication {
        pname = "gajim";
        version = "1.9.2";

        src = ./.; # This is just the Gajim repo

        format = "pyproject";

        buildInputs = [
          gtk3
          gnome.adwaita-icon-theme
          gnome-icon-theme-symbolic # <- Note my addition here
          gtksourceview4
          glib-networking
        ] ++ lib.optionals enableJingle [ farstream gstreamer gst-plugins-base gst-libav gst-plugins-good libnice ]
        ++ lib.optional enableSecrets libsecret
        ++ lib.optional enableSpelling gspell
        ++ lib.optional enableUPnP gupnp-igd
        ++ lib.optional enableAppIndicator libappindicator-gtk3;

        nativeBuildInputs = [
          gettext
          wrapGAppsHook3
          gobject-introspection
        ];

        dontWrapGApps = true;

        preFixup = ''
          makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
        '';

        propagatedBuildInputs = with python3.pkgs; [
          nbxmpp
          pygobject3
          dbus-python
          pillow
          css-parser
          precis-i18n
          keyring
          setuptools
          packaging
          gssapi
          omemo-dr
          qrcode
          sqlalchemy
          emoji
        ] ++ lib.optionals enableE2E [ pycrypto python-gnupg ]
        ++ lib.optional enableRST docutils;
        #         ++ extraPythonPackages python3.pkgs;

        #   nativeCheckInputs = with pkgs;[ xvfb-run dbus ];

        preBuild = ''
          python pep517build/build_metadata.py -o dist/metadata
        '';

        postInstall = ''
          python pep517build/install_metadata.py dist/metadata --prefix=$out
        '';

        checkPhase = with pkgs; ''
          xvfb-run dbus-run-session \
          --config-file=${dbus}/share/dbus-1/session.conf \
          ${python3.interpreter} -m unittest discover -s test/gui -v
          ${python3.interpreter} -m unittest discover -s test/common -v
        '';

        # test are broken in 1.7.3, 1.8.0
        doCheck = false;

        # necessary for wrapGAppsHook3
        strictDeps = false;

        meta = {
          homepage = "http://gajim.org/";
          description = "Jabber client written in PyGTK";
          license = lib.licenses.gpl3Plus;
          maintainers = with lib.maintainers; [ raskin abbradar ];
          downloadPage = "http://gajim.org/download/";
          platforms = lib.platforms.linux;
          mainProgram = "gajim";
        };

        GIO_EXTRA_MODULES = [ "${pkgs.glib-networking.out}/lib/gio/modules" ];

      };
    };
}