gnu: Add go-github-com-johncgriffin-overflow.

* gnu/packages/golang-maths.scm (go-github-com-johncgriffin-overflow): New variable.

Change-Id: I885f4eefbeaf0e41b7add3e6469a0192d2950482
This commit is contained in:
Sharlatan Hellseher 2025-01-02 19:53:13 +00:00
parent 2970b2af4a
commit e7ce9baeae
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5

View file

@ -115,6 +115,47 @@ (define-public go-github-com-cockroachdb-apd-v3
(list
#:import-path "github.com/cockroachdb/apd/v3"))))
(define-public go-github-com-johncgriffin-overflow
(package
(name "go-github-com-johncgriffin-overflow")
(version "0.0.0-20211019200055-46fa312c352c")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/JohnCGriffin/overflow")
(commit (go-version->git-ref version))))
(file-name (git-file-name name version))
(sha256
(base32 "1g4sfhdmzjl5vr16lfv7nv042w8dbz608bwzyvf7xlw4i7ypjjpq"))))
(build-system go-build-system)
(arguments
(list
#:import-path "github.com/JohnCGriffin/overflow"
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'generate-impl
;; Note that because Go has no template types, the majority of
;; repetitive code is generated by overflow_template.sh. If you
;; have to change an algorithm, change it there and regenerate the
;; Go code.
(lambda* (#:key import-path #:allow-other-keys)
(with-directory-excursion (string-append "src/" import-path)
(substitute* "overflow_template.sh"
(("/bin/sh") (which "sh")))
(make-file-writable "overflow_impl.go")
(invoke "./overflow_template.sh")
(invoke "go" "generate")))))))
(home-page "https://github.com/JohnCGriffin/overflow")
(synopsis "Check for int/int64/int32 arithmetic overflow in Golang")
(description
"This package offers overflow-checked integer arithmetic operations for
@code{int},@code{int32}, and @code{int64}. Each of the operations returns a
@code{result,bool} combination. This was prompted by the need to know when to
flow into higher precision types from the @code{math.big} library.")
;; It's in README, see <https://github.com/JohnCGriffin/overflow/pull/5>.
(license license:expat)))
(define-public go-github-com-montanaflynn-stats
(package
(name "go-github-com-montanaflynn-stats")