Skip to content

Commit

Permalink
Clarify the licensing
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Jan 22, 2025
1 parent 757cd84 commit cfb1992
Show file tree
Hide file tree
Showing 17 changed files with 67 additions and 43 deletions.
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ If you're confused about this, don't worry too much about it, if you enable
"Allow edits by maintainers" we can fix it for you.


## Licensing

When contributing, you agree to license your work under the trio
`Zlib OR Apache-2.0 OR MIT` license (regardless of what the crate's current
license is).

See also [the license document](./LICENSE.md).


## Release checklist

Copy and fill out the following checklist into the release PR:
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ repository = "https://github.com/madsmtm/objc2"

# Remember to update in header-translator, and manually authored lib.rs.
version = "0.2.2"
# Some crates in this repo may have a different license, see each crate for the specifics.
# Some crates in this repo have a different license, see LICENSE.md.
license = "Zlib OR Apache-2.0 OR MIT"
license-file = "LICENSE.md"
categories = [
"api-bindings",
"development-tools::ffi",
Expand Down
36 changes: 36 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# License

The licensing of these crates is a bit complicated:
- The crates `objc2`, `block2`, `objc2-foundation` and `objc2-encode` are
[currently][#23] licensed under [the MIT license][MIT].
- The `dispatch2` crate is dual-licensed under the [Apache-2.0] or [MIT]
license, at your option.
- All other crates are trio-licensed under the [Zlib], [Apache-2.0] or [MIT]
license, at your option.

Furthermore, the crates are (usually automatically) derived from Apple SDKs,
and that may have implications for licensing, see below for details.

[#23]: https://github.com/madsmtm/objc2/issues/23
[MIT]: https://opensource.org/license/MIT
[Zlib]: https://zlib.net/zlib_license.html
[Apache-2.0]: https://www.apache.org/licenses/LICENSE-2.0


## Apple SDKs

These crates are derived from Apple SDKs shipped with Xcode. You can obtain a
copy of the Xcode license at:

https://www.apple.com/legal/sla/docs/xcode.pdf

Or by typing `xcodebuild -license` in your terminal.

From reading the license, it is unclear whether distributing derived works
such as these crates are allowed?

But in any case, to practically use these crates, you will have to link, and
that only works when you have the correct Xcode SDK available to provide the
required `.tbd` files, which is why we choose to still use the normal SPDX
identifiers in the crates (Xcode is required to use the crates, and when using
Xcode you have already agreed to the Xcode license).
21 changes: 0 additions & 21 deletions LICENSE.txt

This file was deleted.

9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,8 @@ changelog. And so on, with every following release.

## License

This project is licensed under the MIT license, see [`LICENSE.txt`].

Work is in progress to make it dual-licensed under the Apache License
(Version 2.0) as well, see [this][#23].

[`LICENSE.txt`]: https://github.com/madsmtm/objc2/blob/master/LICENSE.txt
[#23]: https://github.com/madsmtm/objc2/issues/23
The licensing of the project is a bit complicated, see
[`LICENSE.md`](./LICENSE.md) for details.


## Acknowledgements / Prior art
Expand Down
4 changes: 3 additions & 1 deletion crates/block2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ authors.workspace = true
edition.workspace = true
rust-version.workspace = true
repository.workspace = true
license = "MIT" # https://github.com/madsmtm/objc2/issues/23
# https://github.com/madsmtm/objc2/issues/23
# All future contributions are licensed under "Zlib OR Apache-2.0 OR MIT".
license = "MIT"

[lints]
workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/header-translator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition.workspace = true
publish = false
repository.workspace = true
license = "Zlib OR Apache-2.0 OR MIT"
license.workspace = true

[dependencies]
# https://github.com/KyleMayes/clang-rs/pull/58
Expand Down
4 changes: 3 additions & 1 deletion crates/objc2-encode/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ categories = [
"no-std",
"os::macos-apis",
]
license = "MIT" # https://github.com/madsmtm/objc2/issues/23
# https://github.com/madsmtm/objc2/issues/23
# All future contributions are licensed under "Zlib OR Apache-2.0 OR MIT".
license = "MIT"
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/objc2-exception-helper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ authors.workspace = true
edition.workspace = true
rust-version.workspace = true
repository.workspace = true
license = "Zlib OR Apache-2.0 OR MIT"
license.workspace = true

# Use the `links` key to ensure that only one of these symbols are compiled
#
Expand Down
2 changes: 1 addition & 1 deletion crates/objc2-proc-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ categories = [
edition.workspace = true
rust-version.workspace = true
repository.workspace = true
license = "Zlib OR Apache-2.0 OR MIT"
license.workspace = true

[lib]
proc-macro = true
Expand Down
4 changes: 3 additions & 1 deletion crates/objc2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ categories = [
"os::macos-apis",
# "no-std", # TODO
]
license = "MIT" # https://github.com/madsmtm/objc2/issues/23
# https://github.com/madsmtm/objc2/issues/23
# All future contributions are licensed under "Zlib OR Apache-2.0 OR MIT".
license = "MIT"
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/test-assembly/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition.workspace = true
publish = false
repository.workspace = true
license = "Zlib OR Apache-2.0 OR MIT"
license.workspace = true

build = "build.rs"

Expand Down
2 changes: 1 addition & 1 deletion crates/test-ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "test-ui"
version = "0.1.0"
edition.workspace = true
publish = false
license = "Zlib OR Apache-2.0 OR MIT"
license.workspace = true

[lints]
workspace = true
Expand Down
3 changes: 2 additions & 1 deletion framework-crates/objc2-foundation/Cargo.modified.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
license = "MIT" # https://github.com/madsmtm/objc2/issues/23
# https://github.com/madsmtm/objc2/issues/23
license = "MIT" # All future contributions are licensed under "Zlib OR Apache-2.0 OR MIT".

[dev-dependencies]
static_assertions = "1.1.0"
Expand Down
2 changes: 1 addition & 1 deletion framework-crates/objc2-foundation/Cargo.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions framework-crates/objc2-metal/Cargo.modified.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[package]
license = "MIT OR Apache-2.0" # Some code taken from `metal` crate

[[example]]
name = "triangle"
required-features = [
Expand Down
2 changes: 1 addition & 1 deletion framework-crates/objc2-metal/Cargo.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cfb1992

Please sign in to comment.