From efca5c456d594f720bb8a97630a8adaefe939592 Mon Sep 17 00:00:00 2001 From: termux-pacman-bot Date: Fri, 31 Mar 2023 09:01:23 +0000 Subject: [PATCH] Update repo --- disabled-packages/terraform/build.sh | 48 ++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 disabled-packages/terraform/build.sh diff --git a/disabled-packages/terraform/build.sh b/disabled-packages/terraform/build.sh new file mode 100644 index 0000000000..0ec9aaf7e0 --- /dev/null +++ b/disabled-packages/terraform/build.sh @@ -0,0 +1,48 @@ +TERMUX_PKG_HOMEPAGE=https://www.terraform.io +TERMUX_PKG_DESCRIPTION="A tool for building, changing, and versioning infrastructure safely and efficiently" +TERMUX_PKG_LICENSE="MPL-2.0" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION="1.4.4" +TERMUX_PKG_SRCURL=https://github.com/hashicorp/terraform/archive/v${TERMUX_PKG_VERSION}.tar.gz +TERMUX_PKG_SHA256=ab9e6d743c0a00be8c6c1a2723f39191e3cbd14517acbc3e6ff2baa753865074 +TERMUX_PKG_AUTO_UPDATE=true +TERMUX_PKG_ENABLE_CLANG16_PORTING=false +TERMUX_PKG_DEPENDS="git" + +termux_step_make() { + termux_setup_golang + + export GOPATH="${TERMUX_PKG_BUILDDIR}" + + mkdir -p "${GOPATH}"/src/github.com/hashicorp + cp -a "${TERMUX_PKG_SRCDIR}" "${GOPATH}"/src/github.com/hashicorp/terraform + + cd "${GOPATH}"/src/github.com/hashicorp/terraform || exit 1 + + go mod init || : + go mod tidy + + # Backport of https://github.com/lib/pq/commit/6a102c04ac8dc082f1684b0488275575c374cb4c + termux_download "https://github.com/lib/pq/commit/6a102c04ac8dc082f1684b0488275575c374cb4c.patch" \ + "${TERMUX_PKG_TMPDIR}"/patch1 \ + 2812df1db9e42473c30cdbc1f42ae4555027a1e56321189be9f50f52125c146c + + for f in "${GOPATH}"/pkg/mod/github.com/lib/pq@*/user_posix.go; do + chmod 0755 "$(dirname "$f")" + chmod 0644 "${f}" + patch --silent -p1 -d "$(dirname "$f")" <"${TERMUX_PKG_TMPDIR}"/patch1 + # The patch above does not fix build issue for some reason. + # Alternative workaround: + rm -f "${f}" + echo "package pq" > "${f}" + done + + local GO_LDFLAGS="-X 'github.com/hashicorp/terraform/version.Prerelease='" + GO_LDFLAGS="${GO_LDFLAGS} -X 'github.com/hashicorp/terraform/version.Version=${TERMUX_PKG_VERSION}'" + + go build -ldflags "${GO_LDFLAGS}" -o terraform . +} + +termux_step_make_install() { + install -Dm700 -t "${TERMUX_PREFIX}"/bin "${GOPATH}"/src/github.com/hashicorp/terraform/terraform +}