From 3c186abdfcf302f265e30ffc4d56f8a06e3c407a Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Tue, 28 Apr 2020 19:31:33 +0100 Subject: [PATCH 1/4] go: update to go-1.14.2 (-modcacherw support) --- packages/addons/addon-depends/go/package.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/addons/addon-depends/go/package.mk b/packages/addons/addon-depends/go/package.mk index 180698f9a8b..51c24b6b65b 100644 --- a/packages/addons/addon-depends/go/package.mk +++ b/packages/addons/addon-depends/go/package.mk @@ -3,8 +3,8 @@ # Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv) PKG_NAME="go" -PKG_VERSION="1.12.9" -PKG_SHA256="c31433aa0bb01856c812d40a91336e25cbce2e50800eb9fe88a7adf0305f1a5b" +PKG_VERSION="1.14.2" +PKG_SHA256="97b24d8992a8623eaf717cfc18a190b33f789cadd8cafdfd3c1b3616fd511d16" PKG_LICENSE="BSD" PKG_SITE="https://golang.org" PKG_URL="https://github.com/golang/go/archive/${PKG_NAME}${PKG_VERSION}.tar.gz" From 4d15490c67cfb688203f57eac10916ac3117ffed Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Tue, 28 Apr 2020 10:26:52 +0100 Subject: [PATCH 2/4] config/functions: add go_configure() helpers --- config/functions | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/config/functions b/config/functions index b38ed56195c..0107e2cf29d 100644 --- a/config/functions +++ b/config/functions @@ -911,6 +911,47 @@ target_has_feature() { listcontains "$TARGET_FEATURES" "$1" } +# configure variables for go +go_configure() { + unset GOARCH GOARM + case ${TARGET_ARCH} in + x86_64) + export GOARCH=amd64 + ;; + arm) + export GOARCH=arm + + case ${TARGET_CPU} in + arm1176jzf-s) + export GOARM=6 + ;; + *) + export GOARM=7 + ;; + esac + ;; + aarch64) + export GOARCH=arm64 + ;; + esac + + export GOOS=linux + export GOROOT=${TOOLCHAIN}/lib/golang + export PATH=${PATH}:${GOROOT}/bin + + go_configure_path + + export CGO_ENABLED=1 + export CGO_NO_EMULATION=1 + export CGO_CFLAGS=$CFLAGS +} + +go_configure_path() { + export GOLANG=${TOOLCHAIN}/lib/golang/bin/go + export GOPATH=${PKG_BUILD}/.gopath + export GOFLAGS="-modcacherw" +} + # find path for matching file or directory, searching standard directory hierarchy, using optional default # if a path is located it will be set in FOUND_PATH and exit code will be 0. find_path() { From 97c5d8d057dcb97327a15be94c40fd8729e38e9d Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Tue, 28 Apr 2020 11:05:38 +0100 Subject: [PATCH 3/4] go-based packages: use go_configure(); GOPATH cleanup --- .../addon-depends/containerd/package.mk | 34 +----- .../addon-depends/libnetwork/package.mk | 34 +----- packages/addons/addon-depends/runc/package.mk | 35 +----- packages/addons/service/docker/package.mk | 109 +++++++----------- packages/addons/service/syncthing/package.mk | 28 +---- 5 files changed, 56 insertions(+), 184 deletions(-) diff --git a/packages/addons/addon-depends/containerd/package.mk b/packages/addons/addon-depends/containerd/package.mk index 77b0808f796..0ce61c7894c 100644 --- a/packages/addons/addon-depends/containerd/package.mk +++ b/packages/addons/addon-depends/containerd/package.mk @@ -16,46 +16,20 @@ PKG_TOOLCHAIN="manual" PKG_GIT_COMMIT="a4bc1d432a2c33aa2eed37f338dceabb93641310" pre_make_target() { - case ${TARGET_ARCH} in - x86_64) - export GOARCH=amd64 - ;; - arm) - export GOARCH=arm - case ${TARGET_CPU} in - arm1176jzf-s) - export GOARM=6 - ;; - *) - export GOARM=7 - ;; - esac - ;; - aarch64) - export GOARCH=arm64 - ;; - esac + go_configure - export GOOS=linux - export CGO_ENABLED=1 - export CGO_NO_EMULATION=1 - export CGO_CFLAGS=${CFLAGS} export CONTAINERD_VERSION=${PKG_VERSION} export CONTAINERD_REVISION=${PKG_GIT_COMMIT} export CONTAINERD_PKG=github.com/containerd/containerd export LDFLAGS="-w -extldflags -static -X ${CONTAINERD_PKG}/version.Version=${CONTAINERD_VERSION} -X ${CONTAINERD_PKG}/version.Revision=${CONTAINERD_REVISION} -X ${CONTAINERD_PKG}/version.Package=${CONTAINERD_PKG} -extld $CC" - export GOLANG=${TOOLCHAIN}/lib/golang/bin/go - export GOPATH=${PKG_BUILD}/.gopath - export GOROOT=${TOOLCHAIN}/lib/golang - export PATH=${PATH}:${GOROOT}/bin - mkdir -p ${PKG_BUILD}/.gopath + mkdir -p ${GOPATH} if [ -d ${PKG_BUILD}/vendor ]; then - mv ${PKG_BUILD}/vendor ${PKG_BUILD}/.gopath/src + mv ${PKG_BUILD}/vendor ${GOPATH}/src fi - ln -fs ${PKG_BUILD} ${PKG_BUILD}/.gopath/src/github.com/containerd/containerd + ln -fs ${PKG_BUILD} ${GOPATH}/src/github.com/containerd/containerd } make_target() { diff --git a/packages/addons/addon-depends/libnetwork/package.mk b/packages/addons/addon-depends/libnetwork/package.mk index 3404319168d..8157427e76d 100644 --- a/packages/addons/addon-depends/libnetwork/package.mk +++ b/packages/addons/addon-depends/libnetwork/package.mk @@ -13,43 +13,17 @@ PKG_LONGDESC="A native Go implementation for connecting containers." PKG_TOOLCHAIN="manual" pre_make_target() { - case $TARGET_ARCH in - x86_64) - export GOARCH=amd64 - ;; - arm) - export GOARCH=arm + go_configure - case $TARGET_CPU in - arm1176jzf-s) - export GOARM=6 - ;; - *) - export GOARM=7 - ;; - esac - ;; - aarch64) - export GOARCH=arm64 - ;; - esac - - export GOOS=linux export CGO_ENABLED=0 - export CGO_NO_EMULATION=1 - export CGO_CFLAGS=$CFLAGS export LDFLAGS="-extld $CC" - export GOLANG=$TOOLCHAIN/lib/golang/bin/go - export GOPATH=$PKG_BUILD/.gopath - export GOROOT=$TOOLCHAIN/lib/golang - export PATH=$PATH:$GOROOT/bin - mkdir -p $PKG_BUILD/.gopath + mkdir -p ${GOPATH} if [ -d $PKG_BUILD/vendor ]; then - mv $PKG_BUILD/vendor $PKG_BUILD/.gopath/src + mv $PKG_BUILD/vendor ${GOPATH}/src fi - ln -fs $PKG_BUILD $PKG_BUILD/.gopath/src/github.com/docker/libnetwork + ln -fs $PKG_BUILD ${GOPATH}/src/github.com/docker/libnetwork } make_target() { diff --git a/packages/addons/addon-depends/runc/package.mk b/packages/addons/addon-depends/runc/package.mk index 9f8f531d9df..6cfa2f0d89a 100644 --- a/packages/addons/addon-depends/runc/package.mk +++ b/packages/addons/addon-depends/runc/package.mk @@ -16,43 +16,16 @@ PKG_TOOLCHAIN="manual" PKG_GIT_COMMIT="425e105d5a03fabd737a126ad93d62a9eeede87f" pre_make_target() { - case $TARGET_ARCH in - x86_64) - export GOARCH=amd64 - ;; - arm) - export GOARCH=arm + go_configure - case $TARGET_CPU in - arm1176jzf-s) - export GOARM=6 - ;; - *) - export GOARM=7 - ;; - esac - ;; - aarch64) - export GOARCH=arm64 - ;; - esac - - export GOOS=linux - export CGO_ENABLED=1 - export CGO_NO_EMULATION=1 - export CGO_CFLAGS=$CFLAGS export LDFLAGS="-w -extldflags -static -X main.gitCommit=${PKG_GIT_COMMIT} -X main.version=$(cat ./VERSION) -extld $CC" - export GOLANG=$TOOLCHAIN/lib/golang/bin/go - export GOPATH=$PKG_BUILD/.gopath - export GOROOT=$TOOLCHAIN/lib/golang - export PATH=$PATH:$GOROOT/bin - mkdir -p $PKG_BUILD/.gopath + mkdir -p ${GOPATH} if [ -d $PKG_BUILD/vendor ]; then - mv $PKG_BUILD/vendor $PKG_BUILD/.gopath/src + mv $PKG_BUILD/vendor ${GOPATH}/src fi - ln -fs $PKG_BUILD $PKG_BUILD/.gopath/src/github.com/opencontainers/runc + ln -fs $PKG_BUILD ${GOPATH}/src/github.com/opencontainers/runc } make_target() { diff --git a/packages/addons/service/docker/package.mk b/packages/addons/service/docker/package.mk index d3c542da62f..7b024feb80b 100644 --- a/packages/addons/service/docker/package.mk +++ b/packages/addons/service/docker/package.mk @@ -23,86 +23,63 @@ PKG_IS_ADDON="yes" PKG_ADDON_NAME="Docker" PKG_ADDON_TYPE="xbmc.service" +PKG_DOCKER_BUILDTAGS="daemon \ + autogen \ + exclude_graphdriver_devicemapper \ + exclude_graphdriver_aufs \ + exclude_graphdriver_btrfs \ + journald" + configure_target() { - export DOCKER_BUILDTAGS="daemon \ - autogen \ - exclude_graphdriver_devicemapper \ - exclude_graphdriver_aufs \ - exclude_graphdriver_btrfs \ - journald" - - case ${TARGET_ARCH} in - x86_64) - export GOARCH=amd64 - ;; - arm) - export GOARCH=arm - - case ${TARGET_CPU} in - arm1176jzf-s) - export GOARM=6 - ;; - *) - export GOARM=7 - ;; - esac - ;; - aarch64) - export GOARCH=arm64 - ;; - esac - - export GOOS=linux - export CGO_ENABLED=1 - export CGO_NO_EMULATION=1 - export CGO_CFLAGS=${CFLAGS} + go_configure + + PKG_GOPATH_ENGINE=${GOPATH} + PKG_GOPATH_CLI=${GOPATH}_cli + export GOPATH=${PKG_GOPATH_CLI}:${PKG_GOPATH_ENGINE} + export LDFLAGS="-w -linkmode external -extldflags -Wl,--unresolved-symbols=ignore-in-shared-libs -extld $CC" - export GOLANG=${TOOLCHAIN}/lib/golang/bin/go - export GOPATH=${PKG_BUILD}/.gopath_cli:${PKG_BUILD}/.gopath - export GOROOT=${TOOLCHAIN}/lib/golang - export PATH=${PATH}:${GOROOT}/bin - mkdir -p ${PKG_BUILD}/.gopath - mkdir -p ${PKG_BUILD}/.gopath_cli + mkdir -p ${PKG_GOPATH_ENGINE} + mkdir -p ${PKG_GOPATH_CLI} PKG_ENGINE_PATH=${PKG_BUILD}/components/engine PKG_CLI_PATH=${PKG_BUILD}/components/cli if [ -d ${PKG_ENGINE_PATH}/vendor ]; then - mv ${PKG_ENGINE_PATH}/vendor ${PKG_BUILD}/.gopath/src + mv ${PKG_ENGINE_PATH}/vendor ${PKG_GOPATH_ENGINE}/src fi if [ -d ${PKG_CLI_PATH}/vendor ]; then - mv ${PKG_CLI_PATH}/vendor ${PKG_BUILD}/.gopath_cli/src + mv ${PKG_CLI_PATH}/vendor ${PKG_GOPATH_CLI}/src fi # Fix missing/incompatible .go files - cp -rf ${PKG_BUILD}/.gopath/src/github.com/moby/buildkit/frontend/* ${PKG_BUILD}/.gopath_cli/src/github.com/moby/buildkit/frontend - cp -rf ${PKG_BUILD}/.gopath/src/github.com/moby/buildkit/frontend/gateway/* ${PKG_BUILD}/.gopath_cli/src/github.com/moby/buildkit/frontend/gateway - cp -rf ${PKG_BUILD}/.gopath/src/github.com/moby/buildkit/solver/* ${PKG_BUILD}/.gopath_cli/src/github.com/moby/buildkit/solver - cp -rf ${PKG_BUILD}/.gopath/src/github.com/moby/buildkit/util/progress/* ${PKG_BUILD}/.gopath_cli/src/github.com/moby/buildkit/util/progress - cp -rf ${PKG_BUILD}/.gopath/src/github.com/docker/swarmkit/manager/* ${PKG_BUILD}/.gopath_cli/src/github.com/docker/swarmkit/manager - cp -rf ${PKG_BUILD}/.gopath/src/github.com/coreos/etcd/raft/* ${PKG_BUILD}/.gopath_cli/src/github.com/coreos/etcd/raft - cp -rf ${PKG_BUILD}/.gopath/src/golang.org/x/* ${PKG_BUILD}/.gopath_cli/src/golang.org/x - cp -rf ${PKG_BUILD}/.gopath/src/github.com/opencontainers/runtime-spec/specs-go/* ${PKG_BUILD}/.gopath_cli/src/github.com/opencontainers/runtime-spec/specs-go - - rm -rf ${PKG_BUILD}/.gopath_cli/src/github.com/containerd/containerd - mkdir -p ${PKG_BUILD}/.gopath_cli/src/github.com/containerd/containerd - cp -rf ${PKG_BUILD}/.gopath/src/github.com/containerd/containerd/* ${PKG_BUILD}/.gopath_cli/src/github.com/containerd/containerd - - rm -rf ${PKG_BUILD}/.gopath_cli/src/github.com/containerd/continuity - mkdir -p ${PKG_BUILD}/.gopath_cli/src/github.com/containerd/continuity - cp -rf ${PKG_BUILD}/.gopath/src/github.com/containerd/continuity/* ${PKG_BUILD}/.gopath_cli/src/github.com/containerd/continuity - - mkdir -p ${PKG_BUILD}/.gopath_cli/src/github.com/docker/docker/builder - cp -rf ${PKG_ENGINE_PATH}/builder/* ${PKG_BUILD}/.gopath_cli/src/github.com/docker/docker/builder - - if [ ! -L ${PKG_BUILD}/.gopath/src/github.com/docker/docker ];then - ln -fs ${PKG_ENGINE_PATH} ${PKG_BUILD}/.gopath/src/github.com/docker/docker + cp -rf ${PKG_GOPATH_ENGINE}/src/github.com/moby/buildkit/frontend/* ${PKG_GOPATH_CLI}/src/github.com/moby/buildkit/frontend + cp -rf ${PKG_GOPATH_ENGINE}/src/github.com/moby/buildkit/frontend/gateway/* ${PKG_GOPATH_CLI}/src/github.com/moby/buildkit/frontend/gateway + cp -rf ${PKG_GOPATH_ENGINE}/src/github.com/moby/buildkit/solver/* ${PKG_GOPATH_CLI}/src/github.com/moby/buildkit/solver + cp -rf ${PKG_GOPATH_ENGINE}/src/github.com/moby/buildkit/util/progress/* ${PKG_GOPATH_CLI}/src/github.com/moby/buildkit/util/progress + cp -rf ${PKG_GOPATH_ENGINE}/src/github.com/docker/swarmkit/manager/* ${PKG_GOPATH_CLI}/src/github.com/docker/swarmkit/manager + cp -rf ${PKG_GOPATH_ENGINE}/src/github.com/coreos/etcd/raft/* ${PKG_GOPATH_CLI}/src/github.com/coreos/etcd/raft + cp -rf ${PKG_GOPATH_ENGINE}/src/golang.org/x/* ${PKG_GOPATH_CLI}/src/golang.org/x + cp -rf ${PKG_GOPATH_ENGINE}/src/github.com/opencontainers/runtime-spec/specs-go/* ${PKG_GOPATH_CLI}/src/github.com/opencontainers/runtime-spec/specs-go + + rm -rf ${PKG_GOPATH_CLI}/src/github.com/containerd/containerd + mkdir -p ${PKG_GOPATH_CLI}/src/github.com/containerd/containerd + cp -rf ${PKG_GOPATH_ENGINE}/src/github.com/containerd/containerd/* ${PKG_GOPATH_CLI}/src/github.com/containerd/containerd + + rm -rf ${PKG_GOPATH_CLI}/src/github.com/containerd/continuity + mkdir -p ${PKG_GOPATH_CLI}/src/github.com/containerd/continuity + cp -rf ${PKG_GOPATH_ENGINE}/src/github.com/containerd/continuity/* ${PKG_GOPATH_CLI}/src/github.com/containerd/continuity + + mkdir -p ${PKG_GOPATH_CLI}/src/github.com/docker/docker/builder + cp -rf ${PKG_ENGINE_PATH}/builder/* ${PKG_GOPATH_CLI}/src/github.com/docker/docker/builder + + if [ ! -L ${PKG_GOPATH_ENGINE}/src/github.com/docker/docker ];then + ln -fs ${PKG_ENGINE_PATH} ${PKG_GOPATH_ENGINE}/src/github.com/docker/docker fi - if [ ! -L ${PKG_BUILD}/.gopath_cli/src/github.com/docker/cli ];then - ln -fs ${PKG_CLI_PATH} ${PKG_BUILD}/.gopath_cli/src/github.com/docker/cli + if [ ! -L ${PKG_GOPATH_CLI}/src/github.com/docker/cli ];then + ln -fs ${PKG_CLI_PATH} ${PKG_GOPATH_CLI}/src/github.com/docker/cli fi # used for docker version @@ -120,8 +97,8 @@ make_target() { PKG_CLI_FLAGS="-X 'github.com/docker/cli/cli/version.Version=${VERSION}'" PKG_CLI_FLAGS="${PKG_CLI_FLAGS} -X 'github.com/docker/cli/cli/version.GitCommit=${GITCOMMIT}'" PKG_CLI_FLAGS="${PKG_CLI_FLAGS} -X 'github.com/docker/cli/cli/version.BuildTime=${BUILDTIME}'" - ${GOLANG} build -v -o bin/docker -a -tags "${DOCKER_BUILDTAGS}" -ldflags "${LDFLAGS} ${PKG_CLI_FLAGS}" ./components/cli/cmd/docker - ${GOLANG} build -v -o bin/dockerd -a -tags "${DOCKER_BUILDTAGS}" -ldflags "${LDFLAGS}" ./components/engine/cmd/dockerd + ${GOLANG} build -v -o bin/docker -a -tags "${PKG_DOCKER_BUILDTAGS}" -ldflags "${LDFLAGS} ${PKG_CLI_FLAGS}" ./components/cli/cmd/docker + ${GOLANG} build -v -o bin/dockerd -a -tags "${PKG_DOCKER_BUILDTAGS}" -ldflags "${LDFLAGS}" ./components/engine/cmd/dockerd } makeinstall_target() { diff --git a/packages/addons/service/syncthing/package.mk b/packages/addons/service/syncthing/package.mk index fd01aa84d80..9f4f07dc452 100644 --- a/packages/addons/service/syncthing/package.mk +++ b/packages/addons/service/syncthing/package.mk @@ -21,35 +21,9 @@ PKG_ADDON_TYPE="xbmc.service" PKG_MAINTAINER="Anton Voyl (awiouy)" configure_target() { - export CGO_CFLAGS=${CFLAGS} - export CGO_ENABLED=1 - export CGO_NO_EMULATION=1 - export GOLANG=${TOOLCHAIN}/lib/golang/bin/go - export GOOS=linux - export GOROOT=${TOOLCHAIN}/lib/golang + go_configure export LDFLAGS="-w -linkmode external -extldflags -Wl,--unresolved-symbols=ignore-in-shared-libs -extld ${CC} \ -X github.com/syncthing/syncthing/lib/build.Version=v${PKG_VERSION}" - export PATH=${PATH}:${GOROOT}/bin - - case $TARGET_ARCH in - x86_64) - export GOARCH=amd64 - ;; - aarch64) - export GOARCH=arm64 - ;; - arm) - export GOARCH=arm - case $TARGET_CPU in - arm1176jzf-s) - export GOARM=6 - ;; - *) - export GOARM=7 - ;; - esac - ;; - esac } make_target() { From 0727ce1ffb248d33ff0d31ca5de53049235516c0 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Wed, 6 May 2020 17:05:03 +0200 Subject: [PATCH 4/4] syncthing: update to 1.5.0 Signed-off-by: Matthias Reichl --- packages/addons/service/syncthing/changelog.txt | 3 +++ packages/addons/service/syncthing/package.mk | 13 +++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/addons/service/syncthing/changelog.txt b/packages/addons/service/syncthing/changelog.txt index 380955e10c1..35ba0202a56 100644 --- a/packages/addons/service/syncthing/changelog.txt +++ b/packages/addons/service/syncthing/changelog.txt @@ -1,3 +1,6 @@ +110 +- Update to 1.5.0 + 109 - Update to 1.4.2 diff --git a/packages/addons/service/syncthing/package.mk b/packages/addons/service/syncthing/package.mk index 9f4f07dc452..8bb4ce47602 100644 --- a/packages/addons/service/syncthing/package.mk +++ b/packages/addons/service/syncthing/package.mk @@ -2,9 +2,9 @@ # Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv) PKG_NAME="syncthing" -PKG_VERSION="1.4.2" -PKG_SHA256="061af43c1bbfcdf949499cdc50a325fff7cd67fb48f9d270adb52b4decbab899" -PKG_REV="109" +PKG_VERSION="1.5.0" +PKG_SHA256="4b4e3c9bbe9dd796919d300118b6817edfe3db9513b067a58591524b3c5a248d" +PKG_REV="110" PKG_ARCH="any" PKG_LICENSE="MPLv2" PKG_SITE="https://syncthing.net/" @@ -12,7 +12,7 @@ PKG_URL="https://github.com/syncthing/syncthing/releases/download/v${PKG_VERSION PKG_DEPENDS_TARGET="toolchain go:host" PKG_SECTION="service/system" PKG_SHORTDESC="Syncthing: open source continuous file synchronization" -PKG_LONGDESC="Syncthing ($PKG_VERSION) replaces proprietary sync and cloud services with something open, trustworthy and decentralized. Your data is your data alone and you deserve to choose where it is stored, if it is shared with some third party and how it's transmitted over the Internet." +PKG_LONGDESC="Syncthing (${PKG_VERSION}) replaces proprietary sync and cloud services with something open, trustworthy and decentralized. Your data is your data alone and you deserve to choose where it is stored, if it is shared with some third party and how it's transmitted over the Internet." PKG_TOOLCHAIN="manual" PKG_IS_ADDON="yes" @@ -27,10 +27,11 @@ configure_target() { } make_target() { - ${GOLANG} build -v -o bin/syncthing -a -ldflags "${LDFLAGS}" ./cmd/syncthing + ${GOLANG} build -a -ldflags "${LDFLAGS}" -o bin/syncthing -v ./cmd/syncthing } addon() { mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/bin - cp -P ${PKG_BUILD}/bin/syncthing ${ADDON_BUILD}/${PKG_ADDON_ID}/bin + cp -P ${PKG_BUILD}/bin/syncthing \ + ${ADDON_BUILD}/${PKG_ADDON_ID}/bin }