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

mono-libgdiplus 5.4 #12862

Closed
wants to merge 4 commits into from
Closed

mono-libgdiplus 5.4 #12862

wants to merge 4 commits into from

Conversation

qmfrederik
Copy link
Contributor

  • Have you followed the guidelines for contributing?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing brew install <formula>)?

libgdiplus is the library used by Mono for its graphics. It is a missing dependency for the Mono formula.

Previous efforts to get this into brew have stalled because the upstream repository did not contain a fix which allowed bypassing the dependency libgdiplus has on X11. This was fixed a while ago (mono/libgdiplus#46), so all should be good now to get this into homebrew.

Let me know if you need anything else.

See also #4202 (@medains), Homebrew/legacy-homebrew#45404 (@haf)

@ilovezfs ilovezfs added the new formula PR adds a new formula to Homebrew/homebrew-core label Apr 26, 2017
Copy link
Contributor

@ilovezfs ilovezfs left a comment

Choose a reason for hiding this comment

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

@qmfrederik a new tag would be good. I see 4.2 is from sixteen months ago, and the url you're proposing https://github.com/mono/libgdiplus/archive/910ba3a126d2639861fb7feb3f12941526e99be8.tar.gz is the head revision, not 4.2.

@@ -0,0 +1,49 @@
class MonoLibgdiplus < Formula
desc "C-based implementation of GDI+ API http://www.mono-project.com/"
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove that URL from the description.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@qmfrederik
Copy link
Contributor Author

@ilovezfs Yes, the build I'm proposing is a fairly recent comment; it's essentially 4.2 plus the patch required to make lbigdiplus compile on macOS without x11.

In other words, up to 910ba3a126d2639861fb7feb3f12941526e99be8, all the changes in libgdiplus which are not part of 4.2 are related to this.

@qmfrederik qmfrederik changed the title mono-libgdiplus 4.2 mono-libgdiplus 5.4 May 12, 2017
@qmfrederik
Copy link
Contributor Author

@ilovezfs So, we just got a new tag in the repo - 5.4. I update title & formula to point to release 5.4

Does that address your feedback?

@ilovezfs ilovezfs dismissed their stale review May 12, 2017 17:10

New tag has been created.

@haf
Copy link
Contributor

haf commented May 14, 2017

This would be nice to get merged.

@qmfrederik
Copy link
Contributor Author

@bfontaine @ilovezfs Can either of you give me a bit more information related to the build error:

Error: Operation not permitted - /usr/local/Cellar/automake/1.15/share/automake-1.15/COPYING

I'm not sure where it comes from or how to fix it?

@ilovezfs
Copy link
Contributor

diff --git a/Formula/mono-libgdiplus.rb b/Formula/mono-libgdiplus.rb
index 632fea5..cf835cb 100644
--- a/Formula/mono-libgdiplus.rb
+++ b/Formula/mono-libgdiplus.rb
@@ -21,12 +21,13 @@ class MonoLibgdiplus < Formula
   depends_on "giflib"
 
   def install
-    system "./autogen.sh", "--disable-debug",
-                           "--disable-dependency-tracking",
-                           "--disable-silent-rules",
-                           "--without-x11",
-                           "--disable-tests",
-                           "--prefix=#{prefix}"
+    system "autoreconf", "-fiv"
+    system "./configure", "--disable-debug",
+                          "--disable-dependency-tracking",
+                          "--disable-silent-rules",
+                          "--without-x11",
+                          "--disable-tests",
+                          "--prefix=#{prefix}"
     system "make"
     cd "tests" do
       system "make", "testbits"
iMac-TMP:homebrew-core joe$ 

@qmfrederik
Copy link
Contributor Author

@ilovezfs Thanks! Build looks green now - are we good to have this merged?

@haf
Copy link
Contributor

haf commented May 17, 2017

Trying the patch out (probably not a problem of the patch/PR itself):

OSX:

System.EntryPointNotFoundException: GetQDGlobalsThePort
  at (wrapper managed-to-native) System.Drawing.MacSupport:GetQDGlobalsThePort ()
  at System.Drawing.MacSupport.GetCGContextForView (System.IntPtr handle) [0x00039] in /private/tmp/mono-20170420-53906-63nc7r/mono-4.8.1/mcs/class/System.Drawing/System.Drawing/macFunctions.cs:89
  at System.Drawing.Graphics.FromHwnd (System.IntPtr hwnd) [0x0004d] in /private/tmp/mono-20170420-53906-63nc7r/mono-4.8.1/mcs/class/System.Drawing/System.Drawing/Graphics.cs:1718
  at PdfSharp.Drawing.XGraphics..ctor (System.Drawing.Graphics gfx, PdfSharp.Drawing.XSize size, PdfSharp.Drawing.XGraphicsUnit pageUnit, PdfSharp.Drawing.XPageDirection pageDirection) [0x00009] in <2a80a7aa909f4f4394d33f68c6061743>:0
  at PdfSharp.Drawing.XGraphics.CreateMeasureContext (PdfSharp.Drawing.XSize size, PdfSharp.Drawing.XGraphicsUnit pageUnit, PdfSharp.Drawing.XPageDirection pageDirection) [0x00002] in <2a80a7aa909f4f4394d33f68c6061743>:0

Ubuntu:

System.NotSupportedException: Could not open display (X-Server required. Check your DISPLAY environment variable)
  at System.Drawing.Graphics.FromHwnd (System.IntPtr hwnd) [0x000ca] in <b12c84cdc19942509f026394ae66ea32>:0 
  at PdfSharp.Drawing.XGraphics..ctor (System.Drawing.Graphics gfx, PdfSharp.Drawing.XSize size, PdfSharp.Drawing.XGraphicsUnit pageUnit, PdfSharp.Drawing.XPageDirection pageDirection) [0x00009] in <2a80a7aa909f4f4394d33f68c6061743>:0 
  at PdfSharp.Drawing.XGraphics.CreateMeasureContext (PdfSharp.Drawing.XSize size, PdfSharp.Drawing.XGraphicsUnit pageUnit, PdfSharp.Drawing.XPageDirection pageDirection) [0x00002] in <2a80a7aa909f4f4394d33f68c6061743>:0 

Here https://github.com/mono/mono/blob/master/mcs/class/System.Drawing/System.Drawing/macFunctions.cs#L90 on mono: stable 4.8.1.0 (bottled)

Loading, with export DYLD_PRINT_LIBRARIES=1:

dyld: loaded: /usr/local/lib/libgdiplus.dylib
dyld: loaded: /usr/local/opt/glib/lib/libglib-2.0.0.dylib
dyld: loaded: /usr/local/opt/gettext/lib/libintl.8.dylib
dyld: loaded: /usr/local/opt/cairo/lib/libcairo.2.dylib
dyld: loaded: /usr/local/opt/freetype/lib/libfreetype.6.dylib
dyld: loaded: /usr/local/opt/jpeg/lib/libjpeg.8.dylib
dyld: loaded: /usr/local/opt/libtiff/lib/libtiff.5.dylib
dyld: loaded: /usr/local/opt/giflib/lib/libgif.7.dylib
dyld: loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib
dyld: loaded: /usr/local/opt/libexif/lib/libexif.12.dylib
dyld: loaded: /usr/local/opt/fontconfig/lib/libfontconfig.1.dylib
dyld: loaded: /usr/local/opt/pcre/lib/libpcre.1.dylib
dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels.framework/Versions/A/CommonPanels
dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framework/Versions/A/Help
dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture.framework/Versions/A/ImageCapture
dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework/Versions/A/Ink
dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting
dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Print
dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.framework/Versions/A/SecurityHI
dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition
dyld: loaded: /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI
dyld: loaded: /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore
dyld: loaded: /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv
dyld: loaded: /System/Library/PrivateFrameworks/GenerationalStorage.framework/Versions/A/GenerationalStorage
dyld: loaded: /System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage
dyld: loaded: /usr/lib/libFosl_dynamic.dylib
dyld: loaded: /System/Library/PrivateFrameworks/FaceCore.framework/Versions/A/FaceCore
dyld: loaded: /System/Library/Frameworks/OpenCL.framework/Versions/A/OpenCL
dyld: loaded: /System/Library/PrivateFrameworks/CrashReporterSupport.framework/Versions/A/CrashReporterSupport
dyld: loaded: /System/Library/PrivateFrameworks/Sharing.framework/Versions/A/Sharing
dyld: loaded: /System/Library/PrivateFrameworks/IconServices.framework/Versions/A/IconServices
dyld: loaded: /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Apple80211
dyld: loaded: /System/Library/Frameworks/CoreWLAN.framework/Versions/A/CoreWLAN
dyld: loaded: /System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth
dyld: loaded: /System/Library/PrivateFrameworks/CoreWiFi.framework/Versions/A/CoreWiFi
dyld: loaded: /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit
dyld: loaded: /System/Library/Frameworks/CoreBluetooth.framework/Versions/A/CoreBluetooth
dyld: loaded: /System/Library/PrivateFrameworks/ChunkingLibrary.framework/Versions/A/ChunkingLibrary
dyld: loaded: /System/Library/PrivateFrameworks/SpeechRecognitionCore.framework/Versions/A/SpeechRecognitionCore
dyld: loaded: /usr/local/opt/pixman/lib/libpixman-1.0.dylib
dyld: loaded: /usr/lib/libexpat.1.dylib

But I don't think this should stop the PR from being merged, since it's vastly better than the non-alternative and it's not for this PR to change/improve libgdiplus.

@qmfrederik
Copy link
Contributor Author

@haf It's best to raise these issues outside of Homebrew because they are not related but may delay this PR being accepted.

To your issues:

  • macOS: That declaration is looking for a function named GetQDGlobalsThePort in Carbon.framework. This was removed in OS X v10.7. So it's an upstream mono issue, not a libgdiplus issue
  • Ubuntu: I'm guessing you're running on a headless system (no X server running); but (upstream) libgdiplus has a dependency on an X server on Linux. You can use xvfb on Linux and use something like xvfb-run. This should work.

@fxcoudert fxcoudert closed this in 99c9681 May 18, 2017
@fxcoudert
Copy link
Member

Thanks @qmfrederik and everyone who contributed to this PR! It is a very nice addition to Homebrew

@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new formula PR adds a new formula to Homebrew/homebrew-core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants