209 lines
7.7 KiB
Scheme
209 lines
7.7 KiB
Scheme
(use-modules
|
|
((guix licenses) #:prefix license:)
|
|
(guix packages)
|
|
(guix download)
|
|
(guix git-download)
|
|
(guix gexp)
|
|
(guix build-system cmake)
|
|
(guix build-system gnu)
|
|
(guix utils)
|
|
(gnu packages)
|
|
(gnu packages compression)
|
|
(gnu packages crypto)
|
|
(gnu packages curl)
|
|
(gnu packages databases)
|
|
(gnu packages gcc)
|
|
(gnu packages libidn)
|
|
(gnu packages linux)
|
|
(gnu packages python)
|
|
(gnu packages python-xyz)
|
|
(gnu packages readline)
|
|
(gnu packages version-control)
|
|
(gnu packages xml)
|
|
(ice-9 match)
|
|
(ice-9 rdelim)
|
|
(ice-9 popen)
|
|
(srfi srfi-26))
|
|
|
|
(define (sqlite-uri version year)
|
|
(let ((numeric-version
|
|
(match (string-split version #\.)
|
|
((first-digit other-digits ...)
|
|
(string-append first-digit
|
|
(string-pad-right
|
|
(string-concatenate
|
|
(map (cut string-pad <> 2 #\0)
|
|
other-digits))
|
|
6 #\0))))))
|
|
(string-append "https://sqlite.org/" (number->string year)
|
|
"/sqlite-autoconf-" numeric-version ".tar.gz")))
|
|
|
|
(define-public sqlite
|
|
(package
|
|
(name "sqlite")
|
|
(version "3.39.3")
|
|
(source (origin
|
|
(method url-fetch)
|
|
(uri (sqlite-uri version 2022))
|
|
(patches (search-patches "sqlite-hurd.patch"))
|
|
(sha256
|
|
(base32
|
|
"1f922kq16g7f4h3gpzim78lvrp5xw9nvlvqw97s2qgxyh8qgns3q"))))
|
|
(build-system gnu-build-system)
|
|
(inputs (list readline))
|
|
(outputs '("out" "static"))
|
|
(arguments
|
|
`(#:configure-flags
|
|
;; Add -DSQLITE_SECURE_DELETE, -DSQLITE_ENABLE_FTS3,
|
|
;; -DSQLITE_ENABLE_UNLOCK_NOTIFY and -DSQLITE_ENABLE_DBSTAT_VTAB
|
|
;; to CFLAGS. GNU Icecat will refuse to use the system SQLite
|
|
;; unless these options are enabled.
|
|
(list (string-append "CFLAGS=-O2 -g -DSQLITE_SECURE_DELETE "
|
|
"-DSQLITE_ENABLE_FTS3 "
|
|
"-DSQLITE_ENABLE_UNLOCK_NOTIFY "
|
|
"-DSQLITE_ENABLE_DBSTAT_VTAB "
|
|
;; Column metadata is required by GNU Jami and Qt, et.al.
|
|
"-DSQLITE_ENABLE_COLUMN_METADATA"))
|
|
#:phases (modify-phases %standard-phases
|
|
(add-after 'install 'move-static-library
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
(let* ((out (assoc-ref outputs "out"))
|
|
(static (assoc-ref outputs "static"))
|
|
(source (string-append out "/lib/libsqlite3.a")))
|
|
(mkdir-p (string-append static "/lib"))
|
|
(link source (string-append static "/lib/libsqlite3.a"))
|
|
(delete-file source)
|
|
|
|
;; Remove reference to the static library from the .la file
|
|
;; so that Libtool looks for it in the usual places.
|
|
(substitute* (string-append out "/lib/libsqlite3.la")
|
|
(("^old_library=.*")
|
|
"old_library=''\n"))
|
|
#t))))))
|
|
(home-page "https://www.sqlite.org/")
|
|
(synopsis "The SQLite database management system")
|
|
(description
|
|
"SQLite is a software library that implements a self-contained, serverless,
|
|
zero-configuration, transactional SQL database engine. SQLite is the most
|
|
widely deployed SQL database engine in the world. The source code for SQLite
|
|
is in the public domain.")
|
|
(license license:public-domain)))
|
|
|
|
(define-public botan
|
|
(package
|
|
(name "botan")
|
|
(version "3.9.0")
|
|
(source (origin
|
|
(method git-fetch)
|
|
(uri (git-reference
|
|
(url "https://github.com/randombit/botan/")
|
|
(commit version)))
|
|
(file-name (git-file-name name version))
|
|
(sha256
|
|
(base32
|
|
"1k5dyn39b77bfawly2yms0crbkn6g7msh16q7bxnh7dra4cnkmsn"))))
|
|
(build-system gnu-build-system)
|
|
(arguments
|
|
(list
|
|
#:phases
|
|
#~(modify-phases %standard-phases
|
|
(replace 'configure
|
|
(lambda* (#:key inputs outputs #:allow-other-keys)
|
|
;; Upstream tests and benchmarks with -O3.
|
|
(setenv "CXXFLAGS" "-O3")
|
|
(invoke "python" "./configure.py"
|
|
(string-append "--prefix=" #$output)
|
|
"--disable-static"
|
|
|
|
;; Otherwise, the `botan` executable cannot find
|
|
;; libbotan.
|
|
(string-append "--ldflags=-Wl,-rpath=" #$output "/lib")
|
|
|
|
"--with-os-feature=getentropy"
|
|
"--with-rst2man"
|
|
|
|
;; Recommended by upstream
|
|
"--with-zlib" "--with-bzip2" "--with-sqlite3")))
|
|
(add-before 'check 'library-path-for-tests
|
|
(lambda _ (setenv "LD_LIBRARY_PATH" (getcwd))))
|
|
(replace 'check
|
|
(lambda* (#:key tests? #:allow-other-keys)
|
|
(when tests?
|
|
(invoke "./botan-test")))))))
|
|
(native-inputs (list python-wrapper python-docutils gcc-12))
|
|
(inputs (list sqlite bzip2 zlib))
|
|
(synopsis "Cryptographic library in C++11")
|
|
(description "Botan is a cryptography library, written in C++11, offering
|
|
the tools necessary to implement a range of practical systems, such as TLS/DTLS,
|
|
PKIX certificate handling, PKCS#11 and TPM hardware support, password hashing,
|
|
and post-quantum crypto schemes. In addition to the C++, botan has a C89 API
|
|
specifically designed to be easy to call from other languages. A Python binding
|
|
using ctypes is included, and several other language bindings are available.")
|
|
(home-page "https://botan.randombit.net")
|
|
(license license:bsd-2)))
|
|
|
|
;;;;
|
|
|
|
(define %source-dir (dirname (current-filename)))
|
|
(define %git-dir (string-append %source-dir "/.git"))
|
|
|
|
; double-escaped template of the biboumi sexp
|
|
; This allows us to bake the expression without doing a full eval to a record,
|
|
; so it can be written
|
|
(define-public biboumi-template
|
|
'(package
|
|
(name "biboumi")
|
|
(version (read-line (open-pipe* OPEN_READ "git" "--git-dir" %git-dir "describe" "--always" "--dirty")))
|
|
(source
|
|
`(origin
|
|
(method git-fetch)
|
|
(uri (git-reference
|
|
(recursive? #t)
|
|
(url "https://git.singpolyma.net/biboumi")
|
|
(commit ,(read-line (open-pipe* OPEN_READ "git" "--git-dir" %git-dir "rev-parse" "HEAD")))))
|
|
(file-name (git-file-name name version))
|
|
(sha256
|
|
(base32
|
|
,(read-line (open-pipe* OPEN_READ "guix" "hash" "-rx" %source-dir))))))
|
|
(build-system 'cmake-build-system)
|
|
(arguments
|
|
'`(#:tests? #f
|
|
#:phases
|
|
(modify-phases %standard-phases
|
|
(add-after 'unpack 'fix-etc-reference
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
(substitute* "CMakeLists.txt"
|
|
((".etc.biboumi") (string-append (assoc-ref outputs "out") "/etc/biboumi"))))))))
|
|
(native-inputs
|
|
'(list
|
|
gcc-12))
|
|
(inputs
|
|
'(list
|
|
botan
|
|
curl
|
|
expat
|
|
git
|
|
libidn2
|
|
postgresql
|
|
python
|
|
sqlite
|
|
`(,util-linux "lib")))
|
|
(home-page "https://git.singpolyma.net/biboumi")
|
|
(synopsis "XMPP to IRC bridge")
|
|
(description "")
|
|
(license 'license:bsd-3)))
|
|
|
|
; Baked version of jmp-pay-template with leaves eval'd
|
|
(define-public biboumi-baked
|
|
(cons
|
|
(car biboumi-template)
|
|
(map
|
|
(lambda (x) (list (car x) (eval (cadr x) (current-module))))
|
|
(cdr biboumi-template))))
|
|
|
|
; Build clean from git the version from a local clone
|
|
; To build whatever is sitting in local use:
|
|
; guix build --with-source=$PWD -f guix.scm
|
|
|
|
(eval biboumi-baked (current-module))
|