public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: David Xu <davix@seas.upenn.edu>
To: cygwin@cygwin.com
Subject: Functional Cygwin GTK with native win32 backend
Date: Sun, 27 Dec 2015 19:11:00 -0000	[thread overview]
Message-ID: <CAHAz=whCeJghZVuLcrq_MJ649RqdvgR4cFi=Po9mbBEC=7VN3A@mail.gmail.com> (raw)

Hi!

I compiled GTK with the native win32 backend, and it is functional.
Brief demo: http://i.imgur.com/PAWyLdW.gif

I would like to bring up discussion about the possibility of including
a native windows build of GTK in the Cygwin package list as well,
since it turns out that the steps that I took weren't so bad.

The general strategy I used was to build the GTK dependencies with
native Windows backends where possible. Just getting those to compile
was half the battle. The other half of the battle was to make some
win32 API symbols from GLIB be exported in libglib-2.0.dll.a to be
visible to the build of GTK.

Caveat: I have not had a chance to test my build extensively yet,
since it *is* holiday break for me, but so far it seems to work. If
you're wondering why I did this, I did this because I was bored and
felt festive.

Happy holidays!

***
Addendum:

If you would like to reproduce my work, you can refer to
https://gist.github.com/lyze/a4f53f8fadac1068a994

If certain details are unclear or do not work, I apologize in advance
for that; I'd be happy to help clarify things.

Outline:

1) Build cairo-1.15.2 with the windows backend (with
--enable-win32=yes passed to ./configure). No patches necessary here.
We need the newer version because it gives us the needed symbol
cairo_win32_surface_create_with_format. This gives us the cairo-win32 package.

2) Build pango-1.39.0 from source. I just used the source release from
their website. You probably will have to specify PKG_CONFIG_PATH as
well to find the new cairo-win32 package.

3) Build epoxy-1.3.1 with the windows backend. I got the release from
the GitHub repository. Patch the release with the attached epoxy
patches, then run ./configure, which should prepare epoxy for EGL,
GLX, and WGL backends.

3) Build glib2.0-2.46.2-1. Here, I obtained the source from the Cygwin
package setup executable. Run cygport prep as usual, and then apply my
patches.

4) Finally, build gtk+-3.18.6. I obtained the source release from the
GNOME website. Apply patches, then configure with
--enable-win32-backend. The invocation I used:

./autogen.sh WINDRES=/usr/bin/windres
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig LDFLAGS='-L/usr/local/lib
-L/usr/lib/w32api' --enable-win32-backend

Gotchas:
You will probably have to specify PKG_CONFIG_PATH at every step, or
else you might pick up your existing library files instead of the
newly built ones. Same goes for LDFLAGS as well.

Apologies in advance if this email is in the wrong list, or if
specific discussion about these build details don't belong here.

-- 
David Xu

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

             reply	other threads:[~2015-12-27 19:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-27 19:11 David Xu [this message]
2015-12-27 21:47 ` Michael Enright

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHAz=whCeJghZVuLcrq_MJ649RqdvgR4cFi=Po9mbBEC=7VN3A@mail.gmail.com' \
    --to=davix@seas.upenn.edu \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).