aboutsummaryrefslogtreecommitdiff
path: root/packages/ferretdb.scm
blob: 1d1718c6ce959c6709c8d8b6266ffabce648107a (about) (plain)
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
(use-modules (gnu packages golang)
             (gnu packages golang-build)
             (gnu packages golang-check)
             (gnu packages golang-compression)
             (gnu packages golang-crypto)
             (gnu packages golang-web)
             (gnu packages golang-xyz)
             (gnu packages prometheus)
             (guix build-system go)
             (guix git-download)
             (guix gexp)
             ((guix licenses) #:prefix license:)
             (guix packages)
             (guix utils))

(define-public go-github-com-aleksi-pointer
  (package
    (name "go-github-com-aleksi-pointer")
    (version "1.2.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/AlekSi/pointer")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0rncmanv62wwy7ihvjhvb695mkvy4kdzhgnn90zygs9yrfzzk0wk"))))
    (build-system go-build-system)
    (arguments
     (list
      #:import-path "github.com/AlekSi/pointer"))
    (home-page "https://github.com/AlekSi/pointer")
    (synopsis "pointer")
    (description
     "Package pointer provides helpers to convert between pointers and values of
built-in (and, with generics, of any) types.")
    (license license:expat)))

(define-public go-go-mongodb-org-mongo-driver
  (package
    (name "go-go-mongodb-org-mongo-driver")
    (version "1.17.6")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/mongodb/mongo-go-driver")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0n1vxs3dcjcrj3lmhw8jvqnwqnbj82jxqcb1l74ga1r8vp2qqrcb"))))
    (build-system go-build-system)
    (arguments
     (list
      #:import-path "go.mongodb.org/mongo-driver"
      #:skip-build? #t
      #:tests? #f)) ;; Some tests require network access.
    (propagated-inputs (list go-golang-org-x-sync
                             go-golang-org-x-crypto
                             go-github-com-youmark-pkcs8
                             go-github-com-xdg-go-stringprep
                             go-github-com-xdg-go-scram
                             go-github-com-klauspost-compress
                             go-github-com-google-go-cmp
                             go-github-com-golang-snappy
                             go-github-com-davecgh-go-spew))
    (home-page "https://go.mongodb.org/mongo-driver")
    (synopsis "MongoDB Go Driver")
    (description "The @code{MongoDB} supported driver for Go.")
    (license license:asl2.0)))

(define-public go-go-mongodb-org-mongo-driver-2
  (let ((base go-go-mongodb-org-mongo-driver))
    (package
      (inherit base)
      (name "go-go-mongodb-org-mongo-driver-2")
      (version "2.4.1")
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
                (url "https://github.com/mongodb/mongo-go-driver")
                (commit (string-append "v" version))))
         (file-name (git-file-name name version))
         (sha256
          (base32 "0x1v8p6wkviqabiqzdrydd1n520h77b29yvm779r82gmj593zxa9"))))
      (arguments
       (substitute-keyword-arguments (package-arguments base)
         ((#:import-path import-path) "go.mongodb.org/mongo-driver/v2")))
      (propagated-inputs `(("go-github-com-golang-snappy"
                            ,go-github-com-golang-snappy)
                           . ,(package-propagated-inputs base)))
      (synopsis "MongoDB Go Driver, version 2"))))

(define-public go-github-com-ferretdb-wire
  (package
    (name "go-github-com-ferretdb-wire")
    (version "0.0.8")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/FerretDB/wire")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "19klzbdjhhkdxslnx8ls3i7n421z4ihra4zigrv52bdv90l4xmdf"))))
    (build-system go-build-system)
    (arguments
     (list
      #:import-path "github.com/FerretDB/wire"
      #:tests? #f)) ;; Some tests require network access.
    (propagated-inputs (list go-github-com-xdg-go-scram
                             go-github-com-stretchr-testify))
    (home-page "https://github.com/FerretDB/wire")
    (synopsis "wire")
    (description
     "Package wire provides
@@url{https://www.mongodb.com/docs/manual/reference/mongodb-wire-protocol/,@code{MongoDB}
wire protocol} implementation.")
    (license license:asl2.0)))

(define-public go-ferretdb
  (package
    (name "go-github-com-ferretdb-ferretdb")
    (version "1.24.2")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/FerretDB/FerretDB")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1436ba27asaw2c35nklgar6b2zas1clgsm8fz8a6c8wcy901qnxg"))))
    (build-system go-build-system)
    (arguments
     (list
      #:unpack-path "github.com/FerretDB/FerretDB"
      #:import-path "github.com/FerretDB/FerretDB/cmd/ferretdb"
      #:install-source? #f
      #:tests? #f ;; Tests expect .git.
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'do-not-use-fallback-x509roots
            (lambda* (#:key unpack-path #:allow-other-keys)
              (substitute* (map (lambda (subpath)
                                  (format #f "src/~a/~a" unpack-path subpath))
                                '("go.mod" "cmd/ferretdb/main.go"))
                ((".*x509roots/fallback.*" line)
                 (format #f "//~a" line)))))
          (add-after 'unpack 'do-not-use-statsviz
            (lambda* (#:key unpack-path #:allow-other-keys)
              (substitute* (map (lambda (subpath)
                                  (format #f "src/~a/~a" unpack-path subpath))
                                '("go.mod"
                                  "integration/go.mod"
                                  "internal/util/debug/debug.go"))
                ((".*arl/statsviz.*" line)
                 (format #f "//~a" line)))
              (substitute* (format #f "src/~a/~a" unpack-path
                                   "internal/util/debug/debug.go")
                ((".*svOpts := .*" line)
                 (format #f "/*~a" line))
                ((".*statsviz.Register.*" line)
                 (format #f "~a*/" line))))))))
    (native-inputs (list go-modernc-org-sqlite
                         go-golang-org-x-sys
                         go-golang-org-x-exp
                         go-go-uber-org-automaxprocs
                         go-go-opentelemetry-io-otel-trace
                         go-go-opentelemetry-io-otel-sdk
                         go-go-opentelemetry-io-otel-exporters-otlp-otlptrace
                         go-go-opentelemetry-io-otel-exporters-otlp-otlptrace-otlptracehttp
                         go-go-opentelemetry-io-otel
                         go-go-mongodb-org-mongo-driver
                         go-github-com-prometheus-common
                         go-github-com-prometheus-client-model
                         go-github-com-prometheus-client-golang
                         go-github-com-jackc-pgx-v5
                         go-github-com-jackc-pgerrcode
                         go-github-com-google-uuid
                         go-github-com-go-sql-driver-mysql
                         go-github-com-alecthomas-kong
                         go-github-com-sap-go-hdb
                         go-github-com-ferretdb-wire
                         go-github-com-aleksi-pointer))
    (home-page "https://github.com/FerretDB/FerretDB")
    (synopsis "FerretDB")
    (description
     "@code{FerretDB} was founded to become the de-facto open-source substitute to
@code{MongoDB}. @code{FerretDB} is an open-source proxy, converting the
@code{MongoDB} 5.0+ wire protocol queries to SQL - using @code{PostgreSQL} or
SQLite as a database engine.")
    (license license:asl2.0)))

go-ferretdb