-
Notifications
You must be signed in to change notification settings - Fork 21
Description
Introducing libusb obj/binary code into the depthai project, distributing it, etc. introduces libusb's LGPL licensing.
https://www.gnu.org/licenses/gpl-faq.html#LGPLStaticVsDynamic
I like tools that "help keep honest people honest". And to help prevent accidents.
I request tools/processes in depthai to manage the inclusion/flags of dependencies that have restrictive licensing (libusb is just the first one...)
@themarpe writes
Yeah, LGPL isn't the most open licence but will work okay as long as we note a couple of things.
There are 2 ways to go:
- make libusb a dll (as is already on macos and Linux platforms). Windows might make this a tad harder because of the lack of rpath
- compile depthai-core as dll with libusb static
The third option of having static libusb and static core, comes with a caveat that consuming application must then either be: provided in an object form to be able to relink another libusb or be opensource. This case should be documented so people aren't introducing licencing incompatible code into their project.
Note, we'll default to build libusb as a dll, so the change shouldn't affect anyone (with exception of Windows users regarding installing the libusb dll along their app)
https://softwareengineering.stackexchange.com/questions/312758/does-providing-object-files-satisfy-lgpl-relink-clause#312759
Core doesn't have to become LGPL licenced as there is the exemption of being able to relink with another version of libusb, which an opensource library consuming it fits into (in dll case).
Disclaimer, I'm am not a lawyer - this is my understanding from reading through various sources.
I am in aligment with that (as a non-lawyer).
Suggested work
- adjust depthai project(s) cmake to enable those three major options.
BUILD_SHAREDis already avail, but there will need to be more granularity to specify which components are shared/dynamic and which are static so to comply with licensing - add licensing section to https://docs.luxonis.com/en/latest/ (No content exists there today)
- depthai docs list those major three options and the cmake/compile flags to use
- add DLL loading path management to Windows codepath to enable
rpathsimilar behavior. I can help with this. I have mature code 8+ years that does this.
FYI, OpenCV has a cmake OPENCV_ENABLE_NONFREE. It adjusts the cmake flags/files to help devs be more honest and prevent accidential license issues.