I know this is going to be long but I felt like I needed to explain the whole situation and my concerns in detail. Thanks in advance for reading and answering this question!
I'd like to write an application that depends on GPL licensed libraries or applications. However, I'm not keen on licensing my own code under GPL alone because I think it's too restrictive. Instead I would prefer choosing MIT/BSD-license for my own code, but the modules interfacing with GPL code give me a headache. They are accessed either by linked libraries (where GPL definitely applies) or just piped as a frontend to STDIN/STDOUT/STDERR to control the GPL application. (To be more specific: It's going to be an audio player/collection using xine-lib, mplayer and VLC as backends for playback; mplayer --slave and vlc -I rc enable control through pipes, xine-lib needs to be linked against.)
AFAIK GPL2 allowed interfacing with other licensed code through a hole in that license. Therefore AGPL and later GPL3 introduced some clause that defines any interaction (through a web service for example) to be also covered by (A)GPL. If I understood it correctly, I should be fine interfacing through command lines or pipes with GPL2 (but not GPL3) licensed applications. Unfortunately most projects did not fix the GPL version but instead left the notice "or [...] any later version" in their license, so this could become a dead end sooner or later if the projects change to GPL3.
MIT license includes the right to "sublicense" as long as you keep the original copyrights and permission notice. (see license)
Considering all that above, I see 4 options:
- License everything just MIT - GPL should "automatically" sublicense where needed. However I should include some warning somewhere in my code and I need to display the GPL license + disclaimer in some "about" dialog if the interfacing modules are used. In fact, I am already dual licensed at that point, except I don't have to include GPL into my code but just the compiled application.
- License my interfacing modules GPL, all the rest MIT - if GPL applies it should (from a legal point of view) automatically apply a more restrictive sublicense to my MIT code and I don't have to care about anything (except displaying license text and disclaimers in some "about" dialog or similar; well I should probably do the same in 1st case)
- Dual-license my project MIT/GPL everywhere except for interface modules that need to go GPL exclusively. GPL is safe, I have my non-interfacing code separated under MIT and can use both. Shouldn't be a problem, but dual-licenses are generally considered "bad style"? I consider relicensing MIT licensed code to GPL nonsense except for the legal perspective.
- License everything GPL2. I wouldn't choose that last option unless it's really necessary. It's sad because I would be stuck in the GPL grave but shouldn't have much negative effects on an audio player frontend. I'd like to fix the version to GPL2, not 3 - is it possible that I run into any incompatibilities between those two versions at some point?
Long story short, my questions are basically:
- Can I use GPL code in MIT code without having to (dual-)license everything that's not interfacing directly? (Unfortunately GPL would apply transitive, so if I use some module to interface with GPL, it infects all code at once, no matter if it's a module or not, even if it's just some very far away part of my application?)
- Can I write a frontend to a CLI or pipe interface to a GPL2 (and 3?) application under some other, less restrictive license than GPL, such as MIT?
My point is that I want to release an application depending on restrictive but free code that - itself, without the restricted modules - would be even less restrictive, more free than the original code. Since I only interface to it I am binding to GPL code but I am not modifying it. I would pass responsibility for checking legal compliance of my modules to anyone who is to relicense or fork the tricky parts of my code (should apply only to the backend interfaces).
On distribution I would either
- not include GPL dependencies at all (user needs to install xine-lib/mplayer/VLC himself) or
- include GPL dependencies with a separate install routine displaying all license information.
I should be safe on that side.
The big question remains:
Can I avoid dual-licensing on code level and which of the above licensing options are not permitted?
I know that FFMPEG determines whether it's GPL or LGPL on compile time from the list of selected modules; maybe my case can be compared to FFMPEG? My application is going to be implemented in Java and distributed as a JAR file whereas the interfaced applications/libraries are written in C if that changes anything to my situation. (only for xine-lib I use real bindings from libxine-java)
Edit: Maybe it wasn't clear enough that I can separate backend classes into different modules. All backends implement the same interface class which resides in the main module. An interface class does not contain any code, so this part could also be dual-licensed. The particular backend implementation however is some tiny subproject and may be compiled into a separate JAR so it is only linked into code base at runtime. That's why I mentioned Java at the end of my question and compared my case to FFMPEG. However, these JARs should ship together with some notice and license information to their particular parts on first use or installation (like FFMPEG does on compile time). All interfaced projects will be properly credited including a small reference to their license (named/linked). They are not included in the standard distribution so I do not bundle it. (bundles go GPL by dual or sublicense if needed) Modules can be optional, so if xine-lib is the only problem but mplayer and VLC are not, this should not enforce GPL globally.
Maybe there are any cases of other frontends that had the same issue?
Edit 2: Yet another idea: Can the main code base be MIT and at runtime change its license according to the active backend (all of which have the respective license they are interfacing with)? Distribution would need to contain a proper notice, that the player is a changeling and dynamically sublicenses from MIT as the broad base to some other OS license (GPL2/3) as needed and back to MIT or something else if the backend module is being switched. This should be possible with MIT? (After all, MIT permits more rights.) However, this is kind of absurd since I simply could have dual-licensed the code from the beginning (MIT would be distribution/runtime specific and may only apply to the main codebase without backend classes).