Add debug statements in rpc-stream-map-sum example
[guile-orca] / guix.scm
1 ;;; Copyright (C) 2020  Ahmet Artu Yildirim
2 ;;;
3 ;;; orca is free software: you can redistribute it and/or modify
4 ;;; it under the terms of the GNU Lesser General Public License as
5 ;;; published by the Free Software Foundation, either version 3 of
6 ;;; the License, or (at your option) any later version.
7 ;;;
8 ;;; orca is distributed in the hope that it will be useful,
9 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 ;;; GNU Lesser General Public License for more details.
12 ;;;
13 ;;; You should have received a copy of the GNU Lesser General Public License
14 ;;; along with orca. If not, see <https://www.gnu.org/licenses/>.
15
16 (use-modules (ice-9 match)
17              (ice-9 popen)
18              (ice-9 rdelim)
19              (srfi srfi-1)
20              (srfi srfi-26)
21              (guix gexp)
22              (guix packages)
23              (guix licenses)
24              (guix git-download)
25              (guix build-system gnu)
26              ((guix build utils) #:select (with-directory-excursion))
27              (gnu packages)
28              (gnu packages autotools)
29              (gnu packages guile)
30              (gnu packages pkg-config)
31              (gnu packages geo)
32              (gnu packages texinfo))
33
34 (define %source-dir (dirname (current-filename)))
35
36 (define git-file?
37   (let* ((pipe (with-directory-excursion %source-dir
38                  (open-pipe* OPEN_READ "git" "ls-files")))
39          (files (let loop ((lines '()))
40                   (match (read-line pipe)
41                     ((? eof-object?)
42                      (reverse lines))
43                     (line
44                      (loop (cons line lines))))))
45          (status (close-pipe pipe)))
46     (lambda (file stat)
47       (match (stat:type stat)
48         ('directory #t)
49         ((or 'regular 'symlink)
50          (any (cut string-suffix? <> file) files))
51         (_ #f)))))
52
53 (package
54   (name "guile-orca")
55   (version "0.1.0")
56   (source (local-file %source-dir  #:recursive? #t #:select? git-file?))
57   (build-system gnu-build-system)
58   (arguments
59    '(#:configure-flags
60      (list (string-append "--with-libmpi-path=" (assoc-ref %build-inputs "libmpich") "libmpich.so"))
61      #:make-flags '("GUILE_AUTO_COMPILE=0")
62      #:phases
63      (modify-phases %standard-phases
64        (add-after 'unpack 'bootstrap
65          (lambda _ (zero? (system* "sh" "bootstrap")))))))
66   (native-inputs
67    `(("autoconf" ,autoconf)
68      ("automake" ,automake)
69      ("pkg-config" ,pkg-config)
70      ("texinfo" ,texinfo)))
71   (inputs
72    `(("guile" ,guile-2.2)
73      ("libmpich" ,libmpich)))
74
75   (synopsis "RPC library for Guile")
76   (description "Guile-orca library aims to provide Remote Procedure Call (RPC)
77     capabilities using Message Passing Interface (MPI).")
78   (home-page "https://github.com/ayild/guile-orca")
79   (license lgpl3+))