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

shutter: wrap XDG_DATA_DIRS with hicolor-icon-theme #39913

Merged
merged 1 commit into from May 4, 2018

Conversation

Ma27
Copy link
Member

@Ma27 Ma27 commented May 3, 2018

Motivation for this change

When opening shutter it adds an indicator icon to the status bar.
However this doesn't happen (and an ugly default icon will be used) if
shutter can't find the hicolor-icon-theme. In such a case a warning
like this can be found in stderr:

Gtk-WARNING **: Could not find the icon 'image-png'. The 'hicolor' theme
was not found either, perhaps you need to install it.

As I don't think that we should force users to install this theme
globally and several other packages including tor-browser, gparted
or clawsmail add hicolor-icon-theme to their closure this seems to
be a fair measure.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: shutter

Partial log (click to expand)

/nix/store/jj6xv21s1z2x8nr6q660jd8gkhm29bd2-shutter-0.94/share/shutter/resources/system/plugins/shell/sptrim/sptrim: interpreter directive changed from " /usr/bin/env bash" to "/nix/store/xn5gv3lpfy91yvfy9b0i7klfcxh9xskz-bash-4.4-p19/bin/bash"
/nix/store/jj6xv21s1z2x8nr6q660jd8gkhm29bd2-shutter-0.94/share/shutter/resources/system/plugins/shell/sptornedpaper/sptornedpaper: interpreter directive changed from " /usr/bin/env bash" to "/nix/store/xn5gv3lpfy91yvfy9b0i7klfcxh9xskz-bash-4.4-p19/bin/bash"
/nix/store/jj6xv21s1z2x8nr6q660jd8gkhm29bd2-shutter-0.94/share/shutter/resources/system/plugins/shell/spgrayscale/spgrayscale: interpreter directive changed from " /usr/bin/env bash" to "/nix/store/xn5gv3lpfy91yvfy9b0i7klfcxh9xskz-bash-4.4-p19/bin/bash"
/nix/store/jj6xv21s1z2x8nr6q660jd8gkhm29bd2-shutter-0.94/share/shutter/resources/system/plugins/shell/spsoftedges/spsoftedges: interpreter directive changed from " /usr/bin/env bash" to "/nix/store/xn5gv3lpfy91yvfy9b0i7klfcxh9xskz-bash-4.4-p19/bin/bash"
/nix/store/jj6xv21s1z2x8nr6q660jd8gkhm29bd2-shutter-0.94/share/shutter/resources/system/plugins/shell/spsunk/spsunk: interpreter directive changed from " /usr/bin/env bash" to "/nix/store/xn5gv3lpfy91yvfy9b0i7klfcxh9xskz-bash-4.4-p19/bin/bash"
/nix/store/jj6xv21s1z2x8nr6q660jd8gkhm29bd2-shutter-0.94/share/shutter/resources/system/plugins/shell/spoffset/spoffset: interpreter directive changed from " /usr/bin/env bash" to "/nix/store/xn5gv3lpfy91yvfy9b0i7klfcxh9xskz-bash-4.4-p19/bin/bash"
/nix/store/jj6xv21s1z2x8nr6q660jd8gkhm29bd2-shutter-0.94/share/shutter/resources/system/plugins/shell/spraise/spraise: interpreter directive changed from " /usr/bin/env bash" to "/nix/store/xn5gv3lpfy91yvfy9b0i7klfcxh9xskz-bash-4.4-p19/bin/bash"
/nix/store/jj6xv21s1z2x8nr6q660jd8gkhm29bd2-shutter-0.94/bin/.shutter-wrapped: interpreter directive changed from " /usr/bin/perl" to "/nix/store/cxdmh98g0lvl1dyq304c1lq7f90dh01f-perl-5.24.3/bin/perl"
checking for references to /build in /nix/store/jj6xv21s1z2x8nr6q660jd8gkhm29bd2-shutter-0.94...
/nix/store/jj6xv21s1z2x8nr6q660jd8gkhm29bd2-shutter-0.94

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: shutter

Partial log (click to expand)

/nix/store/lzq1a4gih4yswdvc5rkdbzdygj52g8f9-shutter-0.94/share/shutter/resources/system/plugins/shell/spgrayscale/spgrayscale: interpreter directive changed from " /usr/bin/env bash" to "/nix/store/a4qslf0yfs44mhnbagarn232sjnckhy0-bash-4.4-p19/bin/bash"
/nix/store/lzq1a4gih4yswdvc5rkdbzdygj52g8f9-shutter-0.94/share/shutter/resources/system/plugins/perl/spwatermark/spwatermark: interpreter directive changed from " /usr/bin/env perl" to "/nix/store/13fsgz2l89qflb0ycc5lyxgigpral6g6-perl-5.24.3/bin/perl"
/nix/store/lzq1a4gih4yswdvc5rkdbzdygj52g8f9-shutter-0.94/share/shutter/resources/system/plugins/perl/spshadow/spshadow: interpreter directive changed from " /usr/bin/env perl" to "/nix/store/13fsgz2l89qflb0ycc5lyxgigpral6g6-perl-5.24.3/bin/perl"
/nix/store/lzq1a4gih4yswdvc5rkdbzdygj52g8f9-shutter-0.94/share/shutter/resources/system/plugins/perl/spsepia/spsepia: interpreter directive changed from " /usr/bin/env perl" to "/nix/store/13fsgz2l89qflb0ycc5lyxgigpral6g6-perl-5.24.3/bin/perl"
/nix/store/lzq1a4gih4yswdvc5rkdbzdygj52g8f9-shutter-0.94/share/shutter/resources/system/plugins/perl/spresize/spresize: interpreter directive changed from " /usr/bin/env perl" to "/nix/store/13fsgz2l89qflb0ycc5lyxgigpral6g6-perl-5.24.3/bin/perl"
/nix/store/lzq1a4gih4yswdvc5rkdbzdygj52g8f9-shutter-0.94/share/shutter/resources/system/plugins/perl/sppolaroid/sppolaroid: interpreter directive changed from " /usr/bin/env perl" to "/nix/store/13fsgz2l89qflb0ycc5lyxgigpral6g6-perl-5.24.3/bin/perl"
/nix/store/lzq1a4gih4yswdvc5rkdbzdygj52g8f9-shutter-0.94/share/shutter/resources/system/plugins/perl/spnegate/spnegate: interpreter directive changed from " /usr/bin/env perl" to "/nix/store/13fsgz2l89qflb0ycc5lyxgigpral6g6-perl-5.24.3/bin/perl"
/nix/store/lzq1a4gih4yswdvc5rkdbzdygj52g8f9-shutter-0.94/share/shutter/resources/system/plugins/perl/spbardistortion/spbardistortion: interpreter directive changed from " /usr/bin/env perl" to "/nix/store/13fsgz2l89qflb0ycc5lyxgigpral6g6-perl-5.24.3/bin/perl"
checking for references to /build in /nix/store/lzq1a4gih4yswdvc5rkdbzdygj52g8f9-shutter-0.94...
/nix/store/lzq1a4gih4yswdvc5rkdbzdygj52g8f9-shutter-0.94

Copy link
Contributor

@xeji xeji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried it locally, seems to work fine

@@ -29,6 +31,7 @@ stdenv.mkDerivation rec {
wrapProgram $out/bin/shutter \
--set PERL5LIB "${stdenv.lib.makePerlPath perlModules}" \
--prefix PATH : "${imagemagick.out}/bin" \
--prefix XDG_DATA_DIRS : "${hicolor-icon-theme}/share" \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Putting hicolor-icon-theme first means it will have precedence over any user-installed themes in XDG_DATA_DIRS.
If it is meant as a fallback for missing icons, --suffix might be better here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're absolutely right, missed that, thanks!

When opening `shutter` it adds an indicator icon to the status bar.
However this doesn't happen (and an ugly default icon will be used) if
`shutter` can't find the `hicolor-icon-theme`. In such a case a warning
like this can be found in `stderr`:

```
Gtk-WARNING **: Could not find the icon 'image-png'. The 'hicolor' theme
was not found either, perhaps you need to install it.
```

As I don't think that we should force users to install this theme
globally and several other packages including `tor-browser`, `gparted`
or `clawsmail` add `hicolor-icon-theme` to their closure this seems to
be a fair measure.
@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: shutter

Partial log (click to expand)

/nix/store/w4zr2i7hd7f9kz134sislvq2bjxk89bl-shutter-0.94/share/shutter/resources/system/upload_plugins/upload/Imgur.pm: interpreter directive changed from " /usr/bin/env perl" to "/nix/store/cxdmh98g0lvl1dyq304c1lq7f90dh01f-perl-5.24.3/bin/perl"
/nix/store/w4zr2i7hd7f9kz134sislvq2bjxk89bl-shutter-0.94/share/shutter/resources/system/upload_plugins/upload/ITmages.pm: interpreter directive changed from " /usr/bin/env perl" to "/nix/store/cxdmh98g0lvl1dyq304c1lq7f90dh01f-perl-5.24.3/bin/perl"
/nix/store/w4zr2i7hd7f9kz134sislvq2bjxk89bl-shutter-0.94/share/shutter/resources/system/upload_plugins/upload/Minus.pm: interpreter directive changed from " /usr/bin/env perl" to "/nix/store/cxdmh98g0lvl1dyq304c1lq7f90dh01f-perl-5.24.3/bin/perl"
/nix/store/w4zr2i7hd7f9kz134sislvq2bjxk89bl-shutter-0.94/share/shutter/resources/system/upload_plugins/upload/ToileLibre.pm: interpreter directive changed from " /usr/bin/env perl" to "/nix/store/cxdmh98g0lvl1dyq304c1lq7f90dh01f-perl-5.24.3/bin/perl"
/nix/store/w4zr2i7hd7f9kz134sislvq2bjxk89bl-shutter-0.94/share/shutter/resources/system/upload_plugins/upload/TwitPic.pm: interpreter directive changed from " /usr/bin/env perl" to "/nix/store/cxdmh98g0lvl1dyq304c1lq7f90dh01f-perl-5.24.3/bin/perl"
/nix/store/w4zr2i7hd7f9kz134sislvq2bjxk89bl-shutter-0.94/share/shutter/resources/system/upload_plugins/upload/vgyme.pm: interpreter directive changed from " /usr/bin/env perl" to "/nix/store/cxdmh98g0lvl1dyq304c1lq7f90dh01f-perl-5.24.3/bin/perl"
/nix/store/w4zr2i7hd7f9kz134sislvq2bjxk89bl-shutter-0.94/share/shutter/resources/system/upload_plugins/upload/Dropbox.pm: interpreter directive changed from " /usr/bin/env perl" to "/nix/store/cxdmh98g0lvl1dyq304c1lq7f90dh01f-perl-5.24.3/bin/perl"
/nix/store/w4zr2i7hd7f9kz134sislvq2bjxk89bl-shutter-0.94/bin/.shutter-wrapped: interpreter directive changed from " /usr/bin/perl" to "/nix/store/cxdmh98g0lvl1dyq304c1lq7f90dh01f-perl-5.24.3/bin/perl"
checking for references to /build in /nix/store/w4zr2i7hd7f9kz134sislvq2bjxk89bl-shutter-0.94...
/nix/store/w4zr2i7hd7f9kz134sislvq2bjxk89bl-shutter-0.94

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: shutter

Partial log (click to expand)

/nix/store/gff6h3l26y8d51hxk9g3m0prvk9vkrxg-shutter-0.94/share/shutter/resources/system/plugins/shell/spgrayscale/spgrayscale: interpreter directive changed from " /usr/bin/env bash" to "/nix/store/a4qslf0yfs44mhnbagarn232sjnckhy0-bash-4.4-p19/bin/bash"
/nix/store/gff6h3l26y8d51hxk9g3m0prvk9vkrxg-shutter-0.94/share/shutter/resources/system/plugins/perl/spwatermark/spwatermark: interpreter directive changed from " /usr/bin/env perl" to "/nix/store/13fsgz2l89qflb0ycc5lyxgigpral6g6-perl-5.24.3/bin/perl"
/nix/store/gff6h3l26y8d51hxk9g3m0prvk9vkrxg-shutter-0.94/share/shutter/resources/system/plugins/perl/spshadow/spshadow: interpreter directive changed from " /usr/bin/env perl" to "/nix/store/13fsgz2l89qflb0ycc5lyxgigpral6g6-perl-5.24.3/bin/perl"
/nix/store/gff6h3l26y8d51hxk9g3m0prvk9vkrxg-shutter-0.94/share/shutter/resources/system/plugins/perl/spsepia/spsepia: interpreter directive changed from " /usr/bin/env perl" to "/nix/store/13fsgz2l89qflb0ycc5lyxgigpral6g6-perl-5.24.3/bin/perl"
/nix/store/gff6h3l26y8d51hxk9g3m0prvk9vkrxg-shutter-0.94/share/shutter/resources/system/plugins/perl/spresize/spresize: interpreter directive changed from " /usr/bin/env perl" to "/nix/store/13fsgz2l89qflb0ycc5lyxgigpral6g6-perl-5.24.3/bin/perl"
/nix/store/gff6h3l26y8d51hxk9g3m0prvk9vkrxg-shutter-0.94/share/shutter/resources/system/plugins/perl/sppolaroid/sppolaroid: interpreter directive changed from " /usr/bin/env perl" to "/nix/store/13fsgz2l89qflb0ycc5lyxgigpral6g6-perl-5.24.3/bin/perl"
/nix/store/gff6h3l26y8d51hxk9g3m0prvk9vkrxg-shutter-0.94/share/shutter/resources/system/plugins/perl/spnegate/spnegate: interpreter directive changed from " /usr/bin/env perl" to "/nix/store/13fsgz2l89qflb0ycc5lyxgigpral6g6-perl-5.24.3/bin/perl"
/nix/store/gff6h3l26y8d51hxk9g3m0prvk9vkrxg-shutter-0.94/share/shutter/resources/system/plugins/perl/spbardistortion/spbardistortion: interpreter directive changed from " /usr/bin/env perl" to "/nix/store/13fsgz2l89qflb0ycc5lyxgigpral6g6-perl-5.24.3/bin/perl"
checking for references to /build in /nix/store/gff6h3l26y8d51hxk9g3m0prvk9vkrxg-shutter-0.94...
/nix/store/gff6h3l26y8d51hxk9g3m0prvk9vkrxg-shutter-0.94

@xeji xeji merged commit 4c8c314 into NixOS:master May 4, 2018
@Ma27 Ma27 deleted the shutter/add-hicolor-icon-theme branch May 4, 2018 20:49
@fpletz
Copy link
Member

fpletz commented May 7, 2018

Backported to 18.03: 92e6593

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants