Re: Compiling for Windows [Was: argv revisited]

2016-05-06 Thread tito-wolit



On 05/06/2016 09:27 PM, Andrew Robinson wrote:

I'm sorry for that. One of my biggest flaws in human relations is detecting
when someone is being ironic, sarcastic, or is just joking around, and when
they are being serious.

I would think both list would be interested in knowing what is required of
their projects by the lawyers at GTK. This is an extremely discouraging thing
to consider in whether to use GTK or something else. I think if open source
wanted to be truly open, they would get rid of the lawyers and the lawyer
talk. It is either free to use without fine print, or it is not.


Rights are always coupled with obligations.
You want to take only the sweet without the bitter spots in life?

Ciao,
Tito
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Compiling for Windows [Was: argv revisited]

2016-05-06 Thread Florian Pelz
On 05/06/2016 07:01 PM, Lucas Levrel wrote:
> Le 5 mai 2016, Andrew Robinson a écrit :
>> 1) Because there are between 40 to 120Mb worth of libraries or their
>> dependencies I would have to post on my website.
> 
> It's not clear to me whether one has to distribute GTK if it's linked
> statically, because one doesn't distribute the libs themselves. But I'm
> no lawyer and didn't investigate the question (I don't distribute
> publicly my small app).
> 

I'm not a lawyer, but:

Part of the idea of the LGPL is, as I understand it, that the user can
relink with a modified version of the library. Imagine party A gives an
LGPL library only to party B who then distributes an app linking with
the library to C. If B refuses C's request for the library's source
code, C has no way to link to a modified version of the library.
Therefore I believe you have to distribute the source code of the
library version you used at least upon request.

In particular, when linking statically, you also have to provide
linkable object files or source code for _your_ application.

I.e. you have to be able to provide source code for all LGPL portions no
matter if you use MSYS2, MXE, Fedora packages or compile the
dependencies yourself. There's no way around it.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Compiling for Windows [Was: argv revisited]

2016-05-04 Thread Matthew A. Postiff
Try this package:

$ pacman -Ss mingw-w64-i686-gtk3
mingw32/mingw-w64-i686-gtk3 3.18.6-1 [installed]
GObject-based multi-platform GUI toolkit (v3) (mingw-w64)


On 5/4/2016 3:51 PM, Andrew Robinson wrote:
> Yeah, I see that, but that only downloads 64-bit binaries. I need the Win-32
> binaries. 
>
> On 5/4/2016 at 12:20 PM, Florian Pelz  wrote:
>> On 05/04/2016 03:59 PM, Andrew Robinson wrote:
>>> No, there are no Win32 binaries in MSYS2. Where are you getting your
>>> information?
>>>
>> MSYS2 contains pacman. `pacman -Syu mingw-w64-x86_64-gtk3` downloads
>> GTK+ binaries for x86_64 and puts them in the C:\msys64\mingw64
>> directory (by default). This directory is what you want to ship with
>> your application later on. Try it.
>>
>>
>> ___
>> gtk-app-devel-list mailing list
>> gtk-app-devel-list@gnome.org
>> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Compiling for Windows [Was: argv revisited]

2016-05-04 Thread Florian Pelz
On 05/04/2016 03:59 PM, Andrew Robinson wrote:
> No, there are no Win32 binaries in MSYS2. Where are you getting your
> information?
> 

MSYS2 contains pacman. `pacman -Syu mingw-w64-x86_64-gtk3` downloads
GTK+ binaries for x86_64 and puts them in the C:\msys64\mingw64
directory (by default). This directory is what you want to ship with
your application later on. Try it.


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Compiling for Windows [Was: argv revisited]

2016-05-04 Thread Florian Pelz
On 05/04/2016 02:22 AM, Andrew Robinson wrote:
> I have an idea! Why doesn't someone just compile all the binaries for Win32
> and Win64 and make them available on the Internet, that way none of us will
> have to go through all this stupid BS just to get some binaries? Just two
> packages, one for Win32 and one for Win64, using only just the command line
> options that
> https://blogs.gnome.org/nacho/2014/08/01/how-to-build-your-gtk-application-on-windows/
> tell us to use.

All the binaries are available and maintained in MSYS2. No need to
duplicate work.

If you want a newer Glib, you can try modifying the PKGBUILD and see if
it still works [1]. The version already seems right though.

You can also just download gedit for Windows, remove gedit.exe and put
in your .exe. You won't need some of the libraries and it's not very
clean and maintainable, but it's a quick hack to get a working GTK+.

And yes, Windows support could be a little cleaner and better
documented. It's not that bad though, people are working on it, and I'm
sure they'd appreciate help.

However, it seems many just ignore the LGPL when it comes to source code
distribution? Of course when using an unmodified version of glibc/GTK+/…
you can just find the library version you used and fetch the source code
from the upstream website when needed, but that may mean more work in
the future.

[1] https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-glib2

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Compiling for Windows [Was: argv revisited]

2016-05-03 Thread Florian Pelz
On 05/03/2016 08:34 PM, Dov Grobgeld wrote:
> The complete gtk run time is only about 20MB in size (at least for gtk2)
> which with todays hard disk sizes really is negligable, so I agree that
> there is no reason to try to create a common gtk runtime.
> 
> I still remember the frustration back in the days when there was a common
> run environment and installing glade would make inkscape or gimp fail, or
> vice verse. Individual run time environments is really the way to go!
> 
> For a peak into the bad old days, see e.g. the following thread:
> http://comments.gmane.org/gmane.comp.gnome.gtk%2B.general/16828
> 
> 
> Regards,
> Dov
> 

This is convincing. Thank you.

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Compiling for Windows [Was: argv revisited]

2016-05-03 Thread Dov Grobgeld
Another equivalent scons-based way of compiling for windows with gcc is
shown in my program giv.

See: https://github.com/dov/giv/blob/master/SConstruct

SCons uses the Sconstruct files to do the cross-compilation and also calls
out to nsis to create a windows installer.

The complete gtk run time is only about 20MB in size (at least for gtk2)
which with todays hard disk sizes really is negligable, so I agree that
there is no reason to try to create a common gtk runtime.

I still remember the frustration back in the days when there was a common
run environment and installing glade would make inkscape or gimp fail, or
vice verse. Individual run time environments is really the way to go!

For a peak into the bad old days, see e.g. the following thread:
http://comments.gmane.org/gmane.comp.gnome.gtk%2B.general/16828


Regards,
Dov

On Tue, May 3, 2016 at 7:44 PM, Allin Cottrell  wrote:

> On Tue, 3 May 2016, Dave Howorth wrote:
>
> On 2016-05-03 16:57, Florian Pelz wrote:
>>
>>> I'd like to have one standard GTK+ installer for the GTK+ DLLs etc. that
>>> can be downloaded and installed from other installers, so there is just
>>> one GTK+ installed on Windows instead of one copy of perhaps different
>>> versions of GTK+ for each application.
>>>
>>
>> That's been a longstanding desire of many people. The other side of the
>> argument of course is that all the applications have to be compatible with
>> that particular version of the libraries, which has sometimes proven to be
>> problematic even when the libraries ship with Windows. Expecting every
>> application to be updated every time there is a library update is not
>> realistic. It's not like a linux distro where the distro can update and
>> recompile all the dependencies itself.
>>
>
> Yep, Florian's desire is a "natural" one from the point of view of anyone
> used to Linux but unfortunately it's totally impractical on MS Windows.
> It's a real No-No for any third-party package to install DLLs into system
> directories on Windows; this would likely break all sorts of things.
>
> It may seem like a terrible waste of disk space to install multiple
> per-application copies of GTK, but you just have to get over it. Basically
> the same on Mac OS X.
>
> (I might note: even on Linux, GTK updates are not necessarily harmless.
> For example, updating from GTK 3.18 to 3.20 breaks emacs and gnumeric; they
> still run, but they're damaged.)
>
> Allin Cottrell
>
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Compiling for Windows [Was: argv revisited]

2016-05-03 Thread Allin Cottrell

On Tue, 3 May 2016, Dave Howorth wrote:


On 2016-05-03 16:57, Florian Pelz wrote:

I'd like to have one standard GTK+ installer for the GTK+ DLLs etc. that
can be downloaded and installed from other installers, so there is just
one GTK+ installed on Windows instead of one copy of perhaps different
versions of GTK+ for each application.


That's been a longstanding desire of many people. The other side of the 
argument of course is that all the applications have to be compatible with 
that particular version of the libraries, which has sometimes proven to be 
problematic even when the libraries ship with Windows. Expecting every 
application to be updated every time there is a library update is not 
realistic. It's not like a linux distro where the distro can update and 
recompile all the dependencies itself.


Yep, Florian's desire is a "natural" one from the point of view of 
anyone used to Linux but unfortunately it's totally impractical on 
MS Windows. It's a real No-No for any third-party package to install 
DLLs into system directories on Windows; this would likely break all 
sorts of things.


It may seem like a terrible waste of disk space to install multiple 
per-application copies of GTK, but you just have to get over it. 
Basically the same on Mac OS X.


(I might note: even on Linux, GTK updates are not necessarily 
harmless. For example, updating from GTK 3.18 to 3.20 breaks emacs 
and gnumeric; they still run, but they're damaged.)


Allin Cottrell
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Compiling for Windows [Was: argv revisited]

2016-05-03 Thread Florian Pelz
On 05/03/2016 06:12 PM, Dave Howorth wrote:
> On 2016-05-03 16:57, Florian Pelz wrote:
>> I'd like to have one standard GTK+ installer for the GTK+ DLLs etc. that
>> can be downloaded and installed from other installers, so there is just
>> one GTK+ installed on Windows instead of one copy of perhaps different
>> versions of GTK+ for each application.
> 
> That's been a longstanding desire of many people. The other side of the
> argument of course is that all the applications have to be compatible
> with that particular version of the libraries, which has sometimes
> proven to be problematic even when the libraries ship with Windows.
> Expecting every application to be updated every time there is a library
> update is not realistic. It's not like a linux distro where the distro
> can update and recompile all the dependencies itself.
>

That's a good argument, but those who don't want to risk breakage due to
incompatibilities could still bundle it the old-fashioned way. Of
course, maybe it's too much effort and most people prefer stability on
Windows. I'm not going to take the time, so thank you for explaining the
reasons.

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Compiling for Windows [Was: argv revisited]

2016-05-03 Thread Dave Howorth

On 2016-05-03 16:57, Florian Pelz wrote:

I'd like to have one standard GTK+ installer for the GTK+ DLLs etc. that
can be downloaded and installed from other installers, so there is just
one GTK+ installed on Windows instead of one copy of perhaps different
versions of GTK+ for each application.


That's been a longstanding desire of many people. The other side of the 
argument of course is that all the applications have to be compatible 
with that particular version of the libraries, which has sometimes 
proven to be problematic even when the libraries ship with Windows. 
Expecting every application to be updated every time there is a library 
update is not realistic. It's not like a linux distro where the distro 
can update and recompile all the dependencies itself.

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Compiling for Windows [Was: argv revisited]

2016-05-03 Thread Florian Pelz
On 05/03/2016 03:26 PM, Lucas Levrel wrote:
> By default MXE links statically. So you don't have any dll to bundle
> with your app. In such circumstances, what does LGPL say? Do you still
> have to provide the GTK source code (given that you don't distribute GTK
> libs)?
> 

IANAL, but if the library machine code is part of the distribution, you
have to distribute the library source code at least upon request. Static
linking additionally means that it must be possible to relink the
application with a modified library, i.e. either source code or linkable
object files for the app using it have to be provided.

For MSYS2, all LGPL dependencies would have to be manually recompiled by
downloading their PKGBUILDs and running makepkg for each package to get
its source.

I thought that if it compiles from source by default anyway, it is
perhaps easier to distribute source code. I haven't tried MXE yet
though. I will try it and see.

I'd like to have one standard GTK+ installer for the GTK+ DLLs etc. that
can be downloaded and installed from other installers, so there is just
one GTK+ installed on Windows instead of one copy of perhaps different
versions of GTK+ for each application.

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Compiling for Windows [Was: argv revisited]

2016-05-03 Thread Florian Pelz
On 05/03/2016 04:57 PM, Andrew Robinson wrote:
> Well I can't ship MSYS2 and MXE with my application, and I most certainly
> can't sell any application to grandma and grandpa, if it requires instructions
> on how to install MSYS2 and MXE just so you can run my application.
> 

For MSYS2, you create a package for installing your application in
MSYS2. Then you use a clean MSYS2 installation with which you install
your application package and all dependencies. You can then copy the
installed directories and contents and use them as a bundle. You still
have to ship the GTK+ source code you used though.

Look at gedit for an example:

https://git.gnome.org/browse/gedit/tree/win32/make-gedit-installer

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Compiling for Windows [Was: argv revisited]

2016-05-03 Thread Lucas Levrel

Le 2 mai 2016, Florian Pelz a écrit :


On 05/02/2016 12:36 PM, Lucas Levrel wrote:

Then I found MinGW Cross Env, now called MXE (http://mxe.cc/). It
compiled my project with no effort at all.


This is interesting. May I hijack this thread?

I did not know about MXE. What is their relationship with MSYS2?


I don't know. I'm a mere user and haven't even subscribed to their ML.


Distributing the GTK+ source code with bundles for LGPL compliance seems
easier with MXE. How do others handle source code distribution? This is
not an issue for GNOME projects and I can't find examples.

Is it really necessary for every Windows application bundle to ship its
own copy of GTK+?


By default MXE links statically. So you don't have any dll to bundle with 
your app. In such circumstances, what does LGPL say? Do you still have to 
provide the GTK source code (given that you don't distribute GTK libs)?


--
Lucas Levrel
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Compiling for Windows [Was: argv revisited]

2016-05-02 Thread Andrew Robinson
Thank you Lucas, for submitting this post. MXE seems very interesting and I
feel compelled to do some more research into it.

On 5/2/2016 at 3:36 AM, Lucas Levrel  wrote:
>(copy to OP in case he's already unsubscribed, apologies for duplication 
>if he's not)
>
>Le 30 avril 2016, Andrew Robinson a écrit :
>> Now my new problem I had was either locating a Win32 version of GTK+
greater
>> than v3.18 or locating a version of libglib.dll greater than v2.40. It
isn't
>> going to happen. The GTK+ project itself does not support Win32 or Win64,
>> expecting the developer to install MSYS2 and then ... nothing. The GTK+
>> project gives no further instructions on what to do next. Getting the Linux
>> binaries for GTK+ in MSYS2 seems easy, but I don't want the Linux binaries,
I
>> want the Windows binaries. I would compile my own binaries for Windows but
>> there is little reliable and complete information out there on how to do it
>> and what is there isn't credible. From what I understand, compiling
binaries
>> for Win32 is a very time consuming and tedious project, so I knew if I had
any
>> problems compiling it, I would not receive any help from the GTK+ (or
probably
>> even the GNOME) community in resolving them.
>
>I'm not an expert programmer and when I wanted to compile for Windows the 
>software I developped in Linux, I couldn't achieve a satisfactory result 
>(using the -mwin32 or -mwindows flag gave either a clumsy additional 
>command window, or yielded an antivirus alert!).
>
>Then I found MinGW Cross Env, now called MXE (http://mxe.cc/). It compiled 
>my project with no effort at all. When you install it, it compiles the 
>cross-compiler and the libs you want, so this takes quite long, but with 
>no user intervention. Then all you have to do is add such lines in your 
>Linux-ready Makefile:
>
># prepend all binaries with a later-defined prefix
>PKG_CONFIG=$(CROSS)pkg-config
>CXX=$(CROSS)g++
>LD=$(CROSS)ld
>AR=$(CROSS)ar
>STRIP=$(CROSS)strip
>..
># define the prefix in the rules targeting Windows
>myrule : CROSS=/path/to/bin/i686-pc-mingw32-
>myrule : ...
>
>HTH
>
>-- 
>Lucas Levrel

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Compiling for Windows [Was: argv revisited]

2016-05-02 Thread Florian Pelz
On 05/02/2016 12:36 PM, Lucas Levrel wrote:
> […]
> 
> I'm not an expert programmer and when I wanted to compile for Windows
> the software I developped in Linux, I couldn't achieve a satisfactory
> result (using the -mwin32 or -mwindows flag gave either a clumsy
> additional command window, or yielded an antivirus alert!).
> 
> Then I found MinGW Cross Env, now called MXE (http://mxe.cc/). It
> compiled my project with no effort at all. When you install it, it
> compiles the cross-compiler and the libs you want, so this takes quite
> long, but with no user intervention. Then all you have to do is add such
> lines in your Linux-ready Makefile:
> 
> # prepend all binaries with a later-defined prefix
> PKG_CONFIG=$(CROSS)pkg-config
> CXX=$(CROSS)g++
> LD=$(CROSS)ld
> AR=$(CROSS)ar
> STRIP=$(CROSS)strip
> ...
> # define the prefix in the rules targeting Windows
> myrule : CROSS=/path/to/bin/i686-pc-mingw32-
> myrule : ...
> 
> HTH
> 

This is interesting. May I hijack this thread?

I did not know about MXE. What is their relationship with MSYS2?

Distributing the GTK+ source code with bundles for LGPL compliance seems
easier with MXE. How do others handle source code distribution? This is
not an issue for GNOME projects and I can't find examples.

Is it really necessary for every Windows application bundle to ship its
own copy of GTK+?

Regards,
Florian
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list