| 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 | (define-module (gnu packages high-availability)
|
| 35 | #:use-module (gnu packages autotools)
|
| 36 | #:use-module (gnu packages base)
|
| 37 | #:use-module (gnu packages bash)
|
| 38 | #:use-module (gnu packages check)
|
| 39 | #:use-module (gnu packages cluster)
|
| 40 | #:use-module (gnu packages compression)
|
| 41 | #:use-module (gnu packages crypto)
|
| 42 | #:use-module (gnu packages documentation)
|
| 43 | #:use-module (gnu packages elixir)
|
| 44 | #:use-module (gnu packages erlang)
|
| 45 | #:use-module (gnu packages gcc)
|
| 46 | #:use-module (gnu packages gettext)
|
| 47 | #:use-module (gnu packages glib)
|
| 48 | #:use-module (gnu packages golang-build)
|
| 49 | #:use-module (gnu packages golang-check)
|
| 50 | #:use-module (gnu packages golang-compression)
|
| 51 | #:use-module (gnu packages golang-crypto)
|
| 52 | #:use-module (gnu packages golang-web)
|
| 53 | #:use-module (gnu packages golang-xyz)
|
| 54 | #:use-module (gnu packages hardware)
|
| 55 | #:use-module (gnu packages libevent)
|
| 56 | #:use-module (gnu packages linux)
|
| 57 | #:use-module (gnu packages lua)
|
| 58 | #:use-module (gnu packages networking)
|
| 59 | #:use-module (gnu packages nss)
|
| 60 | #:use-module (gnu packages pcre)
|
| 61 | #:use-module (gnu packages pkg-config)
|
| 62 | #:use-module (gnu packages python)
|
| 63 | #:use-module (gnu packages rsync)
|
| 64 | #:use-module (gnu packages sqlite)
|
| 65 | #:use-module (gnu packages tls)
|
| 66 | #:use-module (gnu packages valgrind)
|
| 67 | #:use-module (gnu packages version-control)
|
| 68 | #:use-module (gnu packages xml)
|
| 69 | #:use-module (gnu packages)
|
| 70 | #:use-module (guix build-system gnu)
|
| 71 | #:use-module (guix build-system go)
|
| 72 | #:use-module (guix download)
|
| 73 | #:use-module (guix gexp)
|
| 74 | #:use-module (guix git-download)
|
| 75 | #:use-module (guix packages)
|
| 76 | #:use-module (guix utils)
|
| 77 | #:use-module ((guix licenses)
|
| 78 | #:prefix license:))
|
| 79 |
|
| 80 | (define-public cowsql
|
| 81 | (package
|
| 82 | (name "cowsql")
|
| 83 | (version "1.15.9")
|
| 84 | (source
|
| 85 | (origin
|
| 86 | (method git-fetch)
|
| 87 | (uri (git-reference
|
| 88 | (url "https://github.com/cowsql/cowsql")
|
| 89 | (commit (string-append "v" version))))
|
| 90 | (file-name (git-file-name name version))
|
| 91 | (sha256
|
| 92 | (base32 "10pj422lzl0rbid4cxg80rhzgqbz3mnhnhx8s0zm54nniirdbn7d"))))
|
| 93 | (build-system gnu-build-system)
|
| 94 | (arguments
|
| 95 | (list
|
| 96 | #:phases
|
| 97 | #~(modify-phases %standard-phases
|
| 98 | (replace 'bootstrap
|
| 99 | (lambda _
|
| 100 | (invoke "autoreconf" "-vfi"))))))
|
| 101 | (native-inputs
|
| 102 | (list autoconf
|
| 103 | automake
|
| 104 | libtool
|
| 105 | pkg-config))
|
| 106 | (inputs
|
| 107 | (list cowsql-raft
|
| 108 | libuv
|
| 109 | sqlite))
|
| 110 | (home-page "https://github.com/cowsql/cowsql")
|
| 111 | (synopsis "Embeddable, replicated and fault tolerant SQL engine")
|
| 112 | (description
|
| 113 | "cowsql (/ˈkaʊ,siːkwəl/ listen) is a C library that implements an
|
| 114 | embeddable and replicated SQL database engine with high availability and
|
| 115 | automatic failover.
|
| 116 |
|
| 117 | cowsql extends SQLite with a network protocol that can connect together
|
| 118 | various instances of your application and have them act as a highly-available
|
| 119 | cluster, with no dependency on external databases.")
|
| 120 | (license license:gpl3+)))
|
| 121 |
|
| 122 | (define-public cowsql-raft
|
| 123 | (package
|
| 124 | (name "cowsql-raft")
|
| 125 | (version "0.22.1")
|
| 126 | (source
|
| 127 | (origin
|
| 128 | (method git-fetch)
|
| 129 | (uri (git-reference
|
| 130 | (url "https://github.com/cowsql/raft")
|
| 131 | (commit (string-append "v" version))))
|
| 132 | (file-name (git-file-name name version))
|
| 133 | (sha256
|
| 134 | (base32 "1cs70jlc2hg3hrcwpc4h54l4zpwm287mlamdm7gxhpdw7c0kyv38"))))
|
| 135 | (build-system gnu-build-system)
|
| 136 | (arguments
|
| 137 | (list
|
| 138 | #:phases
|
| 139 | #~(modify-phases %standard-phases
|
| 140 | (replace 'bootstrap
|
| 141 | (lambda _
|
| 142 | (invoke "autoreconf" "-vfi"))))))
|
| 143 | (native-inputs
|
| 144 | (list autoconf
|
| 145 | automake
|
| 146 | libtool
|
| 147 | pkg-config))
|
| 148 | (inputs
|
| 149 | (list libuv
|
| 150 | lz4))
|
| 151 | (home-page "https://github.com/cowsql/raft")
|
| 152 | (synopsis "Asynchronous C implementation of the Raft consensus protocol")
|
| 153 | (description
|
| 154 | "This package implements a Raft algorithm logic (no I/O and no system
|
| 155 | calls). On top of that, various drivers are provided that implement actual
|
| 156 | network communication and persistent data storage.
|
| 157 |
|
| 158 | The core part of the library is designed to work well with asynchronous or
|
| 159 | non-blocking I/O engines (such as libuv and io_uring), although it can be used
|
| 160 | in threaded or blocking contexts as well.")
|
| 161 | (license license:lgpl3)))
|
| 162 |
|
| 163 | (define-public haproxy
|
| 164 | (package
|
| 165 | (name "haproxy")
|
| 166 | (version "3.2.7")
|
| 167 | (source
|
| 168 | (origin
|
| 169 | (method url-fetch)
|
| 170 | |
| 171 | (uri (string-append "https://www.haproxy.org/download/"
|
| 172 | (version-major+minor version)
|
| 173 | "/src/haproxy-" version ".tar.gz"))
|
| 174 | (sha256
|
| 175 | (base32 "0y22ypxhiw7s2v7lc309w24asxq83a9xyk3frgay46dkn3gyj2hz"))))
|
| 176 | (build-system gnu-build-system)
|
| 177 | (arguments
|
| 178 | (list
|
| 179 | #:tests? #f |
| 180 | #:make-flags
|
| 181 | #~(list "LUA_LIB_NAME=lua"
|
| 182 | "TARGET=linux-glibc"
|
| 183 | "USE_LUA=1"
|
| 184 | "USE_OPENSSL=1"
|
| 185 | "USE_PCRE2=1"
|
| 186 | "USE_PCRE2_JIT=1"
|
| 187 | "USE_PROMEX=1"
|
| 188 | "USE_ZLIB=1"
|
| 189 | (string-append "CC=" #$(cc-for-target))
|
| 190 | (string-append "DOCDIR=" #$output "/share/" #$name)
|
| 191 | (string-append "LUA_INC=" #$(this-package-input "lua") "/include")
|
| 192 | (string-append "LUA_LIB=" #$(this-package-input "lua") "/lib")
|
| 193 | (string-append "PREFIX=" #$output))
|
| 194 | #:phases
|
| 195 | #~(modify-phases %standard-phases
|
| 196 | (delete 'configure))))
|
| 197 | (inputs
|
| 198 | (list libxcrypt lua openssl pcre2 zlib))
|
| 199 | (home-page "https://www.haproxy.org/")
|
| 200 | (synopsis "Reliable, high performance TCP/HTTP load balancer")
|
| 201 | (description "HAProxy offers @acronym{HA, high availability}, load
|
| 202 | balancing, and proxying for TCP and HTTP-based applications. It is particularly
|
| 203 | suited to Web sites crawling under very high loads while needing persistence or
|
| 204 | Layer 7 processing. Supporting tens of thousands of connections is clearly
|
| 205 | realistic with today's hardware.")
|
| 206 | (license (list license:gpl2+
|
| 207 | license:lgpl2.1
|
| 208 | license:lgpl2.1+))))
|
| 209 |
|
| 210 | (define-public libqb
|
| 211 | (package
|
| 212 | (name "libqb")
|
| 213 | (version "2.0.9")
|
| 214 | (source (origin
|
| 215 | (method url-fetch)
|
| 216 | (uri (string-append
|
| 217 | "https://github.com/ClusterLabs/libqb/releases/download/v"
|
| 218 | version "/libqb-" version ".tar.xz"))
|
| 219 | (sha256
|
| 220 | (base32
|
| 221 | "02r1dc5m0xjf8hq14x87injw0smmh677f5gnd5xa91lw359kga31"))))
|
| 222 | (build-system gnu-build-system)
|
| 223 | (native-inputs (list pkg-config))
|
| 224 | (inputs (list libxml2))
|
| 225 | (home-page "https://clusterlabs.github.io/libqb/")
|
| 226 | (synopsis
|
| 227 | "Library providing high-performance logging, tracing, IPC, and polling")
|
| 228 | (description
|
| 229 | "Libqb is a library with the primary purpose of providing
|
| 230 | high-performance, reusable features for client-server architecture, such as
|
| 231 | logging, tracing, @acronym{IPC, inter-process communication} and polling. Libqb
|
| 232 | is not intended to be an all-encompassing library, but instead provide focused
|
| 233 | APIs that are highly tuned for maximum performance for client-server
|
| 234 | applications.")
|
| 235 | (license license:lgpl2.1)))
|
| 236 |
|
| 237 | (define-public kronosnet
|
| 238 | (package
|
| 239 | (name "kronosnet")
|
| 240 | (version "1.33")
|
| 241 | (source (origin
|
| 242 | (method git-fetch)
|
| 243 | (uri (git-reference
|
| 244 | (url "https://github.com/kronosnet/kronosnet")
|
| 245 | (commit (string-append "v" version))))
|
| 246 | (file-name (git-file-name name version))
|
| 247 | (sha256
|
| 248 | (base32
|
| 249 | "068q6v4hyr46iw12nb8mq59fxx92hcy6p5vcqprd0x99gfv1rkjd"))))
|
| 250 | (build-system gnu-build-system)
|
| 251 | (arguments
|
| 252 | |
| 253 | |
| 254 | |
| 255 | |
| 256 | (list #:tests? #f
|
| 257 | #:configure-flags #~'("--disable-static")
|
| 258 | #:phases #~(modify-phases %standard-phases
|
| 259 | (add-before 'bootstrap 'fix-version-gen
|
| 260 | (lambda _
|
| 261 | (call-with-output-file ".tarball-version"
|
| 262 | (lambda (port)
|
| 263 | (display #$version port))))))))
|
| 264 | (native-inputs (list autoconf
|
| 265 | automake
|
| 266 | doxygen
|
| 267 | libtool
|
| 268 | net-tools
|
| 269 | pkg-config))
|
| 270 | (inputs (list lksctp-tools
|
| 271 | libnl
|
| 272 | libqb
|
| 273 | libxml2
|
| 274 | lz4
|
| 275 | lzo
|
| 276 | nss
|
| 277 | nspr
|
| 278 | openssl
|
| 279 | xz
|
| 280 | zlib
|
| 281 | `(,zstd "lib")))
|
| 282 | (home-page "https://kronosnet.org/")
|
| 283 | (synopsis "Network abstraction layer designed for High Availability")
|
| 284 | (description
|
| 285 | "Kronosnet, often referred to as @code{knet}, is a network
|
| 286 | abstraction layer designed for High Availability use cases, where redundancy,
|
| 287 | security, fault tolerance and fast fail-over are the core requirements of
|
| 288 | your application.
|
| 289 |
|
| 290 | Kronosnet is the new underlying network protocol for Linux HA components
|
| 291 | (Corosync), that features ability to use multiple links between nodes,
|
| 292 | active/active and active/passive link failover policies, automatic link
|
| 293 | recovery, FIPS compliant encryption (nss and/or openssl), automatic PMTUd and
|
| 294 | in general better performances compared to the old network protocol.")
|
| 295 | (license (list license:gpl2+ license:lgpl2.1+))))
|
| 296 |
|
| 297 | (define-public nats-server
|
| 298 | (package
|
| 299 | (name "nats-server")
|
| 300 | (version "2.14.1")
|
| 301 | (source
|
| 302 | (origin
|
| 303 | (method git-fetch)
|
| 304 | (uri (git-reference
|
| 305 | (url "https://github.com/nats-io/nats-server")
|
| 306 | (commit (string-append "v" version))))
|
| 307 | (file-name (git-file-name name version))
|
| 308 | (sha256
|
| 309 | (base32 "1bnp17ddvpx0n8r7p4spfnhwhwwzff3f9w2h54pss8qvrsv0xy2a"))))
|
| 310 | (build-system go-build-system)
|
| 311 | (arguments
|
| 312 | (list
|
| 313 | #:install-source? #f
|
| 314 | #:import-path "github.com/nats-io/nats-server"
|
| 315 | |
| 316 | |
| 317 | #:test-flags
|
| 318 | #~(list "-count=1" "-vet=off" "-failfast"
|
| 319 | "-skip" (string-join
|
| 320 | (list "TestHTTPHost"
|
| 321 | "TestSysLogger"
|
| 322 | "TestLogMaxArchives")
|
| 323 | "|"))
|
| 324 | #:test-subdirs
|
| 325 | #~(list "conf/..." "internal/..." "logger/..." "test/...")))
|
| 326 | (inputs
|
| 327 | (list go-github-com-antithesishq-antithesis-sdk-go
|
| 328 | go-github-com-google-go-tpm
|
| 329 | go-github-com-klauspost-compress
|
| 330 | go-github-com-minio-highwayhash
|
| 331 | go-github-com-nats-io-jwt-v2
|
| 332 | go-github-com-nats-io-nats-go
|
| 333 | go-github-com-nats-io-nkeys
|
| 334 | go-github-com-nats-io-nuid
|
| 335 | go-golang-org-x-crypto
|
| 336 | go-golang-org-x-sys
|
| 337 | go-golang-org-x-time))
|
| 338 | (home-page "https://github.com/nats-io/nats-server")
|
| 339 | (synopsis "High performance message broker")
|
| 340 | (description
|
| 341 | "NATS is a simple, secure and performant communications system for digital
|
| 342 | systems, services and devices. NATS is part of the Cloud Native Computing
|
| 343 | Foundation (CNCF). NATS has over 40 client language implementations, and its
|
| 344 | server can run on-premise, in the cloud, at the edge, and even on a Raspberry
|
| 345 | Pi. NATS can secure and simplify design and operation of modern distributed
|
| 346 | systems.")
|
| 347 | (license license:asl2.0)))
|
| 348 |
|
| 349 | (define-public nsq
|
| 350 | (package
|
| 351 | (name "nsq")
|
| 352 | (version "1.3.0")
|
| 353 | (source
|
| 354 | (origin
|
| 355 | (method git-fetch)
|
| 356 | (uri (git-reference
|
| 357 | (url "https://github.com/nsqio/nsq")
|
| 358 | (commit (string-append "v" version))))
|
| 359 | (file-name (git-file-name name version))
|
| 360 | (sha256
|
| 361 | (base32 "1227ricbng8r5svnpr6hkmwjafa74jdp3ivijrk55qhw43rjk05a"))))
|
| 362 | (build-system go-build-system)
|
| 363 | (arguments
|
| 364 | (list
|
| 365 | #:import-path "github.com/nsqio/nsq"
|
| 366 | #:install-source? #f
|
| 367 | #:phases
|
| 368 | #~(modify-phases %standard-phases
|
| 369 | (replace 'build
|
| 370 | (lambda* (#:key import-path #:allow-other-keys)
|
| 371 | (with-directory-excursion (string-append "src/" import-path)
|
| 372 | (invoke "make"))))
|
| 373 | (add-before 'check 'pre-check
|
| 374 | (lambda _
|
| 375 | (setenv "HOME" "/tmp")))
|
| 376 | (replace 'install
|
| 377 | (lambda* (#:key import-path #:allow-other-keys)
|
| 378 | (with-directory-excursion (string-append "src/" import-path)
|
| 379 | (invoke "make" (string-append "PREFIX=" #$output)
|
| 380 | "install")))))))
|
| 381 | (native-inputs
|
| 382 | (list go-github-com-bitly-go-hostpool
|
| 383 | go-github-com-bitly-timer-metrics
|
| 384 | go-github-com-blang-semver
|
| 385 | go-github-com-bmizerany-perks-quantile
|
| 386 | go-github-com-burntsushi-toml
|
| 387 | go-github-com-davecgh-go-spew
|
| 388 | go-github-com-golang-snappy
|
| 389 | go-github-com-julienschmidt-httprouter
|
| 390 | go-github-com-mreiferson-go-options
|
| 391 | go-github-com-mreiferson-go-svc
|
| 392 | go-github-com-nsqio-go-diskqueue
|
| 393 | go-github-com-nsqio-go-nsq
|
| 394 | python-wrapper))
|
| 395 | (home-page "https://nsq.io")
|
| 396 | (synopsis "Realtime distributed messaging platform")
|
| 397 | (description
|
| 398 | "NSQ is a realtime distributed messaging platform designed to operate at
|
| 399 | scale, handling billions of messages per day.
|
| 400 |
|
| 401 | Key features:
|
| 402 | @itemize
|
| 403 | @item support distributed topologies without @acronym{SPOF, Single Point of
|
| 404 | Failure}
|
| 405 | @item scale horizontally (no brokers, seamlessly add more nodes to the
|
| 406 | cluster)
|
| 407 | @item low-latency push based message delivery (performance)
|
| 408 | @item combine load-balanced and multicast style message routing
|
| 409 | @item excel at both streaming (high-throughput) and job oriented
|
| 410 | (low-throughput) workloads
|
| 411 | @item primarily in-memory (beyond a high-water mark messages are transparently
|
| 412 | kept on disk)
|
| 413 | @item runtime discovery service for consumers to find producers (nsqlookupd)
|
| 414 | @item transport layer security (TLS)
|
| 415 | @item data format agnostic
|
| 416 | @item few dependencies (easy to deploy) and a sane, bounded, default
|
| 417 | configuration
|
| 418 | @item simple TCP protocol supporting client libraries in any language
|
| 419 | @item HTTP interface for stats, admin actions, and producers (no client
|
| 420 | library needed to publish)
|
| 421 | @item integrate with @acronym{StatsD, Stats aggregation Daemon} for realtime
|
| 422 | instrumentation
|
| 423 | @item robust cluster administration interface (nsqadmin)
|
| 424 | @end itemize")
|
| 425 | (license license:expat)))
|
| 426 |
|
| 427 | (define-public corosync
|
| 428 | (package
|
| 429 | (name "corosync")
|
| 430 | (version "3.1.10")
|
| 431 | (source (origin
|
| 432 | (method git-fetch)
|
| 433 | (uri (git-reference
|
| 434 | (url "https://github.com/corosync/corosync")
|
| 435 | (commit (string-append "v" version))))
|
| 436 | (file-name (git-file-name name version))
|
| 437 | (sha256
|
| 438 | (base32
|
| 439 | "12i9a3fgr0dwkb36iwqz8chxm1bc4pkkqcpl9bd7sng8f84g1hjm"))))
|
| 440 | (build-system gnu-build-system)
|
| 441 | (arguments
|
| 442 | (list #:configure-flags #~'("--disable-static")
|
| 443 | #:phases #~(modify-phases %standard-phases
|
| 444 | (add-before 'bootstrap 'fix-version-gen
|
| 445 | (lambda _
|
| 446 | (call-with-output-file ".tarball-version"
|
| 447 | (lambda (port)
|
| 448 | (display #$version port))))))))
|
| 449 | (native-inputs (list autoconf automake libtool pkg-config))
|
| 450 | (inputs (list kronosnet libqb))
|
| 451 | (home-page "https://corosync.github.io/corosync/")
|
| 452 | (synopsis
|
| 453 | "Group communication system for implementing High Availability in applications")
|
| 454 | (description
|
| 455 | "The Corosync Cluster Engine is a Group Communication System with additional
|
| 456 | features for implementing high availability within applications. The project
|
| 457 | provides four C Application Programming Interface features:
|
| 458 |
|
| 459 | @itemize
|
| 460 |
|
| 461 | @item A closed process group communication model with extended virtual synchrony
|
| 462 | guarantees for creating replicated state machines.
|
| 463 |
|
| 464 | @item A simple availability manager that restarts the application process when
|
| 465 | it has failed.
|
| 466 |
|
| 467 | @item A configuration and statistics in-memory database that provide the ability
|
| 468 | to set, retrieve, and receive change notifications of information.
|
| 469 |
|
| 470 | @item A quorum system that notifies applications when quorum is achieved or
|
| 471 | lost.
|
| 472 |
|
| 473 | @end itemize")
|
| 474 | (license (list license:bsd-0 license:gpl3+))))
|
| 475 |
|
| 476 | (define-public pacemaker
|
| 477 | (package
|
| 478 | (name "pacemaker")
|
| 479 | (version "2.1.10") |
| 480 | (source (origin
|
| 481 | (method git-fetch)
|
| 482 | (uri (git-reference
|
| 483 | (url "https://github.com/ClusterLabs/pacemaker")
|
| 484 | (commit (string-append "Pacemaker-" version))))
|
| 485 | (file-name (git-file-name name version))
|
| 486 | (sha256
|
| 487 | (base32
|
| 488 | "0b9d2i22ghyjarwi1c596q5mf7gj1k04k784hnmrd2d4x9hgv9ax"))))
|
| 489 | (build-system gnu-build-system)
|
| 490 | (arguments
|
| 491 | (list #:configure-flags #~(list "--with-corosync"
|
| 492 | "--disable-static"
|
| 493 | "--localstatedir=/var"
|
| 494 | (string-append "--with-initdir="
|
| 495 | #$output "/etc/init.d")
|
| 496 | (string-append "--with-ocfdir="
|
| 497 | #$output "/lib"))
|
| 498 | #:phases
|
| 499 | #~(modify-phases %standard-phases
|
| 500 | (add-before 'configure 'pre-configure
|
| 501 | (lambda _
|
| 502 | |
| 503 | (substitute* '("Makefile.am"
|
| 504 | "daemons/schedulerd/Makefile.am")
|
| 505 | (("install-exec-local:")
|
| 506 | "install-exec-local-disabled:")))))))
|
| 507 | (native-inputs (list autoconf
|
| 508 | automake
|
| 509 | cmocka
|
| 510 | gettext-minimal
|
| 511 | libtool
|
| 512 | pkg-config
|
| 513 | rsync
|
| 514 | util-linux
|
| 515 | valgrind/pinned))
|
| 516 | (inputs (list dbus
|
| 517 | corosync
|
| 518 | glib
|
| 519 | gnutls
|
| 520 | libqb
|
| 521 | libxml2
|
| 522 | libxslt
|
| 523 | python
|
| 524 | `(,util-linux "lib")))
|
| 525 | (home-page "https://www.clusterlabs.org/pacemaker/")
|
| 526 | (synopsis "Scalable High-Availability cluster resource manager")
|
| 527 | (description
|
| 528 | "Pacemaker is a high-availability cluster resource manager.
|
| 529 |
|
| 530 | It achieves maximum availability for your cluster services (a.k.a. resources) by
|
| 531 | detecting and recovering from node- and resource-level failures by making use of
|
| 532 | the messaging and membership capabilities provided by Corosync.
|
| 533 |
|
| 534 | It can do this for clusters of practically any size and comes with a powerful
|
| 535 | dependency model that allows the administrator to accurately express the
|
| 536 | relationships (both ordering and location) between the cluster resources.
|
| 537 |
|
| 538 | Virtually anything that can be scripted can be managed as part of a Pacemaker cluster.")
|
| 539 | (license (list license:cc-by4.0 license:gpl2+ license:lgpl2.1+))))
|
| 540 |
|
| 541 | (define-public rabbitmq
|
| 542 | (package
|
| 543 | (name "rabbitmq")
|
| 544 | (version "4.3.3")
|
| 545 | (source
|
| 546 | (origin
|
| 547 | (method url-fetch)
|
| 548 | (uri (string-append
|
| 549 | "https://github.com/rabbitmq/rabbitmq-server/releases/download/v"
|
| 550 | version "/rabbitmq-server-" version ".tar.xz"))
|
| 551 | (file-name (string-append name "-" version ".tar.xz"))
|
| 552 | (sha256
|
| 553 | (base32 "05xdsgnd2pzcw4w7jkcv05yx4hpqn23v7rlcv3xhjcc1hb31ha79"))
|
| 554 | (patches (search-patches "rabbitmq-defaults.patch"))))
|
| 555 | (build-system gnu-build-system)
|
| 556 | (arguments
|
| 557 | (list
|
| 558 | |
| 559 | #:parallel-build? #f
|
| 560 | |
| 561 | |
| 562 | |
| 563 | |
| 564 | |
| 565 | |
| 566 | #:tests? #f
|
| 567 | #:make-flags
|
| 568 | #~(list (string-append "RMQ_ROOTDIR="
|
| 569 | #$output)
|
| 570 | (string-append "RABBITMQ_VERSION="
|
| 571 | #$version))
|
| 572 | #:phases
|
| 573 | #~(let ((rabbitmq-programs (list "rabbitmqctl"
|
| 574 | "rabbitmq-diagnostics"
|
| 575 | "rabbitmq-plugins"
|
| 576 | "rabbitmq-queues"
|
| 577 | "rabbitmq-server"
|
| 578 | "rabbitmq-streams"
|
| 579 | "rabbitmq-upgrade")))
|
| 580 | (modify-phases %standard-phases
|
| 581 | |
| 582 | |
| 583 | |
| 584 | |
| 585 | |
| 586 | |
| 587 | |
| 588 | |
| 589 | |
| 590 | |
| 591 | |
| 592 | |
| 593 | |
| 594 | |
| 595 | |
| 596 | (add-after 'unpack 'extract-rabbitmq-sources
|
| 597 | (lambda _
|
| 598 | (substitute* "erlang.mk"
|
| 599 | (("dir \\$\\(ELIXIR_BIN\\)")
|
| 600 | "shell dirname \\$\\(ELIXIR_BIN\\)"))))
|
| 601 | (add-after 'install 'wrap-rabbitmq
|
| 602 | (lambda* (#:key outputs inputs #:allow-other-keys)
|
| 603 | (let ((sbindir (string-append #$output "/lib/rabbitmq_server-"
|
| 604 | #$version "/sbin")))
|
| 605 | |
| 606 | (wrap-program (string-append sbindir "/rabbitmq-server")
|
| 607 | `("PATH" ":" prefix
|
| 608 | (,(dirname (search-input-file inputs "bin/getconf"))
|
| 609 | ,(dirname (search-input-file inputs "bin/df"))
|
| 610 | ,(dirname (search-input-file inputs "bin/erl")))))
|
| 611 | |
| 612 | |
| 613 | (for-each (lambda (prog)
|
| 614 | (wrap-program (string-append sbindir "/" prog)
|
| 615 | `("PATH" suffix
|
| 616 | (,(string-append #$erlang "/bin")))
|
| 617 | `("HOME" =
|
| 618 | ("/var/lib/rabbitmq"))))
|
| 619 | rabbitmq-programs))))
|
| 620 | (delete 'configure)
|
| 621 | (add-after 'install 'patch-scripts
|
| 622 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 623 | (substitute* (string-append #$output "/lib/rabbitmq_server-"
|
| 624 | #$version "/sbin/rabbitmq-env")
|
| 625 | (("basename")
|
| 626 | (which "basename"))
|
| 627 | (("dirname")
|
| 628 | (which "dirname"))
|
| 629 | (("readlink")
|
| 630 | (which "readlink")))))
|
| 631 | (add-after 'install 'install-bin
|
| 632 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 633 | (let ((target (string-append #$output "/sbin"))
|
| 634 | (sbindir (string-append #$output "/lib/rabbitmq_server-"
|
| 635 | #$version "/sbin")))
|
| 636 | (mkdir-p target)
|
| 637 | (for-each (lambda (prog)
|
| 638 | (symlink (string-append sbindir "/" prog)
|
| 639 | (string-append target "/" prog)))
|
| 640 | rabbitmq-programs))))
|
| 641 | (add-after 'install 'install-man
|
| 642 | (lambda _
|
| 643 | (invoke "make" "install-man"
|
| 644 | (string-append "PREFIX=" #$output))))))))
|
| 645 | (inputs (list bash-minimal))
|
| 646 | (native-inputs (list erlang elixir python-wrapper which p7zip))
|
| 647 | (synopsis
|
| 648 | "Messaging and streaming broker supporting multiple open protocols")
|
| 649 | (description
|
| 650 | "RabbitMQ is a messaging and streaming broker that supports multiple
|
| 651 | messaging protocols, including AMQP 1.0 and MQTT 5.0. It offers features
|
| 652 | such as message routing, filtering, streaming, federation, and clustering.
|
| 653 | It is designed for reliability and flexibility.")
|
| 654 | (home-page "https://www.rabbitmq.com/")
|
| 655 | (license license:asl2.0)))
|