aboutsummaryrefslogtreecommitdiff
path: root/net/concourse-fly
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <dumbbell@FreeBSD.org>2019-04-24 17:20:06 +0000
committerJean-Sébastien Pédron <dumbbell@FreeBSD.org>2019-04-24 17:20:06 +0000
commit4896ac2f7b28120c4fdde315d0754d275561088d (patch)
tree69693aa1d15902281444e0efb6601aae93d85baa /net/concourse-fly
parent6b695415241fa38c55aaa4e3954b23af58d619e2 (diff)
downloadports-4896ac2f7b28120c4fdde315d0754d275561088d.tar.gz
ports-4896ac2f7b28120c4fdde315d0754d275561088d.zip
Notes
Diffstat (limited to 'net/concourse-fly')
-rw-r--r--net/concourse-fly/Makefile39
-rw-r--r--net/concourse-fly/distinfo6
-rw-r--r--net/concourse-fly/files/patch-src_github.com_concourse_go-archive_tarfs_mknod.go8
-rw-r--r--net/concourse-fly/files/patch-src_github.com_concourse_go-archive_tarfs_mknod__freebsd.go31
4 files changed, 29 insertions, 55 deletions
diff --git a/net/concourse-fly/Makefile b/net/concourse-fly/Makefile
index 1f487aa6d5d8..4119e1a84784 100644
--- a/net/concourse-fly/Makefile
+++ b/net/concourse-fly/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$
PORTNAME= concourse
-PORTVERSION= 4.2.3
+PORTVERSION= 5.1.0
CATEGORIES= net sysutils
MASTER_SITES= LOCAL/dumbbell/concourse/
PKGNAMESUFFIX= -fly
@@ -11,8 +11,9 @@ COMMENT= CLI for Concourse
LICENSE= APACHE20
-GO_CMD= ${LOCALBASE}/bin/go
GO_PKGNAME= github.com/concourse/fly
+GO_BUILDFLAGS+= -mod=vendor \
+ -ldflags="-X github.com/concourse/fly/version.Version=${PORTVERSION}"
USES= go tar:xz
@@ -24,32 +25,39 @@ PLIST_FILES= bin/fly
# repository, which contains many Git submodules, including fly, and
# build from there. So basically:
#
-# git clone --recursive https://github.com/concourse/concourse.gi
-# cd concourse
-# export GOPATH=$PWD
-# cd src/github.com/concourse/fly
+# git clone --recursive https://github.com/concourse/concourse.git
+# cd concourse/fly
# go build
#
-# Therefore, the source archive contains the Concourse top-level
-# repository and all its submodules. It's created using the
-# create-src-archive below:
+# Unfortunately, this is difficult to integrate as is with the Ports framework:
+# * Some submodules are hosted on services other than GitHub
+# * Third-party Go dependencies are not Git submodules
+#
+# We created the `create-src-archive` to create a self-contained
+# source archive because the Concourse does not provide one. This
+# source archive contains the Git submodules and the third-party Go
+# dependencies, fetched using `go mod vendor`.
+#
+# It is created using the `create-src-archive` target below:
#
# make create-src-archive
#
# Because it doesn't match the project layout USES=go expects, we
# override the post-extract and do-build targets to adapt the commands.
#
+# In particular, we must pass `-mod=vendor` to go-install to be able to
+# use the third-party dependencies fetched with `go mod vendor`.
+
# `fly` version is set by default to "0.0.0-dev" in version/Version.go.
# Instead of patching the file, we use a linker flag to set the variable
# to the port's version.
post-extract:
- ${LN} -sf ${WRKSRC}/src ${GO_WRKDIR_SRC}
+ @:
do-build:
- (cd ${WRKDIR}; \
- ${SETENV} ${MAKE_ENV} ${GO_ENV} ${GO_CMD} \
- 'install' -v -ldflags="-X github.com/concourse/fly/version.Version=${PORTVERSION}" ${GO_TARGET})
+ (cd ${WRKSRC}/fly; \
+ ${SETENV} ${MAKE_ENV} ${GO_ENV} ${GO_CMD} 'install' ${GO_BUILDFLAGS})
.PHONY: create-src-archive
ARCHIVE_DIR= ${DISTDIR}/concourse-${PORTVERSION}
@@ -58,6 +66,11 @@ create-src-archive:
git clone --recursive -b v${PORTVERSION} \
https://github.com/concourse/concourse.git \
${ARCHIVE_DIR}
+ GOPATH=$$(mktemp concourse-gopath.XXXX) && \
+ (cd ${ARCHIVE_DIR} && \
+ ${GO_CMD} mod vendor) && \
+ ${FIND} "$$GOPATH" -exec ${CHMOD} u+w {} \; && \
+ ${RM} -rf "$$GOPATH"
${FIND} ${ARCHIVE_DIR} \( -name ".git*" -o -name "testdata" \) -depth -exec ${RM} -rf {} \;
${TAR} -cf - -C ${ARCHIVE_DIR:H} ${ARCHIVE_DIR:T} | ${XZ_CMD} > ${ARCHIVE_DIR}.tar.xz
${RM} -rf ${ARCHIVE_DIR}
diff --git a/net/concourse-fly/distinfo b/net/concourse-fly/distinfo
index 5709ee265cc0..ade87596401c 100644
--- a/net/concourse-fly/distinfo
+++ b/net/concourse-fly/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1551695393
-SHA256 (concourse-4.2.3.tar.xz) = 22ae461a4f1f526287611fb45e9f2e93c4437d4b8922195813ff0537082cada0
-SIZE (concourse-4.2.3.tar.xz) = 38355156
+TIMESTAMP = 1556121268
+SHA256 (concourse-5.1.0.tar.xz) = 2d796b621b8d7000a6e84c7c7dd441ee702e0730c09b390cf79319ec217dc885
+SIZE (concourse-5.1.0.tar.xz) = 6738124
diff --git a/net/concourse-fly/files/patch-src_github.com_concourse_go-archive_tarfs_mknod.go b/net/concourse-fly/files/patch-src_github.com_concourse_go-archive_tarfs_mknod.go
deleted file mode 100644
index 23cb03ccf828..000000000000
--- a/net/concourse-fly/files/patch-src_github.com_concourse_go-archive_tarfs_mknod.go
+++ /dev/null
@@ -1,8 +0,0 @@
---- src/github.com/concourse/go-archive/tarfs/mknod.go.orig 2019-03-04 10:29:20 UTC
-+++ src/github.com/concourse/go-archive/tarfs/mknod.go
-@@ -1,4 +1,4 @@
--// +build !windows
-+// +build !windows,!freebsd
-
- package tarfs
-
diff --git a/net/concourse-fly/files/patch-src_github.com_concourse_go-archive_tarfs_mknod__freebsd.go b/net/concourse-fly/files/patch-src_github.com_concourse_go-archive_tarfs_mknod__freebsd.go
deleted file mode 100644
index cf017c2a4ce3..000000000000
--- a/net/concourse-fly/files/patch-src_github.com_concourse_go-archive_tarfs_mknod__freebsd.go
+++ /dev/null
@@ -1,31 +0,0 @@
---- src/github.com/concourse/go-archive/tarfs/mknod_freebsd.go.orig 2019-03-13 13:08:01 UTC
-+++ src/github.com/concourse/go-archive/tarfs/mknod_freebsd.go
-@@ -0,0 +1,28 @@
-+// +build freebsd
-+
-+package tarfs
-+
-+import (
-+ "archive/tar"
-+ "syscall"
-+
-+ "golang.org/x/sys/unix"
-+)
-+
-+func mknodEntry(hdr *tar.Header, path string) error {
-+ mode := uint32(hdr.Mode & 07777)
-+ switch hdr.Typeflag {
-+ case tar.TypeBlock:
-+ mode |= unix.S_IFBLK
-+ case tar.TypeChar:
-+ mode |= unix.S_IFCHR
-+ case tar.TypeFifo:
-+ mode |= unix.S_IFIFO
-+ }
-+
-+ return syscall.Mknod(path, mode, uint64(mkdev(hdr.Devmajor, hdr.Devminor)))
-+}
-+
-+func mkdev(major, minor int64) uint32 {
-+ return uint32(((minor & 0xfff00) << 12) | ((major & 0xfff) << 8) | (minor & 0xff))
-+}