Skip to content

Commit 2eabb35

Browse files
authored
Merge pull request #277 from rhubert/licenses
Licenses
2 parents 0938c17 + 797d459 commit 2eabb35

100 files changed

Lines changed: 260 additions & 5 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

classes/autotools.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
inherit: [cpackage, libtool, make, install, "basement::update-config"]
1+
inherit: [cpackage, libtool, make, install, "basement::update-config", licenses]
22

33
buildVars: [AUTOTOOLS_AUTO_STATIC, AR, CC, CXX]
44
buildSetup: |

classes/basement/bits/python3-pkg.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
inherit: [python3]
1+
inherit: [python3, licenses]
22

33
buildSetup: |
44
# add current pip install directory to PYTHONPATH for instant

classes/cargo.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
inherit: [pkg-config, install]
1+
inherit: [pkg-config, install, licenses]
22

33
depends:
44
# we need a host rustc compiler + a cross std lib for the target arch

classes/cmake.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
inherit: [cpackage, ninja, install]
1+
inherit: [cpackage, ninja, install, licenses]
22

33
buildToolsWeak: [cmake]
44
buildVars: [AUTOCONF_HOST, AR, CC, CXX]

classes/licenses.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
buildScript: |
2+
ln -snf $1 .bob-license-src
3+
4+
packageVars: [PKG_LICENSE, PKG_LICENSE_PATH, BASEMENT_ADD_LICENSE]
5+
packageSetup: |
6+
__LICENSES_SRC=$1/.bob-license-src
7+
# check if the supplied ref is has a valid idString SPDX-Spec v2.3 Annex D.1
8+
licensesCheckValidRef () {
9+
if [[ $1 =~ ^[A-Za-z0-9.\-]+$ ]]; then
10+
return 0
11+
fi
12+
echo "Invalid License idRef: $1" >&2
13+
return 1
14+
}
15+
16+
licensesPackage () {
17+
if [ -z "${PKG_LICENSE:-}" ]; then
18+
echo "PKG_LICENSE is missing!" >&2
19+
return 1
20+
fi
21+
mkdir -p .bob
22+
echo "${PKG_LICENSE}" > .bob/license
23+
24+
declare -A LICENSE_REFS
25+
while IFS=: read -r id file ; do
26+
if [[ -n $id && -n $file ]] ; then
27+
licensesCheckValidRef "$id"
28+
LICENSE_REFS["$id"]="$file"
29+
fi
30+
done <<< "${PKG_LICENSE_PATH:-}"
31+
32+
local L="$PKG_LICENSE"
33+
while [[ $L =~ LicenseRef-([A-Za-z0-9.-]+)(.*) ]] ; do
34+
ID="${BASH_REMATCH[1]}"
35+
L="${BASH_REMATCH[2]}"
36+
if licensesCheckValidRef $ID && [ ${LICENSE_REFS[$ID]+set} ]; then
37+
mkdir -p .bob/licenses
38+
cp $__LICENSES_SRC/${LICENSE_REFS[$ID]} .bob/licenses/$ID
39+
fi
40+
done
41+
42+
return 0
43+
}
44+
45+
packageScript: |
46+
if [ ${BASEMENT_ADD_LICENSE:-true} == true ]; then
47+
licensesPackage
48+
fi

classes/meson.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
inherit: [cpackage, install, python3]
1+
inherit: [cpackage, install, python3, licenses]
22

33
buildToolsWeak: [meson, ninja]
44
buildVars: [CC, CXX, AR, STRIP, NM]

recipes/core/coreutils.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ inherit: [autotools, patch]
22

33
metaEnvironment:
44
PKG_VERSION: "9.5"
5+
PKG_LICENSE: "GFDL-1.3-or-later AND GPL-3.0-or-later"
56

67
depends:
78
- libs::gmp-dev

recipes/core/util-linux.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ inherit: [autotools]
33
metaEnvironment:
44
PKG_VERSION_MAJOR: "2.40"
55
PKG_VERSION: "2.40.2"
6+
PKG_LICENSE: "LicenseRef-util-linux"
7+
PKG_LICENSE_PATH:
8+
util-linux:README.licensing
69

710
depends:
811
- libs::ncurses-dev

recipes/devel/autoconf-2.69.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ inherit: [autotools-noarch, patch]
22

33
metaEnvironment:
44
PKG_VERSION: "2.69"
5+
PKG_LICENSE: "GPL-2.0 AND GPL-3.0 WITH Autoconf-exception-3.0"
56

67
checkoutSCM:
78
scm: url

recipes/devel/autoconf-archive.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ inherit: [autotools-noarch]
22

33
metaEnvironment:
44
PKG_VERSION: "2023.02.20"
5+
PKG_LICENSE: "GPL-3.0-or-later WITH Autoconf-exception-3.0"
56

67
checkoutSCM:
78
scm: url

0 commit comments

Comments
 (0)