gnu: Add cl-ana.statistical-learning.
[jackhill/guix/guix.git] / gnu / packages / swig.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 (define-module (gnu packages swig)
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix licenses)
25 #:use-module (guix build-system gnu)
26 #:use-module (gnu packages)
27 #:use-module (gnu packages pcre)
28 #:use-module (gnu packages guile)
29 #:use-module (gnu packages boost)
30 #:use-module (gnu packages python)
31 #:use-module (gnu packages perl))
32
33 (define-public swig
34 (package
35 (name "swig")
36 (version "3.0.12")
37 (source (origin
38 (method url-fetch)
39 (uri (string-append "mirror://sourceforge/" name "/" name "/"
40 name "-" version "/"
41 name "-" version ".tar.gz"))
42 (patches (search-patches "swig-guile-gc.patch"))
43 (sha256
44 (base32
45 "0kf99ygrjs5616gsqhz1l7bib3a12izmxi7g48bwblbymr3z9ybw"))))
46 (build-system gnu-build-system)
47 (arguments
48 '(#:phases
49 (modify-phases %standard-phases
50 (add-after 'unpack 'set-env
51 ;; Required since Perl 5.26.0's removal of the current
52 ;; working directory from @INC.
53 ;; TODO Try removing this for later versions of SWIG.
54 (lambda _ (setenv "PERL_USE_UNSAFE_INC" "1") #t))
55 (add-before 'configure 'workaround-gcc-bug
56 (lambda _
57 ;; XXX: Don't add the -isystem flag, or GCCs #include_next
58 ;; won't be able to find <stdlib.h>.
59 (substitute* "configure"
60 (("-isystem ") "-I"))
61 #t)))))
62 (native-inputs `(("boost" ,boost)
63 ("pcre" ,pcre "bin"))) ;for 'pcre-config'
64 (inputs `(;; Provide these to run the corresponding tests.
65 ("guile" ,guile-2.0)
66 ("perl" ,perl)))
67 ;; FIXME: reactivate input python as soon as the test failures
68 ;; fatal error: Python.h: No such file or directory
69 ;; # include <Python.h>
70 ;; are fixed.
71 ;; The python part probably never worked and does not seem to
72 ;; be needed for currently dependent packages.
73 ;; ("python" ,python-wrapper)))
74 (home-page "http://swig.org/")
75 (synopsis
76 "Interface compiler that connects C/C++ code to higher-level languages")
77 (description
78 "SWIG is an interface compiler that connects programs written in C and
79 C++ with languages such as Perl, Python, Ruby, Scheme, and Tcl. It works by
80 taking the declarations found in C/C++ header files and using them to generate
81 the wrapper code that scripting languages need to access the underlying C/C++
82 code. In addition, SWIG provides a variety of customization features that let
83 you tailor the wrapping process to suit your application.")
84
85 ;; See http://www.swig.org/Release/LICENSE for details.
86 (license gpl3+)))