~singpolyma/biboumi

11bbc5defff987c1d4fe7c96540431286782aca8 — Stephen Paul Weber 2 months ago f6d336e master
Guixify
1 files changed, 77 insertions(+), 0 deletions(-)

A guix.scm
A guix.scm => guix.scm +77 -0
@@ 0,0 1,77 @@
(use-modules
  ((guix licenses) #:prefix license:)
  (guix packages)
  (guix download)
  (guix git-download)
  (guix build-system cmake)
  (gnu packages crypto)
  (gnu packages databases)
  (gnu packages libidn)
  (gnu packages linux)
  (gnu packages python)
  (gnu packages sqlite)
  (gnu packages version-control)
  (gnu packages xml)
  (ice-9 rdelim)
  (ice-9 popen))

;;;;

(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"))))))))
    (inputs
      '(list
        botan
        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))