1================================= 2 GStreamer Static Linking README 3================================= 4 5DRAFT, April 2013 6 7 8 I. INTRODUCTION 9 10It is possible to link GStreamer libraries, plugins and applications 11statically, both in case of free/libre/open-source software applications 12and proprietary applications. On some platforms static linking may even 13be required. 14 15However, distributing statically linked binaries using GStreamer usually 16requires additional effort to stay compliant with the GNU LGPL v2.1 license. 17 18The purpose of this document is to draw attention to this fact, and to 19summarise in layman's terms what we believe is required from anyone 20distributing statically linked GStreamer binaries. Most of this also 21applies to dynamically linked GStreamer binaries. 22 23 24 II. DISCLAIMER 25 26This document is not legal advice, nor is it comprehensive. It may use 27words in ways that do not match the definition or use in the license 28text. It may even be outright wrong. Read the license text for all the 29details, it is the only legally binding document in this respect. 30 31This document is primarily concerned with the implications for the 32distribution of binaries based on LGPL-licensed software as imposed by 33the LGPL license, but there may be other restrictions to the distribution 34of such binaries, such as terms and conditions of distribution channels 35(e.g. "app stores"). 36 37 38 III. THE SPIRIT OF THE LGPL LICENSE 39 40The GNU LGPL v2.1 license allows use of such-licensed software by 41proprietary applications, but still aims to ensure that at least the 42LGPL-licensed software parts remain free under all circumstances. This 43means any changes to LGPL-licensed source code must be documented and 44be made available on request to those who received binaries of the 45software. It also means that it must be possible to make changes to the 46LGPL-licensed software parts and make the application use those, as far 47as that is possible. And that recipients of an application using 48LGPL-licensed software are made aware of their rights according to the 49LGPL license. 50 51In an environment where GStreamer libraries and plugins are used as 52dynamically-loaded shared objects (DLL/.so/.dyn files), this is usually 53not a big problem, because it is fairly easy to compile a modified version 54of the GStreamer libraries or LGPL plugins, and the application will/should 55just pick up and use the modified version automatically. All that is needed 56is for the original, LGPL-licensed source code and source code modifications 57to be made available, and for a way to build the libraries or plugins for 58the platform required (usually that will be using the build system scripts 59that come with GStreamer, and using the typical build environment on the 60system in question, but where that is not the case the needed build scripts 61and/or tools would need to be provided as well). 62 63 64 IV. THINGS YOU NEED TO DO 65 66 * You must tell users of your application that you are using LGPL-licensed 67 software, which LGPL-licensed software exactly, and you must provide them 68 with a copy of the license so they know their rights under the LGPL. 69 70 * You must provide (on request) all the source code and all the changes 71 or additions you have made to the LGPL-licensed software you are using. 72 73 For GStreamer code we would recommend that the changes be provided either 74 in form of a branch in a git repository, or as a set of "git format-patch"- 75 style patches against a GStreamer release or a snapshot of a GStreamer git 76 repository. The patches should ideally say what was changed and why it 77 was changed, and there should ideally be separate patches for independent 78 changes. 79 80 * You must provide a way for users of your application to make changes to 81 the LGPL-licensed parts of the code, and re-create a full application 82 binary with the changes (using the standard toolchain and tools of the 83 target platform; if you are using a custom toolchain or custom tools 84 you must provide these and document how to use them to create a new 85 application binary). 86 87 Note that this of course does not mean that the user is allowed to 88 re-distribute the changed application. Nor does it mean that you have 89 to provide your proprietary source code - it is sufficient to provide a 90 ready-made compiled object file that can be relinked into an application 91 binary with the re-compiled LGPL components. 92 93 94 V. THINGS TO LOOK OUT FOR 95 96While most GStreamer plugins and the libraries they depend on are licensed 97under the LGPL or even more permissive licenses, that is not the case for 98all plugins and libraries used, esp. those in the gst-plugins-ugly or 99some of those in the gst-plugins-bad set of plugins. 100 101When statically linking proprietary code, care must be taken not to 102statically link plugins or libraries that are licensed under less permissive 103terms than the LGPL, such as e.g. GPL-licensed libraries. 104 105 106 VI. SPECIAL CONSIDERATIONS FOR SPECIFIC USE-CASES 107 108 109 1. Proprietary GStreamer/GLib-based Application On iOS 110 111Let's assume an individual or a company wants to distribute a proprietary 112iOS application that is built on top of GStreamer and GLib through 113Apple's App Store. At the time of writing the Apple iPhone developer 114agreement didn’t allow the bundling of shared libraries, so distributing 115a proprietary iOS application with shared libraries is only possible using 116distribution mechanisms outside of the App Store and/or only to jailbroken 117devices, a prospect that may not appeal to our individual or company. So the 118only alternative then is to link everything statically, which means the 119obligations mentioned above come into play. 120 121 122 2. Example: Jabber on iOS 123 124Tandberg (now Cisco) created a Jabber application for iOS, based on GStreamer. 125On request they provided an LGPL compliance bundle in form of a zip file, with 126roughly the following contents: 127 128buildapp.sh 129readme.txt 130Jabber/Jabber-Info.plist 131Jabber/libip.a [236MB binary with proprietary code] 132Jabber/main.mm 133Jabber/xcconfig/Application.xcconfig 134Jabber/xcconfig/Debug.xcconfig 135Jabber/xcconfig/Release.xcconfig 136Jabber/xcconfig/Shared.xcconfig 137Jabber/Resources/*.lproj/Localizable.strings 138Jabber/Resources/{Images,Audio,Sounds,IB,Message Styles,Emoticons,Fonts}/* 139Jabber/Resources/* 140Jabber.xcodeproj/project.pbxproj 141Jabber.xcodeproj/project.xcworkspace/contents.xcworkspacedata 142opensource/build/config.site 143opensource/build/m4/movi.m4 144opensource/build/scripts/clean-deps.sh 145opensource/build/scripts/fixup-makefile.sh 146opensource/build/scripts/MoviMaker.py 147opensource/build.sh 148opensource/env.sh 149opensource/Makefile 150opensource/external/glib/* 151opensource/external/gstreamer/{gstreamer,gst-plugins-*}/* 152opensource/external/openssl/* 153opensource/external/proxy-libintl/* 154opensource/toolchain/darwin-x86/bin/{misc autotoools,m4,glib-mkenums,glib-genmarshal,libtool,pkg-config,etc.} 155opensource/toolchain/darwin-x86/share/{aclocal,aclocal-1.11,autoconf,automake-1.11,libtool}/* 156opensource/toolchain/darwin-x86/share/Config.pm 157opensource/toolchain/darwin-x86/share/Config.pm.movi.in 158patches/glib/glib.patch 159patches/gst-plugins-bad/gst-plugins-bad.patch 160patches/gst-plugins-base/gst-plugins-base.patch 161patches/gst-plugins-good/gst-plugins-good.patch 162patches/gstreamer/gstreamer.patch 163patches/openssl/openssl.patch 164 165readme.txt starts with "This Readme file describes how to build the Cisco 166Jabber for iPad application. You need to install Xcode, but the final package 167is built by running buildapp.sh." and describes how to build project, 168prerequisites, the procedure in detail, and a "How to Include Provisioning 169Profile Manually / Alternate Code Signing Instructions" section. 170 171 172 3. Random Links Which May Be Of Interest 173 174[0] http://multinc.com/2009/08/24/compatibility-between-the-iphone-app-store-and-the-lgpl/ 175