Repository: dropbox/rust-brotli (language: rust)

Issue:
BSD or MIT
Hello, Cargo.toml lists BSD OR MIT, however LICENSE file contains only info about BSD... Who is right?


Discussion / hints:
I suppose the license file is right... I can adjust the Cargo.toml
both licenses are sufficiently permissive that they are quite compatible.
Looks like this issue is still unresolved as of today?
Most Rust projects prefer to use `Apache OR MIT` approach because MIT is not very compatible with GPL (if my memory is serving me right), and so having two clause approach allows users to use code everywhere more freely.
Then the license text for MIT should probably be added to this repo too?

The current license file (https://github.com/dropbox/rust-brotli/blob/master/LICENSE) file only contains the BSD-3-Clause license text, but the MIT license requires that license text is included with redistributed sources.

Usually dual-licensed crates handle this by having two separate license files (i.e. LICENSE-Apache and LICENSE-MIT, in most cases).

> MIT is not very compatible with GPL

As far as I know, the problem wrt/ GPL compatibility is actually caused by the Apache-2.0 license, not the MIT license.

Hmmm should probably copy the license from https://github.com/google/brotli/blob/master/LICENSE
It would be great to see something happen here. Since the [`MIT` license](https://spdx.org/licenses/MIT.html) requires including the copyright and permission notices (the license text) in copies or substantial portions, it’s not possible for people to actually use this software under `MIT` terms if there’s no original license text available. This makes the crate effectively `BSD-3-Clause`-only for those who care about license compliance, and it creates a pitfall and an annoyance for people like distribution packagers, who have to patch the license metadata in `Cargo.toml` to avoid misleading people.
As a further wrinkle, similarly to https://github.com/dropbox/rust-brotli-decompressor/issues/9#issuecomment-1145129711, it turns out that one file is owned by Google and distributed only under `MIT` terms, so the crate isn’t even properly `BSD-3-Clause`; it would have to be `BSD-3-Clause AND MIT`, and the license text for that file needs to be present.

https://github.com/dropbox/rust-brotli/blob/37d403b437c3cbd1c686871a4167290aab401704/src/enc/entropy_encode.rs#L1-L5

Please do something about this!
It looks like `entropy_encode.rs` is based on https://github.com/google/brotli/blob/v1.1.0/c/enc/entropy_encode.c, so (despite the discrepancy in copyright statement between the header and the license file), https://github.com/google/brotli/blob/v1.1.0/LICENSE is probably the appropriate license text here.

Fix patch:
diff --git a/Cargo.toml b/Cargo.toml
index 91868a80..26adb17b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,7 +3,7 @@ name = "brotli"
 version = "6.0.0"
 authors = ["Daniel Reiter Horn <danielrh@dropbox.com>", "The Brotli Authors"]
 description = "A brotli compressor and decompressor that with an interface avoiding the rust stdlib. This makes it suitable for embedded devices and kernels. It is designed with a pluggable allocator so that the standard lib's allocator may be employed. The default build also includes a stdlib allocator and stream interface. Disable this with --features=no-stdlib. All included code is safe."
-license = "BSD-3-Clause OR MIT"
+license = "BSD-3-Clause AND MIT"
 documentation = "https://docs.rs/brotli/"
 homepage = "https://github.com/dropbox/rust-brotli"
 repository = "https://github.com/dropbox/rust-brotli"
diff --git a/LICENSE b/LICENSE.BSD-3-Clause
similarity index 100%
rename from LICENSE
rename to LICENSE.BSD-3-Clause
diff --git a/LICENSE.MIT b/LICENSE.MIT
new file mode 100644
index 00000000..33b7cdd2
--- /dev/null
+++ b/LICENSE.MIT
@@ -0,0 +1,19 @@
+Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors.
+
+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.


Test patch: