Re: GTK+3 win32/64 build environment

Arnel, Arnel A. Borja writes:
I don't know that there's a free version of Windows :D.

Now, regarding what Kevin digged out with the license, we know that it's not so free :-(.
Short version : cross-compiling GTK+3 is a headaches generator. It's not easy nor efficient, and hard to maintain.

I agree, it is hard to maintain. Though I still prefer cross-compilation, since it's faster in compiling. I sometimes fell asleep while compiling in MinGW in native Windows.

Agreed, it's a lot faster. Just harder ;-).
Long version with individual points for techs :
- MinGW/GCC for Windows is a standalone compiling environment : basically, you just drop all files in a directory, and it will work, regardless of the OS version you are using. That's because most of the base utils and libraries are compiled statically.

Is it really compiled statically? I don't see any difference when I moved from native MinGW to OBS. Some packages are static, most are not. Or atleast the old GTK+ 2 builds in have most of libraries compiled dynamically.

I was mostly speaking about MinGW core binaries (the compiler, linker, etc). ldd shows that the compilers refers to the current libc on Debian for instance. Could work though, but needs some trial-and-error.
MinGW under Linux is mostly installed via a package manager ("yum install mingw32-gcc-c++" on Fedora e.g.). You don't get to choose which version of the compiler you install. Same thing for the dependencies (libtool, expat, perl, python...). These versions are likely to change regarding the distro your are using, and you cannot copy their files from one computer to another because binaries are compiled dynamically (= depend on this particular box' libc a.s.o).

Cross-compiled GTK+ and other libraries use msvcrt, so usually the difference in compiler versions is not a problem except for libstdc++.

Don't get me into the libstdc++ thing, it will remind me of hard times :-D (I provide gtkmm packages for win32, was a pain to get right).
I'm using Ubuntu, and use the builds for 32-bit and 64-bit Windows that are built using OpenSUSE 12.3. I mix my libraries and programs compiled using GCC 4.6.3 with the ones from OBS that use GCC 4.8.0. Seems to work fine (I've been using them for two years now, I think), except that you should make sure that you use the libstdc++ that comes with your compiler (though it is used by g++, not gcc, and there are no GTK+ dependency that use g++, I believe; I only got this problem last week when I started porting Anjuta since its C++ parser uses g++).

Correct, C++ isn't used anywhere during the build process.
The problem might be python though, the cross-compiled Python that OBS uses are quite old (2.6). I don't use python so I'm not sure how big the impact would be, but you could compile the base GTK+ stack without python.

Because it doesn't work with newer Python (2.7 and >). I think GLib needs it ; could be patched around, have to check.
That means you depend on a precise distro version.

I recently moved from the builds for OpenSUSE 12.1 to 12.3 (and did that before many times before), upgraded my system many times too (since Ubuntu Oneiric I think), and been using it for about 2 years, so I don't think it is a problem. And I still use the packages I compiled myself before along with the newer set of libraries, seems like there are no problems.
Plus, my tests have proven that it matters while building. There are some fixes for libtool and the compiler itself in the buildenv (see the 64-bit one) ; if you use a different version, it will sometimes break the build. A solution would be to have a standalone MinGW install for Linux. I've googled for one without success. If one doesn't exist, the ultimate solution whould be to create one by recompiling MinGW statically myself, that means recompiling the compiler : I don't know anything about that, it will take lots of time.

Ubuntu, Fedora and OpenSUSE have the cross-compilers in their repos. OBS uses MinGW-w64 GCC 4.8 while I use MinGW-w64 GCC 4.6.3 in Ubuntu. I use their builds alongside each other. A year before I even combine MinGW-32 and MinGW-w64 builds, though I thought that might be a bad idea, and Ubuntu has MinGW-w64 cross-compilers anyway. If you want to build MinGW-w64, you could check OBS which have the most recent GCC cross-compilers.
- GTK+3 build process sometimes needs to run the binaries it has just generated. For instance, it runs "glib-compile-schemas" on its XML files to create the "schemas.compiled" catalog. Without it, GTK+ programs won't run. You cannot obviously run Win binaries under Linux -and using wine is not an option here. The only way is to generate, at the same time, the Linux version of the same binary ; that is to say, generate the stack *twice*. One time you obtain "glib-compile-schemas" for Linux, put it safe somewhere, then later during the Windows build you tell it to use *this* particular binary at this particular point. Ugly patches. Or you let the end-user do this, which is not user-friendly.

OBS uses the native tools that come with the build system while cross-compiling the packages. Package mingw32-glib2, while being built by OBS, uses the tools from the glib2* packages (which the build system will already have by default). This way gschemas.compiled is only needed before running applications, since the build system will use its native tools.

So if understand what you explain correctly, it does exactyly what I previously explained (compile the stack once Linux-natively, then cross-compile using some tools from the previous build). It works, I just find it very heavy as it needs some patches. BTW last time I checked gschemas.compiled wasn't provided by OBS.

- You won't be able to test and Q/A the binaries you just produced.
Wine cannot be used because it's not reliable with GTK+3 ; last time I tried under Debian, fonts were disproportional and pictures sometimes stripped. You have to run them on a native Windows OS. I think I have covered the most important points ; opinions and arguments are welcome. I'm sometimes available on IRC channel for discussions, too.

I use GTK+ 3 in Wine. Just install gnome-themes-standard (actually, compile first since it is not in OBS), then set Adwaita as theme. The default theme sucks in Wine (and sometimes in Windows too, so I use Adwaita in my installers). The problem with the pictures is probably related to the loading of gdk-pixbuf loaders. Probably the loaders cache is not created yet.

You might be right. I'm pretty sure I generated the caches, but the fact libraries were installed in wine's strange prefix ($HOME/.wine) and that I ran the commands directly, may have been the cause of these errors. Have to check again.
The reason why I like the builds from OBS is that they are already separated and most libraries are already available. I just pick which do I want to install. The only libraries and programs that I need to compile myself are gdl, glade, gnome-themes-standard, gtksourceview, libgda and libgee (gdl, glade and gtksourceview are dependencies of Anjuta; I use libgda and libgee for the payroll application that I built that we use at the office where I work.). Then I just run a script that calls a modified, fixes the pkg-config path, builds the schemas, reinstalls my compiled packages, fills the GTK+ 2 & 3 settings and copies the libstdc++ of my compiler, then I could build and test my programs. Sorry for a very long response. I'm not even sure if I was able to explain things properly.

No, it was very clear indeed ^^. Thank you !

gtk-devel-list mailing list
gtk-devel-list gnome org

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