Re: building recent versions of clutter with mingw



Howdy,

Tyson Neuroth wrote:
Hello.  I've been trying to build clutter with mingw without success
using the old instructions.  It seams that the win32 dependency binaries
are not up to date? 

Is anyone having success doing this with modern versions of clutter? 
What is my best plan of action?

Had you made any progress on this?

Last week I was able to build clutter 1.14.4 on mingw/win32, as well
as clutter-gst-2.0.8 and clutter-gtk-1.3.2 , but I needed to modify
the mingw-fetch-dependencies.sh script.  (Diffs below.)

http://ftp.gnome.org/pub/GNOME/sources/clutter/1.14/clutter-1.14.4.tar.xz
http://ftp.gnome.org/pub/GNOME/sources/clutter-gst/2.0/clutter-gst-2.0.8.tar.xz
http://ftp.gnome.org/pub/GNOME/sources/clutter-gtk/1.3/clutter-gtk-1.3.2.tar.xz

I also began with as many recent precompiled dependencies as I could
find.  The gstreamer mingw build from freedesktop.org provides most all
of the dependencies needed by clutter 1.14.4.  (The glib version was not
recent enough to build clutter 1.16.x, so I stuck with 1.14.)

http://gstreamer.freedesktop.org/pkg/windows/1.2.0/gstreamer-1.0-x86-1.2.0.msi
http://gstreamer.freedesktop.org/pkg/windows/1.2.0/gstreamer-1.0-devel-x86-1.2.0.msi

Note, the gstreamer pkgconfig (*.pc) files (as well as several other files)
refer to a /c/gstreamer/ path, so it is probably best to install to that
location.  I installed elsewhere and so wrote a small script to patch
the paths in the gstreamer files.

  For completeness sake, here is the script I used:

  $ find ./opt/clutter-work/clutter-cross -type f \( -name "*-config" -o -name "*.conf" -o -name "*.sh" -o 
-name "*.la" -o -name "*.pc" \) | xargs ruby -e 'ARGV.each{|f| t=File.read(f); t2 = 
t.gsub(%r{(/c/|c:/)gstreamer/1.0/x86},"/opt/clutter-work/clutter-cross"); (File.open(f,"wb"){|io| io.write 
t2}) unless t==t2; }'

  Note, the msys bash shell seems to perform string substitution on arguments
  containing substrings like "c:/", even when the shell argument is enclosed
  in single quotes.  So it was corrupting the regexp string in the script above.
  I did not figure out how to prevent that, so I ran the script from a cygwin
  bash shell instead of the msys bash.

In addition to gstreamer, I also used gtk+ binaries from:

http://www.tarnyko.net/repo/GTK+-Bundle-3.4.2_(TARNYKO).exe


My overall approach was to use the clutter-work/clutter-cross directory
structure described on: https://wiki.gnome.org/Clutter/Building/Windows

So I began by copying the gstreamer installation into clutter-cross with
rsync -av, and then overlaying the gtk+ installation on top of that with
rsync -av --ignore-existing .

# in /opt:

