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
haskell.gtk2hs packages: fix Darwin build #80422
haskell.gtk2hs packages: fix Darwin build #80422
Conversation
3d310a0
to
0fbaeaa
Compare
glib = appendPatch super.glib ./patches/glib.patch; | ||
gio = appendPatch super.gio ./patches/gio.patch; | ||
pango = appendPatch super.pango ./patches/pango.patch; | ||
# In addition to the issue above, gtk in particular needs to be told on Darwin | ||
# that that the supplied gtk lib uses quartz not X11 (as recommended in | ||
# https://github.com/gtk2hs/gtk2hs/issues/249). This appendConfigureFlags part | ||
# should remain even after we can remove the v0.13.8.0-specific appendPatch. | ||
gtk = appendConfigureFlags (appendPatch super.gtk ./patches/gtk.patch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you either pull these patches directly from upstream (maybe using fetchPatch
), or try to add this -D__attribute__(x)=
flag inline here (maybe using appendConfigureFlags
)?
If possible, we try to avoid carrying around patches directly in nixpkgs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense! I can't think of a way to achieve this just via command-line flags, and there isn't a canonical patch source yet, but I've just pushed an alternative. Hopefully the let-bound helper function will be relatively short-lived.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a canonical patch source yet
The canonical patch source would be your PR. Look for examples of fetchPatch
in nixpkgs to see how this is done.
Otherwise, you might be able to use the optP
GHC flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the guidance! I've pushed an update using fetchpatch (and re-tested on both Darwin and NixOS).
There is some commonality that could be factored out into a helper function (at which point one might make the patch darwin-specific) but I've erred on the side of keeping everything local. Unconditionally applying the patch is safe, and doesn't have a huge fan-out. But I'm not sure which is most idiomatic - opinions welcomed!
96083a0
to
68663ac
Compare
This includes two layered changes so the gtk2hs packages build on Darwin: - For `glib`, `gio`, `gtk`, `gtk3`, and `pango`: the fix for version 0.13.8.0 from gtk2hs/gtk2hs#293 . I expect at some point the referenced fix (or one like it) will be released and and brought into nixpkgs, at which point the override and patch files here can (in fact must) be removed. - For `gtk` and `gtk3`: also apply the required cabal flag cited in gtk2hs/gtk2hs#249 to specify the Quartz rather than X11 backend (Quartz is the one that both nixpkgs and macOS support out-the-box). This override is likely to be wanted indefinitely. Both modifications are required for a successful build of `gtk` or `gtk3` on Darwin right now.
68663ac
to
804b57b
Compare
Great, thanks for fixing this up! LGTM. |
@GrahamcOfBorg build haskellPackages.gtk |
Looks like everything built successfully on darwin, thanks for fixing this up! |
Motivation for this change
The gtk2hs packages (
gtk
,cairo
,pango
,glib
,gio
) currently fail on Darwin. This change includes two layered fixes for these:gtk
that likely wants to remain indefinitelyThings done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)Edit: correct the gtk2hs issue referenced in the commit message