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

Darwin gtk2/pygtk quartz backend #21382

Merged
merged 8 commits into from Jan 7, 2017
Merged

Conversation

johbo
Copy link
Contributor

@johbo johbo commented Dec 23, 2016

Motivation for this change

I wanted to use a pygtk based application on darwin and noticed that it relied on the X11 backend of gtk which leads to trouble in multi screen setups (lost windows out of screen). Using the quartz backend also leads to a nicer display of the applications.

This Pull Request adjust GTK2 based on the work from #20658. I aimed to keep the changes to the GTK2 Derivation as close as possible to the other PR. The main change is that I added the CoreText dependencies to cairo and pango, so that fonts are actually visible.

Due to #12346 starting the applications still needs a twist by using something like DYLD_FRAMEWORK_PATH=/System/Library/Frameworks.

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
    • Linux
  • 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.

@mention-bot
Copy link

@johbo, thanks for your PR! By analyzing the history of the files in this pull request, we identified @vcunat, @jwiegley and @edolstra to be potential reviewers.

@johbo
Copy link
Contributor Author

johbo commented Dec 23, 2016

Regarding the binaries I've tested gtk-demo and pygtk-demo, those worked fine.

@LnL7 LnL7 added the 6.topic: darwin Running or building packages on Darwin label Dec 23, 2016
@johbo johbo force-pushed the darwin-pygtk-quartz-backend branch from 92d8be4 to f2a44b4 Compare December 23, 2016 21:47
@johbo
Copy link
Contributor Author

johbo commented Dec 24, 2016

I've done some more experiments, it appears to me as if ApplicationServices should go into the propagatedBuildInputs of cairo.

@vbgl
Copy link
Contributor

vbgl commented Dec 24, 2016

This breaks gnome2.gtksourceview. It now reports the following error.

checking for IGE_MAC... no
configure: error: Package requirements (ige-mac-integration) were not met:

No package 'ige-mac-integration' found

You may need to package some extra libraries (https://github.com/rhult/ige-mac-integration).

@johbo
Copy link
Contributor Author

johbo commented Dec 24, 2016

Uh, it might cause a few more issues like that I guess. I'll try to add ige-mac-integration and make things work.

@johbo
Copy link
Contributor Author

johbo commented Dec 25, 2016

@vbgl think I got the gtksourceview issue figured out. Do you have any suggestions how I could best check how much this change might affect other packages?

@vbgl
Copy link
Contributor

vbgl commented Dec 25, 2016

Indeed, gtksourceview now builds. But this PR breaks coqide, inkscape, zim: they build but crash on startup.

@LnL7
Copy link
Member

LnL7 commented Dec 26, 2016

@johbo nox-review and #19045 (comment)

@johbo
Copy link
Contributor Author

johbo commented Dec 27, 2016

Hmm, it seems that all gtk2 based applications will suffer from #12346 until we get that sorted. I wonder if it would be better to make this gtk2 change opt-in and build by default for X11 until that's solved.

Copy link
Member

@matthewbauer matthewbauer left a comment

Choose a reason for hiding this comment

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

These changes look good! It probably should be merged into staging first though.

Once this gets into master I can work on merging #20658 again.

gettext];

patches = optionals stdenv.isDarwin [
./0001-Change-IgeMacIntegration-to-GtkOSXApplication.patch
Copy link
Member

Choose a reason for hiding this comment

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

Can you use fetchpatch for these?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the hint, was not yet aware of it. I'll try to use it for both patches.

@@ -1,5 +1,5 @@
{ lib, stdenv, fetchurl, pkgconfig, glib, gdk_pixbuf, pango, cairo, libxml2, libgsf
, bzip2, libcroco, libintlOrEmpty
, bzip2, libcroco, libintlOrEmpty, darwin
Copy link
Member

Choose a reason for hiding this comment

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

This shouldn't be needed.

This helps so that fonts are properly rendered in gtk when used with the backend
"quartz".
Had to add this so that it was able to parse the headers from the frameworks.
@johbo johbo force-pushed the darwin-pygtk-quartz-backend branch from 61fc9d7 to ade978d Compare January 7, 2017 16:35
@johbo
Copy link
Contributor Author

johbo commented Jan 7, 2017

I'll rebase this quickly

@johbo johbo force-pushed the darwin-pygtk-quartz-backend branch from ade978d to bbaf7fe Compare January 7, 2017 18:18
johbo and others added 3 commits January 7, 2017 19:21
Noticed that it caused depending packages to fail, like librsvg, imagemagiv, graphviz.
Had to pick two commits as patches from the repository which update the
dependency ige-mac-integration to gtk-mac-integration.
@johbo johbo force-pushed the darwin-pygtk-quartz-backend branch from bbaf7fe to f025d2c Compare January 7, 2017 18:22
@matthewbauer
Copy link
Member

cc @LnL7 @copumpkin

@LnL7
Copy link
Member

LnL7 commented Jan 7, 2017

Looks like about ~1400 packages will rebuild, I think that's still ok to do on master.

@LnL7 LnL7 merged commit 826d6aa into NixOS:master Jan 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: darwin Running or building packages on Darwin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants