exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

taler-exchange.scm (4725B)


      1 ;;; This file is part of GNU Taler.
      2 ;;; Copyright (C) 2018 GNUnet e.V.
      3 ;;;
      4 ;;; GNU Taler is free software: you can redistribute it and/or modify it
      5 ;;; under the terms of the GNU Affero General Public License as published
      6 ;;; by the Free Software Foundation, either version 3 of the License,
      7 ;;; or (at your option) any later version.
      8 ;;;
      9 ;;; GNU Taler is distributed in the hope that it will be useful, but
     10 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
     11 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     12 ;;; Affero General Public License for more details.
     13 ;;;
     14 ;;; You should have received a copy of the GNU Affero General Public License
     15 ;;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
     16 
     17 
     18 (define-module (gnu packages taler-exchange)
     19   #:use-module (ice-9 popen)
     20   #:use-module (ice-9 rdelim)
     21   #:use-module (gnu packages)
     22   #:use-module (gnu packages aidc)
     23   #:use-module (gnu packages autotools)
     24   #:use-module (gnu packages backup)
     25   #:use-module (gnu packages base)
     26   #:use-module (gnu packages compression)
     27   #:use-module (gnu packages curl)
     28   #:use-module (gnu packages databases)
     29   #:use-module (gnu packages file)
     30   #:use-module (gnu packages gettext)
     31   #:use-module (gnu packages glib)
     32   #:use-module (gnu packages gnome)
     33   #:use-module (gnu packages gnunet)
     34   #:use-module (gnu packages gnupg)
     35   #:use-module (gnu packages groff)
     36   #:use-module (gnu packages gstreamer)
     37   #:use-module (gnu packages gtk)
     38   #:use-module (gnu packages guile)
     39   #:use-module (gnu packages image)
     40   #:use-module (gnu packages libidn)
     41   #:use-module (gnu packages libunistring)
     42   #:use-module (gnu packages linux)
     43   #:use-module (gnu packages maths)
     44   #:use-module (gnu packages multiprecision)
     45   #:use-module (gnu packages music)
     46   #:use-module (gnu packages ncurses)
     47   #:use-module (gnu packages nettle)
     48   #:use-module (gnu packages package-management)
     49   #:use-module (gnu packages perl)
     50   #:use-module (gnu packages pkg-config)
     51   #:use-module (gnu packages pulseaudio)
     52   #:use-module (gnu packages python)
     53   #:use-module (gnu packages texinfo)
     54   #:use-module (gnu packages tls)
     55   #:use-module (gnu packages video)
     56   #:use-module (gnu packages web)
     57   #:use-module (gnu packages xiph)
     58   #:use-module ((guix licenses) #:prefix license:)
     59   #:use-module ((guix build utils) #:prefix build-utils:)
     60   #:use-module (guix packages)
     61   #:use-module (guix download)
     62   #:use-module (guix utils)
     63   #:use-module (guix gexp)
     64   #:use-module (guix git-download)
     65   #:use-module (guix build-system gnu))
     66 
     67 (define (repeat f n)
     68   (if (= n 1)
     69       f
     70       (lambda (x) (f ((repeat f (- n 1)) x)))))
     71 
     72 (define %source-dir ((repeat dirname 5) (current-filename)))
     73 
     74 (define (git-output . args)
     75   "Execute 'git ARGS ...' command and return its output without trailing
     76 newspace."
     77   (build-utils:with-directory-excursion %source-dir
     78     (let* ((port   (apply open-pipe* OPEN_READ "git" args))
     79            (output (read-string port)))
     80       (close-port port)
     81       (string-trim-right output #\newline))))
     82 
     83 (define (current-git-version)
     84   (git-output "describe" "--tags"))
     85 
     86 (define (git-sources)
     87   (local-file %source-dir
     88 	      #:recursive? #t
     89 	      #:select? (git-predicate %source-dir)))
     90 
     91 (define-public taler-exchange
     92   (package
     93    (name "taler-exchange")
     94    (version (current-git-version))
     95    (source (git-sources))
     96    (build-system gnu-build-system)
     97    (inputs
     98     `(("gnurl" ,gnurl)
     99       ("libgcrypt" ,libgcrypt)
    100       ("libmicrohttpd" ,libmicrohttpd)
    101       ("libltdl" ,libltdl)
    102       ("jansson" ,jansson)
    103       ("gnunet" ,gnunet)
    104       ("zlib" ,zlib)
    105       ("perl" ,perl)
    106       ("nettle" ,nettle) ; only needed for gnurl detection (FIXME!)
    107       ("libidn2" ,libidn2) ; only needed for gnurl detection (FIXME!)
    108       ("gnutls" ,gnutls) ; only needed for gnurl detection (FIXME!)
    109       ("postgresql" ,postgresql)))
    110    (native-inputs
    111     `(("pkg-config" ,pkg-config)
    112       ("autoconf" ,autoconf)
    113       ("automake" ,automake)
    114       ("gnu-gettext" ,gnu-gettext)
    115       ("which" ,which)
    116       ("texinfo" ,texinfo-5) ; Debian stable: 5.2
    117       ("libtool" ,libtool)))
    118    (arguments
    119     '(#:parallel-tests? #f
    120       #:tests? #f
    121       #:phases
    122       (modify-phases %standard-phases
    123         ;(add-after 'install 'fail
    124         ;  (lambda _
    125 	;    (invoke "false")))
    126         (add-after 'unpack 'patch-bin-sh
    127           (lambda _
    128             (for-each (lambda (f) (chmod f #o755))
    129                       (find-files "po" ""))
    130             #t))
    131         (add-after 'install 'check
    132           (assoc-ref %standard-phases 'check))
    133         (delete 'check))))
    134    (synopsis "GNU Taler exchange")
    135    (description "GNU Taler is an electronic payment system")
    136    (license license:agpl3+)
    137    (home-page "https://taler.net/")))