mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-01-31 06:46:50 +01:00
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:
parent
2970b2af4a
commit
e7ce9baeae
1 changed files with 41 additions and 0 deletions
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue