[Development] Minified javascript libraries in Qt source code

Lisandro Damián Nicanor Pérez Meyer perezmeyer at gmail.com
Sun Sep 29 17:20:16 CEST 2013


On Friday 27 September 2013 19:11:52 Thiago Macieira wrote:
> On sexta-feira, 27 de setembro de 2013 22:54:58, Lisandro Damián Nicanor
> Pérez
> Meyer wrote:
> > This is a nice example, thanks Thiago for it. I think the problem here is
> > to  correctly define "best".
> > 
> > We can say that "best" is do the minimum required to comply with the
> > license.  If so, maybe shipping just the PNGs is just fine.
> 
> Right. Let's figure out what the letter & spirit of the license require.
> Then we can talk about convenience.

I checked the LGPL as stated in Qt4's documentation and the LICENSE.LGPL 
bundled in the tarball:

>From /usr/share/qt4/doc/html/lgpl.html:

  "Source code" for a work means the preferred form of the work for
  making modifications to it.  For a library, complete source code means
  all the source code for all modules it contains, plus any associated
  interface definition files, plus the scripts used to control compilation
  and installation of the library.

I have so far not found an indication that documentation is under a different 
license, so I understand they are also under the LGPL. ALso IANAL, so things 
might not be as I express them.

In including the jquery code in /usr/share/qt4/doc/html/webkit-fancybrowser-
jquery-min-js.html the jquery codes becomes under the LGPL. The preferred form 
of modification of jquery is the unminified jquery code. So, as *I* understand 
it, we need to ship both the unminified form of jquery (preferred form of 
modification) and the necessary scripts to minify them.

In the tarball there is also /tests/benchmarks/script/sunspider/tests/string-
unpack-code.js wich contains a copy of the minified jquery lib. In this 
particular case, my interpretation of the LGPL requieres that at least the 
minified jquery lib is included in the test at build time.

Note that in both cases I'm not saying that we should minify jquery at build 
time, but be able to do it with shipped scripts.

> > But we can also say that "best" is letting whoever downloads a tarball
> > from
> > us, and that tarball + a compiler is enough to build the whole project, be
> > able to change whatever she wants without the need to get another tarball.
> 
> Now that's convenience. For a couple of files, I don't think it's wrong to
> ship the extra sources and instructions or scripts to recreate if possible.
> It's just a couple bytes more.

I agree to call it that way. So let's suppose my assumptions above are OK and 
we need to ship this files. We could, as a convenience feature, use a single 
minified source for jquery and use that in all the relevant places:

./tools/qdoc3/doc/config/scripts/jquery.js
./doc/src/template/scripts/jquery.js
./examples/webkit/fancybrowser/jquery.min.js

We could use the same source for the three of them. This also has the 
advantage of knowing that the same version of jquery is used in all cases.

> With no buildsystem modification, though. No minification or rasterisation
> at build time. We don't do that even for the lexer used in qxmlstream (the
> qxmlstream.g file is shipped and there's a script to recreate, though).
> > Now my personal definition of "best" is the second one. So yes, I would
> > include the SVG/PSD files and generate the PNGs from there on build time
> > (much  as KDE does with icons, although there are other reasons there). I
> > understand that not everyone will agree with me, but I also know that
> > there
> > are lots of people who does. That's why distros like Debian or Ubuntu
> > enforce this.
> 
> I doubt that they enforce convenience. However, they do enforce "everything
> that we ship can be modified and here are the sources in the preferred
> format".
> 
> But just as the distros ship binaries and allow you to download the source
> tarballs, we can do the same if necessary: we can ship the processed files
> and make the original sources available on our website.
> 
> So, in the interest of respecting the licenses and keeping downstream happy,
> I vote for the Qt Project always supplying the preferred sources for
> modification for whatever we ship. Whether the same sources are present in
> our regular tarballs or not, it should be judged on a case-by-case basis.
> 
> (e.g., we don't want to add 50 MB monster PSD files to a 2 MB tarball)

I agree with that.

Kinds regards, Lisandro.

-- 
Lisandro Damián Nicanor Pérez Meyer
http://perezmeyer.com.ar/
http://perezmeyer.blogspot.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130929/617e3412/attachment.sig>


More information about the Development mailing list