blob: 94986089c711a2d43b2f97ca749907d878342935 [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
Andrew Geissler517393d2023-01-13 08:55:19 -060019LICENSE = "AGPL-3.0-only"
Patrick Williams7784c422022-11-17 07:29:11 -060020LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=eb1e647870add0502f8f010b19de32af"
21
22PV = "${SRCREV_mc}"
23
24inherit go
25inherit goarch
26
Andrew Geissler517393d2023-01-13 08:55:19 -060027# | ./github.com/minio/mc/main.go:27:(.text+0xd258b8): relocation R_MIPS_HI16 against `a local symbol' cannot be used when making a shared object; recompile with -fPIC
28COMPATIBLE_HOST:mips = "null"
Patrick Williams7784c422022-11-17 07:29:11 -060029
30DEPENDS += "rsync-native"
31
32do_compile() {
33
34 cd ${S}/src/${GO_IMPORT}
35
36 export GOFLAGS="-mod=vendor"
37 export GOPATH="$GOPATH:${S}/src/import/.gopath:${S}/src/import/vendor"
38 sites="github.com/charmbracelet/bubbletea:github.com/charmbracelet/bubbletea \
39 github.com/cheggaaa/pb:github.com/cheggaaa/pb \
40 github.com/dustin/go-humanize:github.com/dustin/go-humanize \
41 github.com/fatih/color:github.com/fatih/color \
42 github.com/go-ole/go-ole:github.com/go-ole/go-ole \
43 github.com/goccy/go-json:github.com/goccy/go-json \
44 github.com/google/shlex:github.com/google/shlex \
45 github.com/google/uuid:github.com/google/uuid \
46 github.com/inconshreveable/mousetrap:github.com/inconshreveable/mousetrap \
47 github.com/json-iterator/go:github.com/json-iterator/go \
48 github.com/klauspost/compress:github.com/klauspost/compress \
49 github.com/mattn/go-ieproxy:github.com/mattn/go-ieproxy \
50 github.com/mattn/go-isatty:github.com/mattn/go-isatty \
51 github.com/minio/cli:github.com/minio/cli \
52 github.com/minio/colorjson:github.com/minio/colorjson \
53 github.com/minio/filepath:github.com/minio/filepath \
54 github.com/minio/madmin-go:github.com/minio/madmin-go \
55 github.com/minio/md5-simd:github.com/minio/md5-simd \
56 github.com/minio/minio-go/v7:github.com/minio/minio-go/v7 \
57 github.com/minio/pkg:github.com/minio/pkg \
58 github.com/minio/selfupdate:github.com/minio/selfupdate \
59 github.com/minio/sha256-simd:github.com/minio/sha256-simd \
60 github.com/mitchellh/go-homedir:github.com/mitchellh/go-homedir \
61 github.com/pkg/xattr:github.com/pkg/xattr \
62 github.com/posener/complete:github.com/posener/complete \
63 github.com/prometheus/client_golang:github.com/prometheus/client_golang \
64 github.com/prometheus/prom2json:github.com/prometheus/prom2json \
65 github.com/rjeczalik/notify:github.com/rjeczalik/notify \
66 github.com/rs/xid:github.com/rs/xid \
67 github.com/secure-io/sio-go:github.com/secure-io/sio-go \
68 github.com/shirou/gopsutil/v3:github.com/shirou/gopsutil/v3 \
69 github.com/tidwall/gjson:github.com/tidwall/gjson \
70 golang.org/x/crypto:go.googlesource.com/crypto \
71 golang.org/x/net:go.googlesource.com/net \
72 golang.org/x/text:go.googlesource.com/text \
73 gopkg.in/check.v1:gopkg.in/check.v1 \
74 gopkg.in/h2non/filetype.v1:gopkg.in/h2non/filetype.v1 \
75 gopkg.in/yaml.v2:gopkg.in/yaml.v2 \
76 github.com/charmbracelet/bubbles:github.com/charmbracelet/bubbles \
77 github.com/charmbracelet/lipgloss:github.com/charmbracelet/lipgloss \
78 github.com/gdamore/tcell/v2:github.com/gdamore/tcell/v2 \
79 github.com/golang-jwt/jwt/v4:github.com/golang-jwt/jwt/v4 \
80 github.com/navidys/tvxwidgets:github.com/navidys/tvxwidgets \
81 github.com/olekukonko/tablewriter:github.com/olekukonko/tablewriter \
82 github.com/prometheus/client_model:github.com/prometheus/client_model \
83 github.com/rivo/tview:github.com/rivo/tview \
84 github.com/tinylib/msgp:github.com/tinylib/msgp \
85 golang.org/x/term:go.googlesource.com/term \
86 github.com/beorn7/perks:github.com/beorn7/perks \
87 github.com/cespare/xxhash/v2:github.com/cespare/xxhash/v2 \
88 github.com/containerd/console:github.com/containerd/console \
89 github.com/coreos/go-semver:github.com/coreos/go-semver \
90 github.com/coreos/go-systemd/v22:github.com/coreos/go-systemd/v22 \
91 github.com/decred/dcrd/dcrec/secp256k1/v4:github.com/decred/dcrd/dcrec/secp256k1/v4//dcrec/secp256k1 \
92 github.com/fatih/structs:github.com/fatih/structs \
93 github.com/gdamore/encoding:github.com/gdamore/encoding \
94 github.com/gogo/protobuf:github.com/gogo/protobuf \
95 github.com/golang/protobuf:github.com/golang/protobuf \
96 github.com/hashicorp/errwrap:github.com/hashicorp/errwrap \
97 github.com/hashicorp/go-multierror:github.com/hashicorp/go-multierror \
98 github.com/klauspost/cpuid/v2:github.com/klauspost/cpuid/v2 \
99 github.com/kr/text:github.com/kr/text \
100 github.com/lestrrat-go/backoff/v2:github.com/lestrrat-go/backoff/v2 \
101 github.com/lestrrat-go/blackmagic:github.com/lestrrat-go/blackmagic \
102 github.com/lestrrat-go/httpcc:github.com/lestrrat-go/httpcc \
103 github.com/lestrrat-go/iter:github.com/lestrrat-go/iter \
104 github.com/lestrrat-go/jwx:github.com/lestrrat-go/jwx \
105 github.com/lestrrat-go/option:github.com/lestrrat-go/option \
106 github.com/lucasb-eyer/go-colorful:github.com/lucasb-eyer/go-colorful \
107 github.com/lufia/plan9stats:github.com/lufia/plan9stats \
108 github.com/mattn/go-colorable:github.com/mattn/go-colorable \
109 github.com/mattn/go-runewidth:github.com/mattn/go-runewidth \
110 github.com/matttproud/golang_protobuf_extensions:github.com/matttproud/golang_protobuf_extensions \
111 github.com/modern-go/concurrent:github.com/modern-go/concurrent \
112 github.com/modern-go/reflect2:github.com/modern-go/reflect2 \
113 github.com/muesli/ansi:github.com/muesli/ansi \
114 github.com/muesli/reflow:github.com/muesli/reflow \
115 github.com/muesli/termenv:github.com/muesli/termenv \
116 github.com/niemeyer/pretty:github.com/niemeyer/pretty \
117 github.com/philhofer/fwd:github.com/philhofer/fwd \
118 github.com/pkg/errors:github.com/pkg/errors \
119 github.com/power-devops/perfstat:github.com/power-devops/perfstat \
120 github.com/prometheus/common:github.com/prometheus/common \
121 github.com/prometheus/procfs:github.com/prometheus/procfs \
122 github.com/rivo/uniseg:github.com/rivo/uniseg \
123 github.com/sirupsen/logrus:github.com/sirupsen/logrus \
124 github.com/tidwall/match:github.com/tidwall/match \
125 github.com/tidwall/pretty:github.com/tidwall/pretty \
126 github.com/tklauser/go-sysconf:github.com/tklauser/go-sysconf \
127 github.com/tklauser/numcpus:github.com/tklauser/numcpus \
128 github.com/yusufpapurcu/wmi:github.com/yusufpapurcu/wmi \
129 go.etcd.io/etcd/api/v3:github.com/etcd-io/etcd/api/v3//api \
130 go.etcd.io/etcd/client/pkg/v3:github.com/etcd-io/etcd/api/v3//client/pkg \
131 go.etcd.io/etcd/client/v3:github.com/etcd-io/etcd/api/v3//client/v3 \
132 go.uber.org/atomic:go.uber.org/atomic \
133 go.uber.org/multierr:go.uber.org/multierr \
134 go.uber.org/zap:go.uber.org/zap \
135 golang.org/x/sync:go.googlesource.com/sync \
136 golang.org/x/sys:go.googlesource.com/sys \
137 google.golang.org/genproto:google.golang.org/genproto \
138 google.golang.org/grpc:google.golang.org/grpc \
139 google.golang.org/protobuf:google.golang.org/protobuf \
140 gopkg.in/ini.v1:gopkg.in/ini.v1 \
141 gopkg.in/yaml.v3:gopkg.in/yaml.v3"
142 for s in $sites; do
143 site_dest=$(echo $s | cut -d: -f1)
144 site_source=$(echo $s | cut -d: -f2)
145 mkdir -p vendor.copy/$site_dest
146 [ -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 ; }
147 done
148
149 ln -sf vendor.copy vendor
150 # these are bad symlinks, go validates them and breaks the build if they are present
151 rm -f vendor/go.etcd.io/etcd/client/v3/example_*
152
153 cp ${WORKDIR}/modules.txt vendor/
154
155 ${GO} build -trimpath
156}
157
158do_install() {
159 install -d ${D}/${sbindir}
160 install ${S}/src/${GO_IMPORT}/mc ${D}/${sbindir}/mc
161}