GNOME Bugzilla – Bug 653841
a helper script to build glib from git master on win32
Last modified: 2011-07-06 00:32:10 UTC
Created attachment 191119 [details] [review] the patch that works for vs9 When I was trying to build my own glib for win32, I found that there were already project files for the various versions of Visual studio, which was great. The problem was that these project files required some additional files that were generated by Makefiles and only bundled with the released packages. So if you want to use these project files to build from git source, you have to generate these required files by yourself, which means you need a Unix-like development environment. That's quite inconvenient for a windows developer using Visual studio. So I wrote a python script to generate these files following the similar logic as the building system on Unix/Linux. Currently, it only makes vs9/glib.sln run, because I have only Microsoft Visual Studio 2008. But I think it's quite straightforward to make it work for vs10/glib.sln. The drawback with this method is that it doesn't track the dependencies, which means whenever you rerun this script, your project file would be renewed and that project needs to rebuild as a whole. But this also happens with the current building system and you don't really need to run this script that often.
Created attachment 191231 [details] [review] Update to your setup.py Hi Shixin, Thanks for the patch-I took a look at it and updated it in some ways, and it also helped to me to find some problems regarding how the current GIO projects are filled in during every stable/unstable release. I did, however, updated it a bit for a few regards though, and maybe you might want to take a look at my patch against your setup.py Python script... Here are the highlights of my patch (sorry, I am not that good in Python, so please bear with my comments below): -Added support to create the VS2010 projects -Used glib-mkenums.in instead of glib-mkenums-as one needs to create it from glib-mkenums. You might want to add in your Python script on expanding/creating glib-mkenums though. Thank you, and God Bless!
Oh, by the way-I forgot to mention... Another pitfall for this patch (though the issue is not on your side)-In order to compile glib-genmarshal.exe, the gmarshal.strings file in $(srcroot)/gobject must be generated first, but it does not seem to be something trivial without a Unix-like shell. Do you have any ideas on how to generate this file with Python by any chance? P.S.: The "as one needs to create it from glib-mkenums" should read "as one needs to create it from glib-mkenums.in". Sorry. Thank you, and God bless!
Review of attachment 191119 [details] [review]: Hi, please see comments 1-2 regarding updates to setup.py You might want to tell people that this script is generally not for released tarballs though, BTW.
Created attachment 191252 [details] [review] generate glib-mkenums and gmarshal.strings This patch generates glib-mkenums and gmarshal.strings. I had these files already generated before, so I didn't find this problem. I also add a comment in the head of the script to state the purpose of the script. Hope that was clear enough.
For the generation of gmarshal.strings, there is actually a perl script, marshal-genstrings.pl, to do that. But in my script, I chose to do that in python, because it's trivial to implement, and I didn't want to add some extra perl burdens on anyone who happened to have to read/modify this script.
Created attachment 191263 [details] My updated version of setup.py (full version) Hi Shixin, I have updated your setup.py, which I have updated here for the following reasons: -Added VS 2010 expansion for the GLib, GIO and GObject projects -Fixed the filters that you used for expanding the GIO projects (I have pushed the updated filters upstream in Makefile.am), as some the filter names were not correct. You need to perform a 'git pull origin master' in your GLib tree for this. This is to avoid certain Windows source files to be included twice, which is not allowed on VS2010 (but acceptable on VS2008) You might want to take a look and see whether my updated setup.py (which I attached in this comment) are good for you, and perhaps make work from that file. This worked for me, provided that the glib-mkenums and gmarshal.strings were manually created beforehand-the setup.py script you provided here unfortunately did not generate the glib-mkenums and gmarshal.strings files... Is it possible that you resubmit your patch, which contains the generation of the glib-mkenums and gmarshal.strings files, and if my updates were ok, the generation of VS2010 project files and updates of GIO filters? Thank you, and God Bless!
Review of attachment 191252 [details] [review]: Sorry Shixin-it seems that you might have attached your original version of your patch by mistake...
Created attachment 191359 [details] [review] the correct version which generates glib-mkenums and gmarshal.strings Oops, there goes the correct version
Hi Shixin, Thanks for your patch-it looks good. Pushed as c83c91a5...e8b82a7 on GIT. p.s. Sorry, it did not make it in time for 2.29.10, but should be available in the next unstable release...
...Oh, I also added your changes to build/win32/vs9/README.txt to build/win32/vs10/README.txt and README.win32 as well, albeit with a bit of changes. Thanks though, and God Bless!