mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-30 23:47:48 +00:00
Use cargo-about to generate the attributions from Qt crates
This commit is contained in:
parent
422b90d612
commit
24cccfb9bb
2 changed files with 93 additions and 18 deletions
|
|
@ -27,6 +27,9 @@ jobs:
|
||||||
with:
|
with:
|
||||||
version: 5.15.2
|
version: 5.15.2
|
||||||
- uses: Swatinem/rust-cache@v1
|
- uses: Swatinem/rust-cache@v1
|
||||||
|
- uses: actions-rs/install@v0.1
|
||||||
|
with:
|
||||||
|
crate: cargo-about
|
||||||
- name: Build
|
- name: Build
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
|
|
@ -75,6 +78,9 @@ jobs:
|
||||||
version: 5.15.2
|
version: 5.15.2
|
||||||
cached: ${{ steps.cache-qt.outputs.cache-hit }}
|
cached: ${{ steps.cache-qt.outputs.cache-hit }}
|
||||||
- uses: Swatinem/rust-cache@v1
|
- uses: Swatinem/rust-cache@v1
|
||||||
|
- uses: actions-rs/install@v0.1
|
||||||
|
with:
|
||||||
|
crate: cargo-about
|
||||||
- name: Build
|
- name: Build
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
|
|
@ -125,6 +131,9 @@ jobs:
|
||||||
version: 6.2.0 # for Apple Silicon support
|
version: 6.2.0 # for Apple Silicon support
|
||||||
cached: ${{ steps.cache-qt.outputs.cache-hit }}
|
cached: ${{ steps.cache-qt.outputs.cache-hit }}
|
||||||
- uses: Swatinem/rust-cache@v1
|
- uses: Swatinem/rust-cache@v1
|
||||||
|
- uses: actions-rs/install@v0.1
|
||||||
|
with:
|
||||||
|
crate: cargo-about
|
||||||
- name: Build x86_64
|
- name: Build x86_64
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ if [ $# != 3 ]; then
|
||||||
echo "by adding the legal copyright and license notices."
|
echo "by adding the legal copyright and license notices."
|
||||||
echo
|
echo
|
||||||
echo "All files will be copied/created under the 3rdparty-licenses folder"
|
echo "All files will be copied/created under the 3rdparty-licenses folder"
|
||||||
echo "along with an index.md"
|
echo "along with an index.html"
|
||||||
echo
|
echo
|
||||||
echo "(The path to Qt could be for example ~/Qt/ where the qt installer placed"
|
echo "(The path to Qt could be for example ~/Qt/ where the qt installer placed"
|
||||||
echo " the binaries and sources under)"
|
echo " the binaries and sources under)"
|
||||||
|
|
@ -30,14 +30,60 @@ qt_version=$3
|
||||||
mkdir -p $target_path
|
mkdir -p $target_path
|
||||||
cp -a `dirname $0`/../LICENSE.md $target_path
|
cp -a `dirname $0`/../LICENSE.md $target_path
|
||||||
|
|
||||||
cat >$target_path/index.md <<EOT
|
cat > about.hbs <<EOT
|
||||||
This program is distributed under the terms outlined in [LICENSE.md](LICENSE.md).
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<style>
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
body { background: #333; color: white; }
|
||||||
|
a { color: skyblue; }
|
||||||
|
}
|
||||||
|
.container { font-family: sans-serif; max-width: 800px; margin: 0 auto; }
|
||||||
|
.intro { text-align: center; }
|
||||||
|
.licenses-list { list-style-type: none; margin: 0; padding: 0; }
|
||||||
|
.license-used-by { margin-top: -10px; }
|
||||||
|
.license-text { max-height: 200px; overflow-y: scroll; white-space: pre-wrap; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<main class="container">
|
||||||
|
<div class="intro">
|
||||||
|
<p>This program is distributed under the terms outlined in <a href="LICENSE.md">LICENSE.md</a></p>.
|
||||||
|
<h1>Third Party Licenses</h1>
|
||||||
|
<p>This page lists the licenses of the dependencies used by this program.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
This program also uses the Qt library, which is licensed under the
|
<h2>Overview of licenses:</h2>
|
||||||
LGPL v3: [qt/LICENSE.LGPLv3](qt/LICENSE.LGPLv3).
|
<ul class="licenses-overview">
|
||||||
|
{{#each overview}}
|
||||||
|
<li><a href="#{{id}}">{{name}}</a> ({{count}})</li>
|
||||||
|
{{/each}}
|
||||||
|
</ul>
|
||||||
|
|
||||||
Qt may include additional third-party components:
|
<h2>All license text:</h2>
|
||||||
|
<ul class="licenses-list">
|
||||||
|
{{#each licenses}}
|
||||||
|
<li class="license">
|
||||||
|
<h3 id="{{id}}">{{name}}</h3>
|
||||||
|
<h4>Used by:</h4>
|
||||||
|
<ul class="license-used-by">
|
||||||
|
{{#each used_by}}
|
||||||
|
<li><a
|
||||||
|
href="{{#if crate.repository}} {{crate.repository}} {{else}} https://crates.io/crates/{{crate.name}} {{/if}}">{{crate.name}}
|
||||||
|
{{crate.version}}</a></li>
|
||||||
|
{{/each}}
|
||||||
|
</ul>
|
||||||
|
<pre class="license-text">{{text}}</pre>
|
||||||
|
</li>
|
||||||
|
{{/each}}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h2>Qt License attribution</h2>
|
||||||
|
<p>This program also uses the Qt library, which is licensed under the
|
||||||
|
<a href="qt/LICENSE.LGPLv3">LGPL v3</a></p>.
|
||||||
|
<p>Qt may include additional third-party components:</p>
|
||||||
|
<ul>
|
||||||
EOT
|
EOT
|
||||||
|
|
||||||
mkdir -p $target_path/qt
|
mkdir -p $target_path/qt
|
||||||
|
|
@ -50,19 +96,39 @@ attribution_files=(
|
||||||
|
|
||||||
cp $qt_path/$qt_version/Src/LICENSE.LGPLv3 $target_path/qt
|
cp $qt_path/$qt_version/Src/LICENSE.LGPLv3 $target_path/qt
|
||||||
|
|
||||||
cat >$target_path/qt/index.html <<EOT
|
|
||||||
<html><head><title>Qt Licenses Attributions</title></head>
|
|
||||||
<body><h1>Qt Licenses Attributions</h1>
|
|
||||||
<p><a href="LICENSE.LGPLv3">LICENSE.LGPLv3<+a></p>
|
|
||||||
<ul>
|
|
||||||
|
|
||||||
EOT
|
|
||||||
|
|
||||||
for file in ${attribution_files[@]}; do
|
for file in ${attribution_files[@]}; do
|
||||||
cp $file $target_path/qt/
|
cp $file $target_path/qt/
|
||||||
title=`sed -n -e "s,<title>\(.*\)</title>,\1,p" < $file`
|
title=`sed -n -e "s,<title>\(.*\)</title>,\1,p" < $file`
|
||||||
link=`basename $file`
|
link=`basename $file`
|
||||||
echo "<li><a href=\"$link\">$title</a></li>" >> $target_path/qt/index.html
|
echo "<li><a href=\"qt/$link\">$title</a></li>" >> about.hbs
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "</ul></body></html>" > $target_path/qt/index.html
|
|
||||||
|
|
||||||
|
echo "</ul><main></body></html>" >> about.hbs
|
||||||
|
|
||||||
|
|
||||||
|
cat > about.toml << EOT
|
||||||
|
accepted = [
|
||||||
|
"MIT",
|
||||||
|
"Apache-2.0",
|
||||||
|
"MPL-2.0",
|
||||||
|
"Zlib",
|
||||||
|
"BSD-2-Clause",
|
||||||
|
"BSD-3-Clause",
|
||||||
|
"CC0-1.0",
|
||||||
|
"BSL-1.0",
|
||||||
|
"ISC",
|
||||||
|
"GPL-3.0", # That's only for SixtyFPS
|
||||||
|
]
|
||||||
|
targets = [
|
||||||
|
"x86_64-unknown-linux-gnu",
|
||||||
|
"x86_64-pc-windows-msvc",
|
||||||
|
"x86_64-apple-darwin",
|
||||||
|
]
|
||||||
|
ignore-build-dependencies = true
|
||||||
|
ignore-dev-dependencies = true
|
||||||
|
EOT
|
||||||
|
|
||||||
|
cargo about about.hbs -o $target_path/index.html
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue