================================= GStreamer Static Linking README=================================DRAFT, April 2013 I. INTRODUCTIONIt is possible to link GStreamer libraries, plugins and applicationsstatically, both in case of free/libre/open-source software applicationsand proprietary applications. On some platforms static linking may evenbe required.However, distributing statically linked binaries using GStreamer usuallyrequires additional effort to stay compliant with the GNU LGPL v2.1 license.The purpose of this document is to draw attention to this fact, and tosummarise in layman's terms what we believe is required from anyonedistributing statically linked GStreamer binaries. Most of this alsoapplies to dynamically linked GStreamer binaries. II. DISCLAIMERThis document is not legal advice, nor is it comprehensive. It may usewords in ways that do not match the definition or use in the licensetext. It may even be outright wrong. Read the license text for all thedetails, it is the only legally binding document in this respect.This document is primarily concerned with the implications for thedistribution of binaries based on LGPL-licensed software as imposed bythe LGPL license, but there may be other restrictions to the distributionof such binaries, such as terms and conditions of distribution channels(e.g. "app stores"). III. THE SPIRIT OF THE LGPL LICENSEThe GNU LGPL v2.1 license allows use of such-licensed software byproprietary applications, but still aims to ensure that at least theLGPL-licensed software parts remain free under all circumstances. Thismeans any changes to LGPL-licensed source code must be documented andbe made available on request to those who received binaries of thesoftware. It also means that it must be possible to make changes to theLGPL-licensed software parts and make the application use those, as faras that is possible. And that recipients of an application usingLGPL-licensed software are made aware of their rights according to theLGPL license.In an environment where GStreamer libraries and plugins are used asdynamically-loaded shared objects (DLL/.so/.dyn files), this is usuallynot a big problem, because it is fairly easy to compile a modified versionof the GStreamer libraries or LGPL plugins, and the application will/shouldjust pick up and use the modified version automatically. All that is neededis for the original, LGPL-licensed source code and source code modificationsto be made available, and for a way to build the libraries or plugins forthe platform required (usually that will be using the build system scriptsthat come with GStreamer, and using the typical build environment on thesystem in question, but where that is not the case the needed build scriptsand/or tools would need to be provided as well). IV. THINGS YOU NEED TO DO * You must tell users of your application that you are using LGPL-licensed software, which LGPL-licensed software exactly, and you must provide them with a copy of the license so they know their rights under the LGPL. * You must provide (on request) all the source code and all the changes or additions you have made to the LGPL-licensed software you are using. For GStreamer code we would recommend that the changes be provided either in form of a branch in a git repository, or as a set of "git format-patch"- style patches against a GStreamer release or a snapshot of a GStreamer git repository. The patches should ideally say what was changed and why it was changed, and there should ideally be separate patches for independent changes. * You must provide a way for users of your application to make changes to the LGPL-licensed parts of the code, and re-create a full application binary with the changes (using the standard toolchain and tools of the target platform; if you are using a custom toolchain or custom tools you must provide these and document how to use them to create a new application binary). Note that this of course does not mean that the user is allowed to re-distribute the changed application. Nor does it mean that you have to provide your proprietary source code - it is sufficient to provide a ready-made compiled object file that can be relinked into an application binary with the re-compiled LGPL components. V. THINGS TO LOOK OUT FORWhile most GStreamer plugins and the libraries they depend on are licensedunder the LGPL or even more permissive licenses, that is not the case forall plugins and libraries used, esp. those in the gst-plugins-ugly orsome of those in the gst-plugins-bad set of plugins.When statically linking proprietary code, care must be taken not tostatically link plugins or libraries that are licensed under less permissiveterms than the LGPL, such as e.g. GPL-licensed libraries. VI. SPECIAL CONSIDERATIONS FOR SPECIFIC USE-CASES 1. Proprietary GStreamer/GLib-based Application On iOSLet's assume an individual or a company wants to distribute a proprietaryiOS application that is built on top of GStreamer and GLib throughApple's App Store. At the time of writing the Apple iPhone developeragreement didn’t allow the bundling of shared libraries, so distributinga proprietary iOS application with shared libraries is only possible usingdistribution mechanisms outside of the App Store and/or only to jailbrokendevices, a prospect that may not appeal to our individual or company. So theonly alternative then is to link everything statically, which means theobligations mentioned above come into play. 2. Example: Jabber on iOSTandberg (now Cisco) created a Jabber application for iOS, based on GStreamer.On request they provided an LGPL compliance bundle in form of a zip file, withroughly the following contents:buildapp.shreadme.txtJabber/Jabber-Info.plistJabber/libip.a [236MB binary with proprietary code]Jabber/main.mmJabber/xcconfig/Application.xcconfigJabber/xcconfig/Debug.xcconfigJabber/xcconfig/Release.xcconfigJabber/xcconfig/Shared.xcconfigJabber/Resources/*.lproj/Localizable.stringsJabber/Resources/{Images,Audio,Sounds,IB,Message Styles,Emoticons,Fonts}/*Jabber/Resources/*Jabber.xcodeproj/project.pbxprojJabber.xcodeproj/project.xcworkspace/contents.xcworkspacedataopensource/build/config.siteopensource/build/m4/movi.m4opensource/build/scripts/clean-deps.shopensource/build/scripts/fixup-makefile.shopensource/build/scripts/MoviMaker.pyopensource/build.shopensource/env.shopensource/Makefileopensource/external/glib/*opensource/external/gstreamer/{gstreamer,gst-plugins-*}/*opensource/external/openssl/*opensource/external/proxy-libintl/*opensource/toolchain/darwin-x86/bin/{misc autotoools,m4,glib-mkenums,glib-genmarshal,libtool,pkg-config,etc.}opensource/toolchain/darwin-x86/share/{aclocal,aclocal-1.11,autoconf,automake-1.11,libtool}/*opensource/toolchain/darwin-x86/share/Config.pmopensource/toolchain/darwin-x86/share/Config.pm.movi.inpatches/glib/glib.patchpatches/gst-plugins-bad/gst-plugins-bad.patchpatches/gst-plugins-base/gst-plugins-base.patchpatches/gst-plugins-good/gst-plugins-good.patchpatches/gstreamer/gstreamer.patchpatches/openssl/openssl.patchreadme.txt starts with "This Readme file describes how to build the Cisco Jabber for iPad application. You need to install Xcode, but the final packageis built by running buildapp.sh." and describes how to build project,prerequisites, the procedure in detail, and a "How to Include ProvisioningProfile Manually / Alternate Code Signing Instructions" section. 3. Random Links Which May Be Of Interest[0] http://multinc.com/2009/08/24/compatibility-between-the-iphone-app-store-and-the-lgpl/