$ mkdir -p clutter-work/clutter-cross
$ rsync -av gstreamer/1.0/x86/* clutter-work/clutter-cross/.
$ rsync -av --ignore-existing gtk+-bundle-3.4.2/* clutter-work/clutter-cross/.

Then I modified the clutter mingw-fetch-dependencies.sh script (diffs
below) to remove the binary dependencies it would try to download, and
also to update the source dependencies with newer versions appropriate
for clutter 1.14.4:

  1.14.4 Clutter depends on:
    GLib >= 2.31.19
    JSON-GLib >= 0.12.0
    Cogl >= 1.14.0
    Cairo >= 1.10
    Pango >= 1.30
    Atk >= 2.5.3

# in /opt/clutter-work:

$ export PATH="/opt/clutter-work/clutter-cross/bin:$PATH"
$ MINGW_TOOL_PREFIX="/mingw/bin/" sh ./downloads/mingw-fetch-dependencies.sh

I seem to recall there was still some issue with mingw-fetch-dependencies.sh
trying to build the various sources (possibly relating to config.guess but
I forget the particulars.)

So I built the sources manually:

# for each:
# /opt/clutter-work/build/json-glib-0.16.2
# /opt/clutter-work/build/atk-2.10.0
# /opt/clutter-work/build/cogl-1.14.0

$ ./configure --prefix=/opt/clutter-work/clutter-cross --build=i686-pc-mingw32 'CFLAGS=-mms-bitfields 
-I/opt/clutter-work/clutter-cross/include' PKG_CONFIG=/opt/clutter-work/build/run-pkg-config.sh
$ make
$ make install

Finally, the dependencies for clutter were built.

I was then able to build clutter 1.14.4 using the same configure / make install
lines above.

Success!

Here's what I used to run all the clutter example programs:

# in /opt/clutter-work/build/clutter-1.14.4/tests/interactive:
$ for f in `/bin/ls -1 test-* | grep -F -v .` ; do echo $f && ./$f ; done


After that, building clutter-gst and clutter-gtk went pretty smoothly (again
using the same configure line as above.)  There was one windows-related compile
error in clutter-gtk-1.3.2:

# bad include path, manually patch:
#
# clutter-gtk/gtk-clutter-actor.c:#include <clutter/clutter-win32.h>
# to:
# clutter-gtk/gtk-clutter-actor.c:#include <clutter/win32/clutter-win32.h>


Anyway, the above finally produced all the clutter-related builds I wanted.


  *  *  *

Note 1:

One thing, I was never able to bootstrap from a fresh git clone of
clutter, or anything with an autogen.sh script trying to create the
configure script.  I only ever had success if the configure script
already existed.

I ran into several issues trying to the get ./autogen.sh scripts to
work, not the least of which was the msys bash again corrupting
command line arguments containing certain sub-strings.

So for instance, a configure script might fail because it was running
a command like:

$ ($XMLCATALOG --noout "$XML_CATALOG_FILE" "-//OASIS//DTD DocBook XML V4.3//EN" >&2) 2>&5

Which expanded to something like:

$ /opt/clutter-work/clutter-cross/bin/xmlcatalog --noout /etc/xml/catalog "-//OASIS//DTD DocBook XML V4.3//EN"

Which was (silently) failing with an error like:

  No entry for PUBLIC -/M:/dev/mingw/msys/1.0/OASIS/DTD DocBook XML V4.3/EN

Notice the "-//" part of the original argument was converted into an
unwanted path expansion before it was seen by the xmlcatalog program,
causing the failure.

I suspect there must be some way to prevent msys bash from performing
these substitutions, but I never found it.

So, I stuck with pre-built configure scripts.  (An alternative I tested
successfully but did not end up using was to run the ./autogen.sh on a
Linux box, then copy the results over to the windows system.)


  *  *  *

Note 2:

Shortly after getting clutter built as outlined above, I stumbled upon a
different site having newer mingw/win32 binary packages:

http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Factory/noarch/

These appear to be new enough to build clutter 1.16.x instead of 1.14.x,
although I have not tried this yet.

What I did do was download a couple of the rpm's and extract them, and
their contents did look reasonable (including containing the pkgconfig
files, etc.)

Example extraction of the rpm files:

$ rpm2cpio ../mingw32-glib2-2.38.0-1.13.noarch.rpm | cpio -idv
$ rpm2cpio ../mingw32-glib2-devel-2.38.0-1.13.noarch.rpm | cpio -idv

(For whatever reason, the `rpm2cpio | cpio` on cygwin produced garbage,
but the extraction worked fine on Linux.)


  *  *  *

Anyway, hope this helps.

It was certainly an interesting contrast with (for instance) macports,
with which all of the above was as simple as e.g.

$ port install  gtk3 +no_x11 +quartz  clutter +no_x11 +quartz

etc.

It would be great to have something that simple for mingw builds.

And considering how many hundreds of mingw binary packages exist on that
opensuse.org site, it would kind of seem like they must have already
implemented some automated mingw equivalent of "port install" themselves??


Regards,

Bill



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Crudely patched mingw-fetch-dependencies.sh script:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

$ diff -u mingw-fetch-dependencies.orig.sh mingw-fetch-dependencies.sh
--- mingw-fetch-dependencies.orig.sh    2013-09-23 04:00:04 -0700
+++ mingw-fetch-dependencies.sh 2013-10-16 05:33:45 -0700
@@ -5,29 +5,34 @@
 # Windows under the MSYS/MinGW environment. It will use the GTK
 # binaries from Tor Lillqvist.

-TOR_URL="http://ftp.gnome.org/pub/gnome/binaries/win32";;
-
-TOR_BINARIES=( \
-    glib/2.28/glib{-dev,}_2.28.1-1_win32.zip \
-    gtk+/2.16/gtk+{-dev,}_2.16.6-2_win32.zip \
-    pango/1.28/pango{-dev,}_1.28.0-1_win32.zip );
-
-TOR_DEP_URL="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies";;
-
-TOR_DEPS=( \
-    cairo{-dev,}_1.10.0-2_win32.zip \
-    gettext-runtime-{dev-,}0.17-1.zip \
-    fontconfig{-dev,}_2.8.0-2_win32.zip \
-    freetype{-dev,}_2.3.12-1_win32.zip \
-    expat_2.0.1-1_win32.zip \
-    libpng{-dev,}_1.4.0-1_win32.zip \
-    zlib{-dev,}_1.2.4-2_win32.zip );
+#      TOR_URL="http://ftp.gnome.org/pub/gnome/binaries/win32";;
+#
+#      TOR_BINARIES=( \
+#              glib/2.28/glib{-dev,}_2.28.1-1_win32.zip \
+#              gtk+/2.16/gtk+{-dev,}_2.16.6-2_win32.zip \
+#              pango/1.28/pango{-dev,}_1.28.0-1_win32.zip );
+#
+#      TOR_DEP_URL="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies";;
+#
+#      TOR_DEPS=( \
+#              cairo{-dev,}_1.10.0-2_win32.zip \
+#              gettext-runtime-{dev-,}0.17-1.zip \
+#              fontconfig{-dev,}_2.8.0-2_win32.zip \
+#              freetype{-dev,}_2.3.12-1_win32.zip \
+#              expat_2.0.1-1_win32.zip \
+#              libpng{-dev,}_1.4.0-1_win32.zip \
+#              zlib{-dev,}_1.2.4-2_win32.zip );
+
+#      SOURCES_DEPS=(\
+#              cogl/1.8/cogl-1.8.0.tar.bz2 \
+#              json-glib/0.12/json-glib-0.12.2.tar.bz2 \
+#              atk/2.1/atk-2.1.91.tar.bz2 );

 GNOME_SOURCES_URL="http://ftp.gnome.org/pub/GNOME/sources/";
 SOURCES_DEPS=(\
-    cogl/1.8/cogl-1.8.0.tar.bz2 \
-    json-glib/0.12/json-glib-0.12.2.tar.bz2 \
-    atk/2.1/atk-2.1.91.tar.bz2 );
+    cogl/1.14/cogl-1.14.0.tar.xz \
+    json-glib/0.16/json-glib-0.16.2.tar.xz \
+    atk/2.10/atk-2.10.0.tar.xz );

 GL_HEADER_URLS=( \
     http://cgit.freedesktop.org/mesa/mesa/plain/include/GL/gl.h \
@@ -132,7 +137,7 @@
     local exdir="$1"; shift;
     local tarfile="$1"; shift;

-    tar -C "$exdir" -jxvf "$tarfile" "$@";
+    tar -C "$exdir" -Jxvf "$tarfile" "$@";

     if [ "$?" -ne 0 ]; then
        echo "Failed to extract $tarfile";
@@ -190,8 +195,10 @@
     local dep="$1"; shift;
     local builddir="$BUILD_DIR/$dep";

+set -x
     cd "$builddir"
     ./configure --prefix="$ROOT_DIR" --host="$TARGET" --target="$TARGET" --build="`./config.guess`" 
CFLAGS="-mms-bitfields -I$ROOT_DIR/include" PKG_CONFIG="$RUN_PKG_CONFIG";
+set +x

     if [ "$?" -ne 0 ]; then
        echo "Failed to configure $dep";
@@ -356,7 +363,7 @@
 for dep in "${SOURCES_DEPS[ ]}"; do
     echo "Building $dep...";
     src="${dep##*/}";
-    src="${src%%.tar.bz2}";
+    src="${src%%.tar.xz}";
     do_cross_compile "$src"
 done;




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]