blob: e88ea632f6d200235633bb9454eab3230a010c66 [file] [log] [blame]
Patrick Williams7784c422022-11-17 07:29:11 -06001HOMEPAGE = "https://github.com/minio/mc"
2SUMMARY = "MinIO Client is a replacement for ls, cp, mkdir, diff and rsync commands for filesystems and object storage."
3DESCRIPTION = "MinIO Client (mc) provides a modern alternative to \
4 UNIX commands like ls, cat, cp, mirror, diff, find \
5 etc. It supports filesystems and Amazon S3 compatible \
6 cloud storage service (AWS Signature v2 and v4). \
7"
8
9SRC_URI = "git://github.com/minio/mc;nobranch=1;name=mc;protocol=https \
10 file://modules.txt \
11 "
12
13include src_uri.inc
14
15SRCREV_mc = "01b87ecc02ffad47dfe13c2154ac31db3e3115df"
16
17GO_IMPORT = "import"
18
19LICENSE = "GPL-3.0-only"
20LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=eb1e647870add0502f8f010b19de32af"
21
22PV = "${SRCREV_mc}"
23
24inherit go
25inherit goarch
26
27CGO_LDFLAGS:append:mips = " -no-pie"
28
29DEPENDS += "rsync-native"
30
31do_compile() {
32
33 cd ${S}/src/${GO_IMPORT}
34
35 export GOFLAGS="-mod=vendor"
36 export GOPATH="$GOPATH:${S}/src/import/.gopath:${S}/src/import/vendor"
37 sites="github.com/charmbracelet/bubbletea:github.com/charmbracelet/bubbletea \
38 github.com/cheggaaa/pb:github.com/cheggaaa/pb \
39 github.com/dustin/go-humanize:github.com/dustin/go-humanize \
40 github.com/fatih/color:github.com/fatih/color \
41 github.com/go-ole/go-ole:github.com/go-ole/go-ole \
42 github.com/goccy/go-json:github.com/goccy/go-json \
43 github.com/google/shlex:github.com/google/shlex \
44 github.com/google/uuid:github.com/google/uuid \
45 github.com/inconshreveable/mousetrap:github.com/inconshreveable/mousetrap \
46 github.com/json-iterator/go:github.com/json-iterator/go \
47 github.com/klauspost/compress:github.com/klauspost/compress \
48 github.com/mattn/go-ieproxy:github.com/mattn/go-ieproxy \
49 github.com/mattn/go-isatty:github.com/mattn/go-isatty \
50 github.com/minio/cli:github.com/minio/cli \
51 github.com/minio/colorjson:github.com/minio/colorjson \
52 github.com/minio/filepath:github.com/minio/filepath \
53 github.com/minio/madmin-go:github.com/minio/madmin-go \
54 github.com/minio/md5-simd:github.com/minio/md5-simd \
55 github.com/minio/minio-go/v7:github.com/minio/minio-go/v7 \
56 github.com/minio/pkg:github.com/minio/pkg \
57 github.com/minio/selfupdate:github.com/minio/selfupdate \
58 github.com/minio/sha256-simd:github.com/minio/sha256-simd \
59 github.com/mitchellh/go-homedir:github.com/mitchellh/go-homedir \
60 github.com/pkg/xattr:github.com/pkg/xattr \
61 github.com/posener/complete:github.com/posener/complete \
62 github.com/prometheus/client_golang:github.com/prometheus/client_golang \
63 github.com/prometheus/prom2json:github.com/prometheus/prom2json \
64 github.com/rjeczalik/notify:github.com/rjeczalik/notify \
65 github.com/rs/xid:github.com/rs/xid \
66 github.com/secure-io/sio-go:github.com/secure-io/sio-go \
67 github.com/shirou/gopsutil/v3:github.com/shirou/gopsutil/v3 \
68 github.com/tidwall/gjson:github.com/tidwall/gjson \
69 golang.org/x/crypto:go.googlesource.com/crypto \
70 golang.org/x/net:go.googlesource.com/net \
71 golang.org/x/text:go.googlesource.com/text \
72 gopkg.in/check.v1:gopkg.in/check.v1 \
73 gopkg.in/h2non/filetype.v1:gopkg.in/h2non/filetype.v1 \
74 gopkg.in/yaml.v2:gopkg.in/yaml.v2 \
75 github.com/charmbracelet/bubbles:github.com/charmbracelet/bubbles \
76 github.com/charmbracelet/lipgloss:github.com/charmbracelet/lipgloss \
77 github.com/gdamore/tcell/v2:github.com/gdamore/tcell/v2 \
78 github.com/golang-jwt/jwt/v4:github.com/golang-jwt/jwt/v4 \
79 github.com/navidys/tvxwidgets:github.com/navidys/tvxwidgets \
80 github.com/olekukonko/tablewriter:github.com/olekukonko/tablewriter \
81 github.com/prometheus/client_model:github.com/prometheus/client_model \
82 github.com/rivo/tview:github.com/rivo/tview \
83 github.com/tinylib/msgp:github.com/tinylib/msgp \
84 golang.org/x/term:go.googlesource.com/term \
85 github.com/beorn7/perks:github.com/beorn7/perks \
86 github.com/cespare/xxhash/v2:github.com/cespare/xxhash/v2 \
87 github.com/containerd/console:github.com/containerd/console \
88 github.com/coreos/go-semver:github.com/coreos/go-semver \
89 github.com/coreos/go-systemd/v22:github.com/coreos/go-systemd/v22 \
90 github.com/decred/dcrd/dcrec/secp256k1/v4:github.com/decred/dcrd/dcrec/secp256k1/v4//dcrec/secp256k1 \
91 github.com/fatih/structs:github.com/fatih/structs \
92 github.com/gdamore/encoding:github.com/gdamore/encoding \
93 github.com/gogo/protobuf:github.com/gogo/protobuf \
94 github.com/golang/protobuf:github.com/golang/protobuf \
95 github.com/hashicorp/errwrap:github.com/hashicorp/errwrap \
96 github.com/hashicorp/go-multierror:github.com/hashicorp/go-multierror \
97 github.com/klauspost/cpuid/v2:github.com/klauspost/cpuid/v2 \
98 github.com/kr/text:github.com/kr/text \
99 github.com/lestrrat-go/backoff/v2:github.com/lestrrat-go/backoff/v2 \
100 github.com/lestrrat-go/blackmagic:github.com/lestrrat-go/blackmagic \
101 github.com/lestrrat-go/httpcc:github.com/lestrrat-go/httpcc \
102 github.com/lestrrat-go/iter:github.com/lestrrat-go/iter \
103 github.com/lestrrat-go/jwx:github.com/lestrrat-go/jwx \
104 github.com/lestrrat-go/option:github.com/lestrrat-go/option \
105 github.com/lucasb-eyer/go-colorful:github.com/lucasb-eyer/go-colorful \
106 github.com/lufia/plan9stats:github.com/lufia/plan9stats \
107 github.com/mattn/go-colorable:github.com/mattn/go-colorable \
108 github.com/mattn/go-runewidth:github.com/mattn/go-runewidth \
109 github.com/matttproud/golang_protobuf_extensions:github.com/matttproud/golang_protobuf_extensions \
110 github.com/modern-go/concurrent:github.com/modern-go/concurrent \
111 github.com/modern-go/reflect2:github.com/modern-go/reflect2 \
112 github.com/muesli/ansi:github.com/muesli/ansi \
113 github.com/muesli/reflow:github.com/muesli/reflow \
114 github.com/muesli/termenv:github.com/muesli/termenv \
115 github.com/niemeyer/pretty:github.com/niemeyer/pretty \
116 github.com/philhofer/fwd:github.com/philhofer/fwd \
117 github.com/pkg/errors:github.com/pkg/errors \
118 github.com/power-devops/perfstat:github.com/power-devops/perfstat \
119 github.com/prometheus/common:github.com/prometheus/common \
120 github.com/prometheus/procfs:github.com/prometheus/procfs \
121 github.com/rivo/uniseg:github.com/rivo/uniseg \
122 github.com/sirupsen/logrus:github.com/sirupsen/logrus \
123 github.com/tidwall/match:github.com/tidwall/match \
124 github.com/tidwall/pretty:github.com/tidwall/pretty \
125 github.com/tklauser/go-sysconf:github.com/tklauser/go-sysconf \
126 github.com/tklauser/numcpus:github.com/tklauser/numcpus \
127 github.com/yusufpapurcu/wmi:github.com/yusufpapurcu/wmi \
128 go.etcd.io/etcd/api/v3:github.com/etcd-io/etcd/api/v3//api \
129 go.etcd.io/etcd/client/pkg/v3:github.com/etcd-io/etcd/api/v3//client/pkg \
130 go.etcd.io/etcd/client/v3:github.com/etcd-io/etcd/api/v3//client/v3 \
131 go.uber.org/atomic:go.uber.org/atomic \
132 go.uber.org/multierr:go.uber.org/multierr \
133 go.uber.org/zap:go.uber.org/zap \
134 golang.org/x/sync:go.googlesource.com/sync \
135 golang.org/x/sys:go.googlesource.com/sys \
136 google.golang.org/genproto:google.golang.org/genproto \
137 google.golang.org/grpc:google.golang.org/grpc \
138 google.golang.org/protobuf:google.golang.org/protobuf \
139 gopkg.in/ini.v1:gopkg.in/ini.v1 \
140 gopkg.in/yaml.v3:gopkg.in/yaml.v3"
141 for s in $sites; do
142 site_dest=$(echo $s | cut -d: -f1)
143 site_source=$(echo $s | cut -d: -f2)
144 mkdir -p vendor.copy/$site_dest
145 [ -n "$(ls -A vendor.copy/$site_dest/*.go 2> /dev/null)" ] && { echo "[INFO] vendor.fetch/$site_source -> $site_dest: go copy skipped (files present)" ; true ; } || { echo "[INFO] $site_dest: copying .go files" ; rsync -a --exclude='vendor/' --exclude='.git/' vendor.fetch/$site_source/ vendor.copy/$site_dest ; }
146 done
147
148 ln -sf vendor.copy vendor
149 # these are bad symlinks, go validates them and breaks the build if they are present
150 rm -f vendor/go.etcd.io/etcd/client/v3/example_*
151
152 cp ${WORKDIR}/modules.txt vendor/
153
154 ${GO} build -trimpath
155}
156
157do_install() {
158 install -d ${D}/${sbindir}
159 install ${S}/src/${GO_IMPORT}/mc ${D}/${sbindir}/mc
160}