On a fairly regular basis, I run into problems that have already been solved by open source projects.
Let’s say, purely for the sake of example, that I’m adding functionality to a piece of open source software which lets it line wrap some information in your terminal. It needs to know the width of the user’s terminal to do so.
libuv (Node.JS’s platform layer) has already solved the problem (under *nix and Windows!) (so have a number of other projects, FWIW). It turns out that libuv is licensed under something which looks suspiciously like the MIT license:
Copyright Joyent, Inc. and other Node contributors. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Is there a right (legal and respectful) way to use the window-sizing logic from libuv in another project? Here are the options that I can think of:
- Nothing is required, since this doesn’t constitute a “substantial portion of the Software” (but including attribution in the source code would be nice).
- A full copy of the license should be included in the source code.
- A full copy of the license should be included in the source code and distributed with binaries.
- What if the destination project is closed-source?
- What if the borrowed code gets modified heavily (now or in the future)?
- What’s the best way for authors of open source code to encourage reuse of bits of it by other programmers, with reasonable restrictions (e.g. require attribution in the source code, but don’t require the license to be distributed with binaries which include it)?