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

GIMP on Darwin (use Quartz) #20658

Merged
merged 2 commits into from Jan 11, 2017
Merged

GIMP on Darwin (use Quartz) #20658

merged 2 commits into from Jan 11, 2017

Conversation

matthewbauer
Copy link
Member

@matthewbauer matthewbauer commented Nov 23, 2016

Motivation for this change

This adds some tricks to get GIMP to build on my Darwin machine.

GTK2 has a quartz backend that we haven't been using. I'm not sure why it's not being used but it should probably be enabled by default. While GIMP may work without GTK +quartz, I XQuartz is really annoying to use and not my preference.

For some reason PyGTK and GTK2 +quartz don't seem to work well. It's really confusing because it looks like at some point the MacPorts project had everything working well but the compiler seems to treat objc headers like they are c header. See https://trac.macports.org/ticket/37713.

Note: This does not produce an "Application" yet on Darwin. It should be possible but our GIMP release does not seem to produce the correct "gtk-mac-bundler" .bundle file (see the gimp/build/osx/gimp-2.8.bundle file).

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

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

@LnL7 LnL7 added the 6.topic: darwin Running or building packages on Darwin label Nov 23, 2016
@johbo
Copy link
Contributor

johbo commented Nov 30, 2016

Just tried this one on my darwin box, it did build nicely. When running gimp it does start, but it does not render any text.

@matthewbauer is it working for you correctly? Did you have to apply any tweaks to make fonts work with the quartz backend?

@matthewbauer
Copy link
Member Author

@johbo Okay, this should be fixable. When you run gimp, are you getting something like Fontconfig error: Cannot load default config file?

We may need to have to fix the OS X version of fontconfig for this to work correctly.

@johbo
Copy link
Contributor

johbo commented Dec 1, 2016

Yes, indeed, I am getting exactly this error.

@vcunat
Copy link
Member

vcunat commented Dec 9, 2016

Is this WIP then?

@johbo
Copy link
Contributor

johbo commented Dec 23, 2016

@matthewbauer did the fonts actually work in your case? I'd love to get this working, but seems I would need a hint to proceed.

@matthewbauer
Copy link
Member Author

matthewbauer commented Dec 23, 2016 via email

@johbo
Copy link
Contributor

johbo commented Dec 23, 2016

Got some progress, thanks for the hint. I've added CoreText in a few places until the configure scripts did detect it. gtk-demo as well as pygtk-demo did now show the fonts. Hope I manage to wrap my findings up in a PR or some commits.

I've changed cairo and pango currently, not yet sure though if both changes are needed.

johbo added a commit to johbo/nixpkgs that referenced this pull request Dec 23, 2016
@johbo johbo mentioned this pull request Dec 23, 2016
7 tasks
@johbo
Copy link
Contributor

johbo commented Dec 24, 2016

@matthewbauer I got the font problem sorted and tested your change on top of it, now I got to see the fonts.

I've pushed the testing code into my fork at https://github.com/johbo/nixpkgs/tree/test-gimp-darwin in case you are interested.

@matthewbauer
Copy link
Member Author

@johbo Awesome! You should open a new pull request so it can be more visible.

@matthewbauer matthewbauer reopened this Jan 5, 2017
@matthewbauer matthewbauer force-pushed the gimp-darwin branch 3 times, most recently from dbe8e64 to e965885 Compare January 5, 2017 23:55
@matthewbauer
Copy link
Member Author

Okay, this should be mergeable but only after #21382 is merged.


installPhase = ''
mkdir -p $out/bin
sed "s,@PATH@,$out/share,g" < gtk-mac-bundler.in > $out/bin/gtk-mac-bundler
Copy link
Member

Choose a reason for hiding this comment

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

You can replace variables like that with substitute, perhaps that's a little bit nicer.

substitute gtk-mac-bundler.in $out/bin/gtk-mac-bundler \
  --subst-var-by PATH $out/share

@LnL7
Copy link
Member

LnL7 commented Jan 9, 2017

This and your other PRs need ApplicationServices and I'm not sure what else breaks because of 0f67005.

@LnL7
Copy link
Member

LnL7 commented Jan 11, 2017

I'm seeing issues when executing the binary https://gist.github.com/LnL7/5c22cf16316b2c4a3f8e5720a8959f82.

Copy link
Member

@LnL7 LnL7 left a comment

Choose a reason for hiding this comment

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

my bad, I didn't realise this needed DYLD_FRAMEWORK_PATH

@LnL7 LnL7 merged commit 4488203 into NixOS:master Jan 11, 2017
@matthewbauer matthewbauer deleted the gimp-darwin branch January 19, 2017 05:40
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