aboutsummaryrefslogtreecommitdiff
path: root/battering/packages/golang-xyz.scm
blob: d5d9dfc33ec1d678d5d8c7777ff3b6582aa287b5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
(define-module (battering packages golang-xyz)
  #:use-module (guix packages)
  #:use-module (guix git-download)
  #:use-module (guix gexp)
  #:use-module (guix utils)
  #:use-module (guix build-system go)
  #:use-module (gnu packages golang)
  #:use-module (gnu packages golang-build)
  #:use-module (gnu packages golang-check)
  #:use-module (gnu packages golang-crypto)
  #:use-module (gnu packages golang-web)
  #:use-module (gnu packages golang-xyz)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages protobuf)
  #:use-module ((guix licenses)
                #:prefix license:))

(define-public go-github-com-google-nftables
  (package
    (name "go-github-com-google-nftables")
    (version "0.2.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/google/nftables")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "04w08c619aqkh6rkfxxhi4z23nyq0p4bswfhnka9hcsy4r6rk4fm"))))
    (build-system go-build-system)
    (arguments
     (list
      #:import-path "github.com/google/nftables"))
    (propagated-inputs (list go-golang-org-x-sys
                             go-github-com-vishvananda-netns
                             go-github-com-mdlayher-netlink))
    (home-page "https://github.com/google/nftables")
    (synopsis "Go nftables API")
    (description "This package manipulates Linux nftables.")
    (license license:asl2.0)))

