After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 653841 - a helper script to build glib from git master on win32
a helper script to build glib from git master on win32
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: win32
unspecified
Other Windows
: Normal enhancement
: ---
Assigned To: gtk-win32 maintainers
gtk-win32 maintainers
Depends on:
Blocks:
 
 
Reported: 2011-07-01 20:39 UTC by Shixin Zeng
Modified: 2011-07-06 00:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
the patch that works for vs9 (13.04 KB, patch)
2011-07-01 20:39 UTC, Shixin Zeng
none Details | Review
Update to your setup.py (12.00 KB, patch)
2011-07-04 13:14 UTC, Fan, Chun-wei
none Details | Review
generate glib-mkenums and gmarshal.strings (13.04 KB, patch)
2011-07-04 20:57 UTC, Shixin Zeng
needs-work Details | Review
My updated version of setup.py (full version) (15.69 KB, application/octet-stream)
2011-07-05 01:49 UTC, Fan, Chun-wei
  Details
the correct version which generates glib-mkenums and gmarshal.strings (19.31 KB, patch)
2011-07-05 20:05 UTC, Shixin Zeng
none Details | Review

Description Shixin Zeng 2011-07-01 20:39:19 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.
Comment 1 Fan, Chun-wei 2011-07-04 13:14:55 UTC
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!
Comment 2 Fan, Chun-wei 2011-07-04 13:21:15 UTC
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!
Comment 3 Fan, Chun-wei 2011-07-04 13:25:00 UTC
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.
Comment 4 Shixin Zeng 2011-07-04 20:57:02 UTC
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.
Comment 5 Shixin Zeng 2011-07-04 21:02:47 UTC
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.
Comment 6 Fan, Chun-wei 2011-07-05 01:49:00 UTC
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!
Comment 7 Fan, Chun-wei 2011-07-05 01:51:37 UTC
Review of attachment 191252 [details] [review]:

Sorry Shixin-it seems that you might have attached your original version of your patch by mistake...
Comment 8 Shixin Zeng 2011-07-05 20:05:44 UTC
Created attachment 191359 [details] [review]
the correct version which generates glib-mkenums and gmarshal.strings

Oops, there goes the correct version
Comment 9 Fan, Chun-wei 2011-07-06 00:28:00 UTC
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...
Comment 10 Fan, Chun-wei 2011-07-06 00:32:10 UTC
...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!