summaryrefslogtreecommitdiffstats
path: root/recipes-networking/cni
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-networking/cni')
-rw-r--r--recipes-networking/cni/cni_git.bb19
-rw-r--r--recipes-networking/cni/files/modules.txt26
-rw-r--r--recipes-networking/cni/relocation.inc30
-rw-r--r--recipes-networking/cni/src_uri.inc65
4 files changed, 140 insertions, 0 deletions
diff --git a/recipes-networking/cni/cni_git.bb b/recipes-networking/cni/cni_git.bb
index 59b56f6e..fda7af60 100644
--- a/recipes-networking/cni/cni_git.bb
+++ b/recipes-networking/cni/cni_git.bb
@@ -17,7 +17,17 @@ SRC_URI = "\
17 git://github.com/containernetworking/cni.git;branch=main;name=cni;protocol=https \ 17 git://github.com/containernetworking/cni.git;branch=main;name=cni;protocol=https \
18 git://github.com/containernetworking/plugins.git;branch=main;destsuffix=${S}/src/github.com/containernetworking/plugins;name=plugins;protocol=https \ 18 git://github.com/containernetworking/plugins.git;branch=main;destsuffix=${S}/src/github.com/containernetworking/plugins;name=plugins;protocol=https \
19 git://github.com/flannel-io/cni-plugin;branch=main;name=flannel_plugin;protocol=https;destsuffix=${S}/src/github.com/containernetworking/plugins/plugins/meta/flannel \ 19 git://github.com/flannel-io/cni-plugin;branch=main;name=flannel_plugin;protocol=https;destsuffix=${S}/src/github.com/containernetworking/plugins/plugins/meta/flannel \
20 file://modules.txt \
20 " 21 "
22
23# generated via:
24# ./scripts/oe-go-mod-autogen.py --repo https://github.com/containernetworking/cni.git --rev <insert your rev here>
25include src_uri.inc
26
27DEPENDS = " \
28 rsync-native \
29 "
30
21LICENSE = "Apache-2.0" 31LICENSE = "Apache-2.0"
22LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc" 32LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc"
23 33
@@ -31,10 +41,19 @@ inherit goarch
31# https://github.com/llvm/llvm-project/issues/53999 41# https://github.com/llvm/llvm-project/issues/53999
32TOOLCHAIN = "gcc" 42TOOLCHAIN = "gcc"
33 43
44# sets the "sites" variable.
45include relocation.inc
46
34do_compile() { 47do_compile() {
35 mkdir -p ${S}/src/github.com/containernetworking 48 mkdir -p ${S}/src/github.com/containernetworking
36 ln -sfr ${S}/src/import ${S}/src/github.com/containernetworking/cni 49 ln -sfr ${S}/src/import ${S}/src/github.com/containernetworking/cni
37 50
51 # our copied .go files are to be used for the build
52 ln -sf vendor.copy vendor
53
54 # inform go that we know what we are doing
55 cp ${WORKDIR}/modules.txt vendor/
56
38 export GO111MODULE=off 57 export GO111MODULE=off
39 58
40 cd ${B}/src/github.com/containernetworking/cni/libcni 59 cd ${B}/src/github.com/containernetworking/cni/libcni
diff --git a/recipes-networking/cni/files/modules.txt b/recipes-networking/cni/files/modules.txt
new file mode 100644
index 00000000..38217c96
--- /dev/null
+++ b/recipes-networking/cni/files/modules.txt
@@ -0,0 +1,26 @@
1# github.com/Masterminds/semver/v3 v3.2.1
2## explicit
3# github.com/onsi/ginkgo/v2 v2.13.2
4## explicit
5# github.com/onsi/gomega v1.30.0
6## explicit
7# github.com/vishvananda/netns v0.0.4
8## explicit
9# github.com/go-logr/logr v1.3.0
10## explicit
11# github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572
12## explicit
13# github.com/google/go-cmp v0.6.0
14## explicit
15# github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38
16## explicit
17# golang.org/x/net v0.17.0
18## explicit
19# golang.org/x/sys v0.14.0
20## explicit
21# golang.org/x/text v0.13.0
22## explicit
23# golang.org/x/tools v0.14.0
24## explicit
25# gopkg.in/yaml.v3 v3.0.1
26## explicit
diff --git a/recipes-networking/cni/relocation.inc b/recipes-networking/cni/relocation.inc
new file mode 100644
index 00000000..456e2c8a
--- /dev/null
+++ b/recipes-networking/cni/relocation.inc
@@ -0,0 +1,30 @@
1export sites="golang.org/x/net:golang.org/x/net:force \
2 golang.org/x/sys:golang.org/x/sys:force \
3 gopkg.in/yaml.v3:gopkg.in/yaml.v3:force \
4 golang.org/x/text:golang.org/x/text:force \
5 golang.org/x/tools:golang.org/x/tools:force \
6 github.com/onsi/gomega:github.com/onsi/gomega:force \
7 github.com/go-logr/logr:github.com/go-logr/logr:force \
8 github.com/google/pprof:github.com/google/pprof:force \
9 github.com/google/go-cmp:github.com/google/go-cmp:force \
10 github.com/onsi/ginkgo/v2:github.com/onsi/ginkgo/v2:force \
11 github.com/vishvananda/netns:github.com/vishvananda/netns:force \
12 github.com/go-task/slim-sprig:github.com/go-task/slim-sprig:force \
13 github.com/Masterminds/semver/v3:github.com/Masterminds/semver/v3:force"
14
15do_compile:prepend() {
16 cd ${S}/src/import
17 for s in $sites; do
18 site_dest=$(echo $s | cut -d: -f1)
19 site_source=$(echo $s | cut -d: -f2)
20 force_flag=$(echo $s | cut -d: -f3)
21 mkdir -p vendor.copy/$site_dest
22 if [ -n "$force_flag" ]; then
23 echo "[INFO] $site_dest: force copying .go files"
24 rm -rf vendor.copy/$site_dest
25 rsync -a --exclude='vendor/' --exclude='.git/' vendor.fetch/$site_source/ vendor.copy/$site_dest
26 else
27 [ -n "$(ls -A vendor.copy/$site_dest/*.go 2> /dev/null)" ] && { echo "[INFO] vendor.fetch/$site_source -> $site_dest: go copy skipped (files present)" ; true ; } || { echo "[INFO] $site_dest: copying .go files" ; rsync -a --exclude='vendor/' --exclude='.git/' vendor.fetch/$site_source/ vendor.copy/$site_dest ; }
28 fi
29 done
30}
diff --git a/recipes-networking/cni/src_uri.inc b/recipes-networking/cni/src_uri.inc
new file mode 100644
index 00000000..6cda91ab
--- /dev/null
+++ b/recipes-networking/cni/src_uri.inc
@@ -0,0 +1,65 @@
1# golang.org/x/net v0.17.0
2# [1] git ls-remote https://go.googlesource.com/net b225e7ca6dde1ef5a5ae5ce922861bda011cfabd
3SRCREV_net="b225e7ca6dde1ef5a5ae5ce922861bda011cfabd"
4SRC_URI += "git://go.googlesource.com/net;name=net;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/golang.org/x/net"
5
6# golang.org/x/sys v0.14.0
7# [1] git ls-remote https://go.googlesource.com/sys cb378ae1ff8cd45e69d4f172df8370bc844e1f86
8SRCREV_sys="cb378ae1ff8cd45e69d4f172df8370bc844e1f86"
9SRC_URI += "git://go.googlesource.com/sys;name=sys;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/golang.org/x/sys"
10
11# gopkg.in/yaml.v3 v3.0.1
12# [1] git ls-remote https://github.com/go-yaml/yaml f6f7691b1fdeb513f56608cd2c32c51f8194bf51
13SRCREV_yaml.v3="f6f7691b1fdeb513f56608cd2c32c51f8194bf51"
14SRC_URI += "git://github.com/go-yaml/yaml;name=yaml.v3;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/gopkg.in/yaml.v3"
15
16# golang.org/x/text v0.13.0
17# [1] git ls-remote https://go.googlesource.com/text f488e191e67ed95a5b9b7b39024e5a5f5f1ffd02
18SRCREV_text="f488e191e67ed95a5b9b7b39024e5a5f5f1ffd02"
19SRC_URI += "git://go.googlesource.com/text;name=text;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/golang.org/x/text"
20
21# golang.org/x/tools v0.14.0
22# [1] git ls-remote https://go.googlesource.com/tools 3f4194ee29d7db9b59757dfff729ef55cf89661c
23SRCREV_tools="3f4194ee29d7db9b59757dfff729ef55cf89661c"
24SRC_URI += "git://go.googlesource.com/tools;name=tools;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/golang.org/x/tools"
25
26# github.com/onsi/gomega v1.30.0
27# [1] git ls-remote https://github.com/onsi/gomega f804ac6ada8d36164ecae0513295de8affce1245
28SRCREV_gomega="f804ac6ada8d36164ecae0513295de8affce1245"
29SRC_URI += "git://github.com/onsi/gomega;name=gomega;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/github.com/onsi/gomega"
30
31# github.com/go-logr/logr v1.3.0
32# [1] git ls-remote https://github.com/go-logr/logr 8adefbede0fe82bdee4fb8c9c9bdc7bc5d91388f
33SRCREV_logr="8adefbede0fe82bdee4fb8c9c9bdc7bc5d91388f"
34SRC_URI += "git://github.com/go-logr/logr;name=logr;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/github.com/go-logr/logr"
35
36# github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38
37# [1] git ls-remote https://github.com/google/pprof 94a9f03dee38882adc8bdfc42cdd6a04f8e7056e
38SRCREV_pprof="94a9f03dee38882adc8bdfc42cdd6a04f8e7056e"
39SRC_URI += "git://github.com/google/pprof;name=pprof;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/github.com/google/pprof"
40
41# github.com/google/go-cmp v0.6.0
42# [1] git ls-remote https://github.com/google/go-cmp c3ad8435e7bef96af35732bc0789e5a2278c6d5f
43SRCREV_go-cmp="c3ad8435e7bef96af35732bc0789e5a2278c6d5f"
44SRC_URI += "git://github.com/google/go-cmp;name=go-cmp;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/github.com/google/go-cmp"
45
46# github.com/onsi/ginkgo/v2 v2.13.2
47# [1] git ls-remote https://github.com/onsi/ginkgo 931dc0b144749710bd085d4eb7cd4192a22972d7
48SRCREV_v2="931dc0b144749710bd085d4eb7cd4192a22972d7"
49SRC_URI += "git://github.com/onsi/ginkgo;name=v2;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/github.com/onsi/ginkgo/v2"
50
51# github.com/vishvananda/netns v0.0.4
52# [1] git ls-remote https://github.com/vishvananda/netns 7a452d2d15292b2bfb2a2d88e6bdeac156a761b9
53SRCREV_netns="7a452d2d15292b2bfb2a2d88e6bdeac156a761b9"
54SRC_URI += "git://github.com/vishvananda/netns;name=netns;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/github.com/vishvananda/netns"
55
56# github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572
57# [1] git ls-remote https://github.com/go-task/slim-sprig 52ccab3ef572c7e1a2c258be183f9a9296d60152
58SRCREV_slim-sprig="52ccab3ef572c7e1a2c258be183f9a9296d60152"
59SRC_URI += "git://github.com/go-task/slim-sprig;name=slim-sprig;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/github.com/go-task/slim-sprig"
60
61# github.com/Masterminds/semver/v3 v3.2.1
62# [1] git ls-remote https://github.com/Masterminds/semver e06051f8fcc4c8b4a4990c337b9862a2448722e5
63SRCREV_v3="e06051f8fcc4c8b4a4990c337b9862a2448722e5"
64SRC_URI += "git://github.com/Masterminds/semver;name=v3;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/github.com/Masterminds/semver/v3"
65