(define-public go-github-com-iovisor-gobpf
  (package
    (name "go-github-com-iovisor-gobpf")
    (version "0.2.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/iovisor/gobpf")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1w144apka9f7zjz3d77fysxi1mbik6nrf16ig4bzjgjimiiwhl4i"))))
    (build-system go-build-system)
    (arguments
     (list
      ;; Tests fail because a function signature changed in bcc/module.go.
      #:tests? #f
      #:import-path "github.com/iovisor/gobpf"))
    (native-inputs (list bcc))
    (home-page "https://github.com/iovisor/gobpf")
    (synopsis "BCC Go bindings")
    (description
     "This repository provides go bindings for the
@@url{https://github.com/iovisor/bcc,bcc framework} as well as low-level
routines to load and use @code{eBPF} programs from .elf files.")
    (license license:asl2.0)))

(define-public go-github-com-varlink-go
  (package
    (name "go-github-com-varlink-go")
    (version "0.4.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/varlink/go")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1bhpi18xrmf5in2m4y6wj2q05rxk9m219knk9dj3bin1aj1dlf56"))))
    (build-system go-build-system)
    (arguments
     (list
      #:import-path "github.com/varlink/go/varlink"
      #:unpack-path "github.com/varlink/go"))
    (home-page "https://github.com/varlink/go")
    (synopsis "Varlink implementation in Go")
    (description "This is an implementation of the varlink protocol in golang.")
    (license license:asl2.0)))

(define-public go-google-golang-org-genproto
  (package
    (name "go-google-golang-org-genproto")
    (version "0.0.0-20250124145028-65684f501c47")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/googleapis/go-genproto")
             (commit (go-version->git-ref version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "19l2kzyccfp4ychndkfyq2h3b1qppagxv5faifwkr67q2xlm38l3"))))
    (build-system go-build-system)
    (arguments
     (list
      #:import-path "google.golang.org/genproto"
      #:tests? #f
      #:phases
      #~(modify-phases %standard-phases
          ;; XXX: Workaround for go-build-system's lack of Go modules
          ;; support.
          (delete 'build))))
    (propagated-inputs (list go-google-golang-org-protobuf))
    (home-page "https://google.golang.org/genproto")
    (synopsis "Generated code for Google Cloud client libraries.")
    (description "This repository contains the generated Go packages for
common protocol buffer types, and the generated gRPC code necessary for
interacting with Google's gRPC APIs.")
    (license license:asl2.0)))

(define-public go-cel-dev-expr
  (package
    (name "go-cel-dev-expr")
    (version "0.19.2")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/google/cel-spec")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0hprmgih9z16rl6cyy1794cm6qzwdy7gqqkfhxnhqcha7rbqdr3p"))))
    (build-system go-build-system)
    (arguments
     (list
      #:import-path "cel.dev/expr"))
    (propagated-inputs (list go-google-golang-org-protobuf
                             go-google-golang-org-genproto))
    (home-page "https://cel.dev/expr")
    (synopsis "Common Expression Language")
    (description
     "The Common Expression Language (CEL) implements common semantics for expression
evaluation, enabling different applications to more easily interoperate.")
    (license license:asl2.0)))

(define go-github-com-lyft-protoc-gen-star-v2-latest
  ;; envoyproxy/protoc-gen-validate needs the latest version of this package.
  ;; This will get removed when v2.0.4 is merged into master.
  (package/inherit go-github-com-lyft-protoc-gen-star-v2
    (version "v2.0.4-0.20230330145011-496ad1ac90a4")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/lyft/protoc-gen-star")
             (commit (go-version->git-ref version))))
       (file-name (git-file-name (package-name go-github-com-lyft-protoc-gen-star-v2) version))
       (sha256
        (base32 "1jdgzaq3r1bs12f0a0y84vnrc01m9xzvsk55cvcfspkv14pscqjy"))))))

(define-public go-github-com-envoyproxy-protoc-gen-validate
  (package
    (name "go-github-com-envoyproxy-protoc-gen-validate")
    (version "1.2.1")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/bufbuild/protoc-gen-validate")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0yd77gnsn9bbiihbkdyn9klwbv314l6ar83z4kivpn9mr93xysch"))))
    (build-system go-build-system)
    (arguments
     (list
      #:import-path "github.com/envoyproxy/protoc-gen-validate"
      #:tests? #f ;; Files needs to be generated in `tests/harness/go` in a
      ;; way I couldn't figure out.
      #:phases #~(modify-phases %standard-phases
                   (add-before 'check 'generate-harness-testcases
                     (lambda* (#:key import-path tests? #:allow-other-keys)
                       (when tests?
                         (with-directory-excursion (string-append "src/" import-path)
                           (substitute* "Makefile"
                             ;; Change all local protoc-gen-go stuff to the
                             ;; protoc-gen-go package
                             (("\\$\\(shell pwd\\)/bin/protoc-gen-go")
                              #$(file-append protoc-gen-go "/bin/protoc-gen-go"))
                             ;; Remove the bin/protoc-gen-go dependency rule
                             ;; cause it tries to pull protoc-gen-go
                             (("(^[a-z/.]+:) bin/protoc-gen-go" _ rulename)
                              rulename))
                           (setenv "PATH" (format #f "~a/bin:~a" #$output (getenv "PATH")))
                           (invoke "make" "testcases"))))))))
    (propagated-inputs (list go-google-golang-org-protobuf go-golang-org-x-net
                             go-github-com-lyft-protoc-gen-star-v2-latest
                             go-github-com-iancoleman-strcase
                             protoc-gen-go))
    (native-inputs (list protobuf))
    (home-page "https://github.com/envoyproxy/protoc-gen-validate")
    (synopsis "protoc-gen-validate (PGV)")
    (description
     "PGV is a protoc plugin to generate polyglot message validators.  While protocol
buffers effectively guarantee the types of structured data, they cannot enforce
semantic rules for values.  This plugin adds support to protoc-generated code to
validate such constraints.")
    (license license:asl2.0)))

(define-public go-github-com-cncf-xds-go
  (package
    (name "go-github-com-cncf-xds-go")
    (version "0.0.0-20250121191232-2f005788dc42")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/cncf/xds")
             (commit (go-version->git-ref version
                                          #:subdir "go"))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "03alj987dcmmbcz0xysp6pwrz6dmqzy9vf3d9p1vy6j48l434lv3"))))
    (build-system go-build-system)
    (arguments
     (list
      #:import-path "github.com/cncf/xds/go"
      #:unpack-path "github.com/cncf/xds"
      #:tests? #f
      #:phases
      #~(modify-phases %standard-phases
          ;; XXX: Workaround for go-build-system's lack of Go modules
          ;; support.
          (delete 'build))))
    (propagated-inputs (list go-google-golang-org-protobuf
                             go-google-golang-org-genproto
                             go-github-com-envoyproxy-protoc-gen-validate
                             go-cel-dev-expr))
    (home-page "https://github.com/cncf/xds")
    (synopsis "xDS API Working Group")
    (description "The objective of the xDS API Working Group (xDS-WG) is to
bring together parties across the industry interested in a common control and
configuration API for data plane proxies and load balancers, based on the xDS
APIs.")
    (license license:asl2.0)))