Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 17 additions & 43 deletions devel/kubetail/Portfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0
PortGroup github 1.0
PortGroup golang 1.0

github.setup kubetail-org kubetail 0.9.0 cli/v
github.tarball_from archive
go.setup github.com/kubetail-org/kubetail 0.10.1 cli/v
github.tarball_from releases
revision 0

master_sites-append https://github.com/${github.author}/${github.project}/releases/download/${github.tag_prefix}${github.version}/:vendor

distfiles-append vendor-bundle-${version}-go.tar.zst:vendor \
vendor-bundle-${version}-pnpm.tar.zst:vendor
distname kubetail-${version}-vendored

supported_archs arm64 x86_64

Expand All @@ -25,42 +22,19 @@ long_description Kubetail is a general-purpose logging tool for Kubernetes, o
merged into a single, chronological timeline, in a browser or a \
terminal.

checksums kubetail-${version}.tar.gz \
rmd160 5f33993dfab8648a826ceff25be8d6e8940f3dfa \
sha256 f71cf335f81e76f882efe11feed4ed8af691cc1d9fa8f6b5ee630ee22a99dabb \
size 618012 \
vendor-bundle-${version}-go.tar.zst \
rmd160 608c21e6ca3981b7c8a641c06bf4c1361f2345b9 \
sha256 01f4f1c95315a72508397c379c34e01cc1b6f25095431289ab95e2614cb65d6f \
size 13630282 \
vendor-bundle-${version}-pnpm.tar.zst \
rmd160 b92a85689dc351c41adb56adf2db16e594fbfcb7 \
sha256 30c7e8e9c9efba953a59efbdd5acc774aacf117d602bf2ab20fb4c0fa5dcd155 \
size 242703827

extract.only ${github.project}-${github.version}${extract.suffix}

post-extract {
system -W ${worksrcpath} "zstd -d ${distpath}/vendor-bundle-${version}-go.tar.zst --stdout | tar -xf -"
system -W ${worksrcpath} "mv vendor modules/"

system -W ${worksrcpath} "zstd -d ${distpath}/vendor-bundle-${version}-pnpm.tar.zst --stdout | tar -xf -"
system -W ${worksrcpath} "mv pnpm-store dashboard-ui/.pnpm-store"
}

use_configure no

pre-build {
system -W ${worksrcpath}/dashboard-ui "pnpm config set store-dir .pnpm-store"
}

build.cmd make
build.target build
build.env-append GOFLAGS="-mod=vendor"
build.args-append VERSION=${version}

depends_build-append port:go port:pnpm
depends_extract port:zstd
checksums ${distname}${extract.suffix} \
rmd160 5e02aff80aef29ef9b0f7adc7d877d8bc9451cf2 \
sha256 e6ea584bdd1fa20f35059bf97ffce8c42998e70d905b5660991090c2a52e9b8f \
size 21426066

build.env-append GO111MODULE=on \
GOWORK=off \
CGO_ENABLED=0
build.dir ${worksrcpath}/modules/cli
build.args-append \
-mod=vendor \
-ldflags \"-s -w -X github.com/kubetail-org/kubetail/modules/cli/cmd.version=${version}\" \
-o ../../bin/kubetail

destroot {
xinstall -m 0755 ${worksrcpath}/bin/kubetail ${destroot}${prefix}/bin/kubetail
Expand Down