1+1=10

扬长避短 vs 取长补短

使用LGPL授权的Qt开发商用程序的注意事项

注意:我不是律师,本文内容也只是我个人的理解,故内容仅供参考。如对LGPL如有任何疑问,请咨询你的律师。

从Qt5.4开始,一些新增加的模块开始使用LGPLv3授权,而不是先前的LGPLv2.1授权。 而这两个东西到底有什么区别,还真搞不清楚。

LGPLv2.1 vs LGPLv3

A Quick Guide to GPLv3 一文中介绍了GPL引入新版本的目的:主要是使用户远离以下三种的威胁。这应该也是LGPL 新旧版本的主要区别吧。

  • Tivoization
  • Laws prohibiting free software
  • Discriminatory patent deals

另外,这两个版本也不完全兼容 How are the various GNU licenses compatible with each other?

不过这些区别对普通用户似乎没有多大影响。

好吧,忽略二者的区别,那么LGPL有哪些基本要求。试着看看许可LGPLv2.1LGPLv3的文本,真的晕了...

使用LGPL库后,应用程序的义务

详见LGPLv2.1 的 section 6 或 LGPLv3 的 section 4

You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following:

大意是:应用程序可以闭源,但不能限制用户对程序所包含的Qt库部分的修改,以及出于对Qt库所做修改进行调试目的对应用程序所进行的逆向工程。同时,以下条款也必须满足

程序的每一份拷贝必须声明使用了LGPL授权的Qt

LGPLv3 相关条文:

a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License.

程序必须附带LGPL许可的副本

LGPLv3 相关条文:

b) Accompany the Combined Work with a copy of the GNU GPL and this license document.

如果程序执行过程中显示版权信息,那么必须显示Qt库的版权信息,并提供到LGPL许可副本的链接

LGPLv3 相关条文:

c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document.

确保应用程序的用户能够自由地替换掉你所使用的Qt

LGPLv3 相关条文:

d) Do one of the following:

  • 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.
  • 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version.

解读:这儿提供了三种做法

1 静态库链接的方式是可行的,但是必须提供相应的代码或预编译的文件,使得用户能够使用修改后的Qt重新编译或链接出可用的应用程序。

实际操作中,这个应该不容易实现。

2 如果用户系统中有可用的Qt的动态库,可以让应用程序直接使用它

对Linux等默认装有Qt库的系统,这应该是最简单的做法。

不过Windows等系统中,一般都没有Qt运行库,意味着要让用户先安装Qt,而后再安装使用程序。实际操作中,可能会不太友好。

3 提供程序的同时,为用户提供相应的Qt运行库。但必须确保用户能够用其他接口兼容的Qt库直接替换我们提供的Qt运行库。

Windows下可能只能这么做了。

只要用户要求,就必须提供相应的安装信息(Installation Information)

LGPLv3 相关条文:

e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.)

解读:

里面又涉及一大堆GPLv3中的条文。看不懂(可能一开始就用LGPL2.1的条文简单些),不过 按照 qt-licensing-terms 中的说法,Qt库的源代码(包括对Qt库的修改),都需要随程序一块提供,或者提供获取到源码的方式。特别值得注意的是,即使没有对Qt库进行任何修改,这些东西也必须提供。

Links

  • http://www.gnu.org/licenses/lgpl-3.0.html
  • http://www.gnu.org/licenses/lgpl-2.1.html
  • http://www.gnu.org/licenses/gpl-faq.html#LGPLStaticVsDynamic
  • http://www.gnu.org/licenses/quick-guide-gplv3.html

  • http://www.qt.io/qt-licensing-terms/

  • http://www.olafsw.de/protecting-software-freedom-the-qt-license-update/
  • http://blog.qt.io/blog/2014/08/20/adding-lgpl-v3-to-qt/

  • http://en.wikipedia.org/wiki/Tivoization

  • http://bbs.csdn.net/topics/350224093

Qt Qt

Comments