diff options
Diffstat (limited to 'recipes-containers/docker-compose/docker-compose_git.bb')
-rw-r--r-- | recipes-containers/docker-compose/docker-compose_git.bb | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/recipes-containers/docker-compose/docker-compose_git.bb b/recipes-containers/docker-compose/docker-compose_git.bb new file mode 100644 index 00000000..abc5b0ea --- /dev/null +++ b/recipes-containers/docker-compose/docker-compose_git.bb | |||
@@ -0,0 +1,81 @@ | |||
1 | HOMEPAGE = "https://github.com/docker/compose" | ||
2 | SUMMARY = "Multi-container orchestration for Docker" | ||
3 | DESCRIPTION = "Docker compose v2" | ||
4 | |||
5 | DEPENDS = " \ | ||
6 | go-md2man \ | ||
7 | rsync-native \ | ||
8 | " | ||
9 | |||
10 | # Specify the first two important SRCREVs as the format | ||
11 | SRCREV_FORMAT="compose_survey" | ||
12 | SRCREV_compose = "b15df818c759b355b03ed70505ffa451301eb566" | ||
13 | |||
14 | SRC_URI = "git://github.com/docker/compose;name=compose;branch=v2;protocol=https" | ||
15 | |||
16 | include src_uri.inc | ||
17 | |||
18 | # patches and config | ||
19 | SRC_URI += "file://modules.txt" | ||
20 | |||
21 | SRC_URI[sha256sum] = "d7b05a9bff34dfb25abe7e5b1e54cf2607f953d91cb33fb231a4775a1a4afa3d" | ||
22 | |||
23 | LICENSE = "Apache-2.0" | ||
24 | LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=175792518e4ac015ab6696d16c4f607e" | ||
25 | |||
26 | GO_IMPORT = "import" | ||
27 | |||
28 | PV = "v2.11.2" | ||
29 | |||
30 | COMPOSE_PKG = "github.com/docker/compose/v2" | ||
31 | |||
32 | inherit go goarch | ||
33 | inherit pkgconfig | ||
34 | |||
35 | do_configure[noexec] = "1" | ||
36 | |||
37 | PACKAGECONFIG ?= "" | ||
38 | |||
39 | include relocation.inc | ||
40 | |||
41 | do_compile() { | ||
42 | cd ${S}/src/import | ||
43 | |||
44 | export GOPATH="$GOPATH:${S}/src/import/.gopath" | ||
45 | |||
46 | # Pass the needed cflags/ldflags so that cgo | ||
47 | # can find the needed headers files and libraries | ||
48 | export GOARCH=${TARGET_GOARCH} | ||
49 | export CGO_ENABLED="1" | ||
50 | export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
51 | export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
52 | |||
53 | export GOFLAGS="-mod=vendor -trimpath" | ||
54 | |||
55 | # our copied .go files are to be used for the build | ||
56 | ln -sf vendor.copy vendor | ||
57 | # inform go that we know what we are doing | ||
58 | cp ${WORKDIR}/modules.txt vendor/ | ||
59 | |||
60 | GO_LDFLAGS="-s -w -X internal.Version=${PV} -X ${COMPOSE_PKG}/internal.Version=${PV}" | ||
61 | GO_BUILDTAGS="" | ||
62 | mkdir -p ./bin | ||
63 | ${GO} build $GOFLAGS -tags "$GO_BUILDTAGS" -ldflags "$GO_LDFLAGS" -o ./bin/docker-compose ./cmd | ||
64 | } | ||
65 | |||
66 | do_install() { | ||
67 | #install -d "${D}${BIN_PREFIX}/bin" | ||
68 | #install -m 755 "${S}/src/import/bin/docker-compose" "${D}${BIN_PREFIX}/bin" | ||
69 | |||
70 | # commonly installed to: /usr/lib/docker/cli-plugins/ | ||
71 | install -d "${D}${libdir}/docker/cli-plugins/" | ||
72 | install -m 755 "${S}/src/import/bin/docker-compose" "${D}${libdir}/docker/cli-plugins/" | ||
73 | |||
74 | } | ||
75 | |||
76 | RDEPENDS:${PN} += " docker" | ||
77 | |||
78 | FILES:${PN} += " ${libdir}/docker/cli-plugins/" | ||
79 | |||
80 | INHIBIT_PACKAGE_STRIP = "1" | ||
81 | INSANE_SKIP:${PN} += "ldflags already-stripped" | ||