-
Notifications
You must be signed in to change notification settings - Fork 171
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
Support building on macOS with optional X11 #46
Conversation
This fixes cross-compilation. This code is contributed under the terms of the MIT license.
When X11 is not available (like on recent OS X versions), the DPI is initialized to a default value of 96.
Hello! I'm the build bot for the Mono project. I need approval from a Mono team member to build this pull request. A team member should reply with "approve" to approve a build of this pull request, "whitelist" to whitelist this and all future pull requests from this contributor, or "build" to explicitly request a build, even if one has already been done. Contributors can ignore this message. |
@qmfrederik, |
@akoeplinger could you trigger a build for this? I'd like to double check this does not break the Linux builds |
whitelist |
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.
Looks fine to me thanks. Note that the tests in libgdiplus are very limited. A good test is to build and install libgdiplus and then run the System.Drawing and WinForms* tests from Mono against it.
*the WinForms tests don't work or crash on Mac.
configure.ac
Outdated
@@ -348,6 +353,37 @@ dnl Test for libpng | |||
GDIPLUS_LIBS="$GDIPLUS_LIBS $LIBPNG" | |||
AC_DEFINE(HAVE_LIBPNG, 1, Define if png support is available. Always defined.) | |||
|
|||
dnl | |||
dnl Test for X11. Allow compiling without x11 support using the disable-x11 |
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.
should be without-x11
since you're using AC_ARG_WITH
src/gdiplus-private.h
Outdated
#ifdef CAIRO_HAS_XLIB_SURFACE | ||
#include "cairo-xlib.h" | ||
#endif | ||
#endif |
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.
should use tabs instead of spaces here and below.
Display *display; | ||
Drawable drawable; | ||
#endif | ||
#endif |
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.
this struct isn't passed between managed<->native right? otherwise we might get issues if it changes size/layout.
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.
I checked, it's not in gdipStructs.cs and a search for _Graphics
didn't return any struct which matches this one in Mono's codebase, so I'm assuming not.
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.
ok, good. Can you run the System.Drawing tests against the new libgdiplus?
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.
I'll give it a try and let you know how it goes.
@akoeplinger Here's how I ran the tests:
|
@akoeplinger Tried to run the System.Windows.Forms tests by my Linux box is headless so they pretty much all failed because of that. |
@qmfrederik awesome, thanks for that 👍 Re: WinForms: you can install Xvfb to run it on a headless box, it's how we run it on Jenkins. |
OK, here are the results with xvfb-run:
|
Related issue: Homebrew/homebrew-core#4202 |
- Add extra patch that conditionally compiles x11 support [1] - Add X11 option that applies extra patch if X11 support is disabled - PORTREVISION is not bumped as: - The default case (X11) has not changed, and - The non-default case will propogate due to options change [1] mono/libgdiplus#46 PR: 213973 git-svn-id: svn+ssh://svn.freebsd.org/ports/head@438077 35697150-7ecd-e111-bb59-0022644237b5
- Add extra patch that conditionally compiles x11 support [1] - Add X11 option that applies extra patch if X11 support is disabled - PORTREVISION is not bumped as: - The default case (X11) has not changed, and - The non-default case will propogate due to options change [1] mono/libgdiplus#46 PR: 213973
- Add extra patch that conditionally compiles x11 support [1] - Add X11 option that applies extra patch if X11 support is disabled - PORTREVISION is not bumped as: - The default case (X11) has not changed, and - The non-default case will propogate due to options change [1] mono/libgdiplus#46 PR: 213973
X11 no longer ships with macOS, so building libgdiplus over there fails. This PR makes x11 integration optional, by adding a
--without-x11
flag.This will also enable adoption of libgdiplus in homebrew.
Related issues: Homebrew/legacy-homebrew#45393, #13, #35