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

xcowsay: Init at 1.5 #79024

Merged
merged 1 commit into from Aug 25, 2020
Merged

xcowsay: Init at 1.5 #79024

merged 1 commit into from Aug 25, 2020

Conversation

dasJ
Copy link
Member

@dasJ dasJ commented Feb 1, 2020

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@dasJ
Copy link
Member Author

dasJ commented Feb 1, 2020

@GrahamcOfBorg build xcowsay

Copy link
Member

@aanderse aanderse left a comment

Choose a reason for hiding this comment

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

We are trying to eliminate gtk2 I'm pretty sure. Is there a gtk3 option?

cc @jtojnar

@jtojnar
Copy link
Contributor

jtojnar commented Feb 1, 2020

It appears the code was made at least partially compatible:

But the configure script has GTK2 hardcoded:

https://github.com/nickg/xcowsay/blob/ef6944a0ff7fe8271f546f857454d45d90e53725/configure.ac#L34

Would you mind trying to replace it with gtk+-3.0 and adding autoreconfHook to nativeBuildInputs?

@dasJ
Copy link
Member Author

dasJ commented Feb 1, 2020

Hmm seems like this doesn't work:

In file included from display_cow.c:37:
floating_shape.h:30:4: error: unknown type name 'GdkDrawable'
   30 |    GdkDrawable *mask_bitmap;
      |    ^~~~~~~~~~~
display_cow.c: In function 'display_cow':
display_cow.c:244:4: warning: 'gdk_screen_get_n_monitors' is deprecated: Use 'gdk_display_get_n_monitors' instead [-Wdeprecated-declarations]
  244 |    gint n_monitors = gdk_screen_get_n_monitors(screen);
      |    ^~~~
In file included from /nix/store/79k23ba41sqbr95x32zyb0w0k3smkkwk-gtk+3-3.24.12-dev/include/gtk-3.0/gdk/gdkapplaunchcontext.h:31,
                 from /nix/store/79k23ba41sqbr95x32zyb0w0k3smkkwk-gtk+3-3.24.12-dev/include/gtk-3.0/gdk/gdk.h:32,
                 from /nix/store/79k23ba41sqbr95x32zyb0w0k3smkkwk-gtk+3-3.24.12-dev/include/gtk-3.0/gtk/gtk.h:30,
                 from display_cow.c:29:
/nix/store/79k23ba41sqbr95x32zyb0w0k3smkkwk-gtk+3-3.24.12-dev/include/gtk-3.0/gdk/gdkscreen.h:74:14: note: declared here
   74 | gint         gdk_screen_get_n_monitors        (GdkScreen    *screen);
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~
display_cow.c:251:4: warning: 'gdk_screen_get_monitor_geometry' is deprecated: Use 'gdk_monitor_get_geometry' instead [-Wdeprecated-declarations]
  251 |    gdk_screen_get_monitor_geometry(screen, pick, &geom);
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /nix/store/79k23ba41sqbr95x32zyb0w0k3smkkwk-gtk+3-3.24.12-dev/include/gtk-3.0/gdk/gdkapplaunchcontext.h:31,
                 from /nix/store/79k23ba41sqbr95x32zyb0w0k3smkkwk-gtk+3-3.24.12-dev/include/gtk-3.0/gdk/gdk.h:32,
                 from /nix/store/79k23ba41sqbr95x32zyb0w0k3smkkwk-gtk+3-3.24.12-dev/include/gtk-3.0/gtk/gtk.h:30,
                 from display_cow.c:29:
/nix/store/79k23ba41sqbr95x32zyb0w0k3smkkwk-gtk+3-3.24.12-dev/include/gtk-3.0/gdk/gdkscreen.h:78:14: note: declared here
   78 | void         gdk_screen_get_monitor_geometry  (GdkScreen    *screen,
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
display_cow.c: In function 'try_dbus':
display_cow.c:359:4: warning: 'g_type_init' is deprecated [-Wdeprecated-declarations]
  359 |    g_type_init();
      |    ^~~~~~~~~~~
In file included from /nix/store/20jfnqdap9kni2gir3lxb12m4mhrfkx6-glib-2.62.4-dev/include/glib-2.0/gobject/gobject.h:24,
                 from /nix/store/20jfnqdap9kni2gir3lxb12m4mhrfkx6-glib-2.62.4-dev/include/glib-2.0/gobject/gbinding.h:29,
                 from /nix/store/20jfnqdap9kni2gir3lxb12m4mhrfkx6-glib-2.62.4-dev/include/glib-2.0/glib-object.h:23,
                 from /nix/store/20jfnqdap9kni2gir3lxb12m4mhrfkx6-glib-2.62.4-dev/include/glib-2.0/gio/gioenums.h:28,
                 from /nix/store/20jfnqdap9kni2gir3lxb12m4mhrfkx6-glib-2.62.4-dev/include/glib-2.0/gio/giotypes.h:28,
                 from /nix/store/20jfnqdap9kni2gir3lxb12m4mhrfkx6-glib-2.62.4-dev/include/glib-2.0/gio/gio.h:26,
                 from /nix/store/79k23ba41sqbr95x32zyb0w0k3smkkwk-gtk+3-3.24.12-dev/include/gtk-3.0/gdk/gdkapplaunchcontext.h:28,
                 from /nix/store/79k23ba41sqbr95x32zyb0w0k3smkkwk-gtk+3-3.24.12-dev/include/gtk-3.0/gdk/gdk.h:32,
                 from /nix/store/79k23ba41sqbr95x32zyb0w0k3smkkwk-gtk+3-3.24.12-dev/include/gtk-3.0/gtk/gtk.h:30,
                 from display_cow.c:29:
/nix/store/20jfnqdap9kni2gir3lxb12m4mhrfkx6-glib-2.62.4-dev/include/glib-2.0/gobject/gtype.h:691:23: note: declared here
  691 | void                  g_type_init                    (void);
      |                       ^~~~~~~~~~~
display_cow.c: In function 'load_cow':
display_cow.c:91:7: warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result [-Wunused-result]
   91 |       asprintf(&cow_path, "%s/%s_%s.png", DATADIR,
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   92 |          get_string_option("image_base"),
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   93 |          get_string_option("cow_size"));
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [Makefile:477: display_cow.o] Error 1
make[2]: Leaving directory '/build/xcowsay-1.4/src'
make[1]: *** [Makefile:494: all-recursive] Error 1
make[1]: Leaving directory '/build/xcowsay-1.4'
make: *** [Makefile:371: all] Error 2
builder for '/nix/store/m1sc2cwwmd4lkp62if9p8cf5a4qq59zf-xcowsay-1.4.drv' failed with exit code 2

@jtojnar
Copy link
Contributor

jtojnar commented Feb 1, 2020

Thanks for checking. GdkDrawable has been deprecated 9 years ago, cairo should probably be used instead.

Using GTK 2 is fine for now, opening an issue upstream about porting it to GTK 3/cairo/pango would be nice.

@dasJ
Copy link
Member Author

dasJ commented Feb 1, 2020

I opened #6

@jtojnar
Copy link
Contributor

jtojnar commented Feb 1, 2020

$ result/bin/xcowsay "hullo"
...works fine
$ result/bin/xcowfortune 
env: ‘fortune’: No such file or directory
$ result/bin/xcowdream 
result/bin/xcowdream: line 2: exec: xcowsay: not found
$ result/bin/xcowthink 
result/bin/xcowthink: line 2: exec: xcowsay: not found

@dasJ
Copy link
Member Author

dasJ commented Feb 1, 2020

I could wrap the tools so they find xcowsay. But should I also wrap xcowfortune? I feel like the dependency to fortune isn't exactly necessary

@dasJ
Copy link
Member Author

dasJ commented Feb 3, 2020

The maintainer updated to support GTK 3. I also wrapped the tools so it finds everything ;)

@dasJ dasJ changed the title xcowsay: Init at 1.4 xcowsay: Init at 1.5 Feb 3, 2020
};

buildInputs = [ dbus dbus-glib gtk3 ];
nativeBuildInputs = [ makeWrapper pkg-config ];
Copy link
Contributor

Choose a reason for hiding this comment

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

We need wrapGAppsHook to be able to load images using gdk-pixbuf.

$ env GDK_PIXBUF_MODULE_FILE= result/bin/xcowsay "foo"
Failed to load cow image: /nix/store/6qffdpj5j3dhz14bjhgcvnmmsnbm67av-xcowsay-1.5/share/xcowsay/cow_med.png

sha256 = "0pyaa062z1ag26dhkm1yzp2hivnlmhlpqn5xg7mx9r1m652mm91y";
};

buildInputs = [ dbus dbus-glib gtk3 ];
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
buildInputs = [ dbus dbus-glib gtk3 ];
buildInputs = [
dbus-glib
gtk3
gdk-pixbuf # loading cow images
librsvg # dreaming SVG images
];

@flokli
Copy link
Contributor

flokli commented Feb 5, 2020

Is there a wlcowsay too? 😆

@stale
Copy link

stale bot commented Aug 3, 2020

Hello, I'm a bot and I thank you in the name of the community for your contributions.

Nixpkgs is a busy repository, and unfortunately sometimes PRs get left behind for too long. Nevertheless, we'd like to help committers reach the PRs that are still important. This PR has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.

If this is still important to you and you'd like to remove the stale label, we ask that you leave a comment. Your comment can be as simple as "still important to me". But there's a bit more you can do:

If you received an approval by an unprivileged maintainer and you are just waiting for a merge, you can @ mention someone with merge permissions and ask them to help. You might be able to find someone relevant by using Git blame on the relevant files, or via GitHub's web interface. You can see if someone's a member of the nixpkgs-committers team, by hovering with the mouse over their username on the web interface, or by searching them directly on the list.

If your PR wasn't reviewed at all, it might help to find someone who's perhaps a user of the package or module you are changing, or alternatively, ask once more for a review by the maintainer of the package/module this is about. If you don't know any, you can use Git blame on the relevant files, or GitHub's web interface to find someone who touched the relevant files in the past.

If your PR has had reviews and nevertheless got stale, make sure you've responded to all of the reviewer's requests / questions. Usually when PR authors show responsibility and dedication, reviewers (privileged or not) show dedication as well. If you've pushed a change, it's possible the reviewer wasn't notified about your push via email, so you can always officially request them for a review, or just @ mention them and say you've addressed their comments.

Lastly, you can always ask for help at our Discourse Forum, or more specifically, at this thread or at #nixos' IRC channel.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Aug 3, 2020
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Aug 25, 2020
@dasJ dasJ requested a review from Lassulus August 25, 2020 20:09
@dasJ
Copy link
Member Author

dasJ commented Aug 25, 2020

@GrahamcOfBorg build xcowsay

@Lassulus Lassulus merged commit 8396051 into NixOS:master Aug 25, 2020
@dasJ dasJ deleted the xcowsay-init branch August 26, 2020 08:56
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

5 participants