aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014 John Darrington <jmd@gnu.org>
;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2015 David Hashe <david.hashe@dhashe.com>
;;; Copyright © 2015, 2016, 2020 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
;;; Copyright © 2016 Francesco Frassinelli <fraph24@gmail.com>
;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
;;; Copyright © 2017, 2018, 2023 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2017, 2018, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017 Adonay Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@hyperbola.info>
;;; Copyright © 2018 Jovany Leandro G.C <bit4bit@riseup.net>
;;; Copyright © 2018 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
;;; Copyright © 2019 Jan Wielkiewicz <tona_kosmicznego_smiecia@interia.pl>
;;; Copyright © 2019, 2024 Ivan Vilata i Balaguer <ivan@selidor.net>
;;; Copyright © 2020 Brett Gilio <brettg@gnu.org>
;;; Copyright © 2020, 2022 Michael Rohleder <mike@rohleder.de>
;;; Copyright © 2020 Raghav Gururajan <raghavgururajan@disroot.org>
;;; Copyright © 2020, 2021, 2022, 2023, 2024 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
;;; Copyright © 2021 LibreMiami <packaging-guix@libremiami.org>
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
;;; Copyright © 2021 Demis Balbach <db@minikn.xyz>
;;; Copyright © 2022 Thomas Albers Raviola <thomas@thomaslabs.org>
;;; Copyright © 2023 Ivan Gankevich <igankevich@capybaramail.xyz>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages telephony)
  #:use-module (guix gexp)
  #:use-module (gnu packages)
  #:use-module (gnu packages admin)
  #:use-module (gnu packages algebra)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages avahi)
  #:use-module (gnu packages audio)
  #:use-module (gnu packages base)
  #:use-module (gnu packages boost)
  #:use-module (gnu packages check)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages cpp)
  #:use-module (gnu packages databases)
  #:use-module (gnu packages sqlite)
  #:use-module (gnu packages docbook)
  #:use-module (gnu packages documentation)
  #:use-module (gnu packages file)
  #:use-module (gnu packages protobuf)
  #:use-module (gnu packages gl)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages gnupg)
  #:use-module (gnu packages image)
  #:use-module (gnu packages libusb)
  #:use-module (gnu packages linphone)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages maths)
  #:use-module (gnu packages multiprecision)
  #:use-module (gnu packages ncurses)
  #:use-module (gnu packages netpbm)
  #:use-module (gnu packages networking)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages pulseaudio)
  #:use-module (gnu packages python)
  #:use-module (gnu packages qt)
  #:use-module (gnu packages samba)
  #:use-module (gnu packages security-token)
  #:use-module (gnu packages speech)
  #:use-module (gnu packages tls)
  #:use-module (gnu packages xiph)
  #:use-module (gnu packages xorg)
  #:use-module (gnu packages xml)
  #:use-module (gnu packages readline)
  #:use-module (gnu packages bison)
  #:use-module (gnu packages flex)
  #:use-module (gnu packages libevent)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix utils)
  #:use-module (guix packages)
  #:use-module (guix gexp)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix build-system cmake)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system meson)
  #:use-module (guix build-system qt))

(define-public phonesim
  (package
    (name "phonesim")
    (version "1.21")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://git.kernel.org/pub/scm/network/ofono/phonesim")
             (commit "a7c844d45b047b2dae5b0877816c346fce4c47b9")))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0rc1c2vr03dmi1dr3skj57v77ga9c22g29xs1qiphqms4isby9cq"))))
    (build-system gnu-build-system)
    (arguments
     `(#:configure-flags
       (list "--enable-maintainer-mode"
             "CC=" ,(cc-for-target))))
    (native-inputs
     (list automake autoconf pkg-config))
    (inputs
     (list qtbase-5 qtdeclarative-5))
    (synopsis "Phone Simulator for modem testing")
    (description
     "Phonesim is a modem emulator that oFono uses for development and
testing.  This allows oFono to be used by any host without requiring special
GSM (or other) hardware.")
    (home-page "https://git.kernel.org/pub/scm/network/ofono/phonesim")
    (license license:gpl2+)))

(define-public libilbc
  (package
    (name "libilbc")
    (version "2.0.2")
    (source
     (origin
       (method git-fetch)
       (uri
        (git-reference
         (url "https://github.com/TimothyGu/libilbc")
         (commit
          (string-append "v" version))))
       (file-name
        (git-file-name name version))
       (sha256
        (base32
         "1j1pn1w1198qvdiq2hgv9hkyq2nqcvmfnwlgppac633idkjnjrqx"))))
    (build-system cmake-build-system)
    (arguments
     `(#:tests? #f))                    ; No target
    (native-inputs
     (list pkg-config))
    (synopsis "Libre iLBC codec")
    (description "LibiLBC is a packaging friendly copy of the iLBC codec from
the WebRTC project.  It provides a base for distribution packages and can be
used as drop-in replacement for the non-free code from RFC 3591.")
    (home-page "https://github.com/TimothyGu/libilbc")
    (license license:bsd-3)))

(define-public spandsp
  (package
    (name "spandsp")
    (version "0.0.6")
    (source
     (origin
       (method url-fetch)
       (uri
        ;; The original upstream has been down since the end of March 2020.
        (string-append "https://web.archive.org/web/20180626203108/"
                       "https://www.soft-switch.org/downloads/" name "/"
                       name "-" version ".tar.gz"))
       (sha256
        (base32 "0rclrkyspzk575v8fslzjpgp4y2s4x7xk3r55ycvpi4agv33l1fc"))))
    (build-system gnu-build-system)
    (outputs '("out" "doc" "static"))   ;doc contains HTML documentation
    (arguments
     `(#:configure-flags '("--enable-doc=yes" "--enable-tests=yes")
       #:parallel-build? #f ;non-deterministic build failures may occur otherwise
       #:parallel-tests? #f ;fails removing the same the files twice otherwise
       #:phases (modify-phases %standard-phases
                  (add-after 'unpack 'patch-configure.ac
                    (lambda _
                      ;; spandsp looks at hard coded locations of the FHS to
                      ;; find libxml2.
                      (substitute* "configure.ac"
                        (("AC_MSG_CHECKING\\(for libxml/xmlmemory\\.h.*" all)
                         (string-append all
                                        "PKG_CHECK_MODULES(XML2, libxml-2.0)\n"
                                        "CPPFLAGS+=\" $XML2_CFLAGS\"\n")))
                      ;; Force a regeneration of the autotools build system.
                      (delete-file "autogen.sh")
                      (delete-file "configure")
                      #t))
                  (add-after 'unpack 'do-not-install-data-files
                    ;; The .tiff images produced for tests are not
                    ;; reproducible and it is not desirable to have those
                    ;; distributed.
                    (lambda _
                      (substitute* '("test-data/itu/fax/Makefile.am"
                                     "test-data/etsi/fax/Makefile.am")
                        (("nobase_data_DATA")
                         "noinst_DATA"))
                      #t))
                  (add-after 'install 'install-doc
                    (lambda* (#:key outputs #:allow-other-keys)
                      (let ((doc (string-append (assoc-ref outputs "doc")
                                                "/share/doc/" ,name "-" ,version)))
                        (copy-recursively "doc/t38_manual" doc)
                        #t)))
                  (add-after 'install 'move-static-libraries
                    (lambda* (#:key outputs #:allow-other-keys)
                      (let ((out (assoc-ref outputs "out"))
                            (static (assoc-ref outputs "static")))
                        (mkdir-p (string-append static "/lib"))
                        (with-directory-excursion out
                          (for-each (lambda (file)
                                      (rename-file file
                                                   (string-append static "/"
                                                                  file)))
                                    (find-files "lib" "\\.a$")))
                        #t))))))
    (native-inputs
     `(("autoconf" ,autoconf)
       ("automake" ,automake)
       ("libtool" ,libtool)
       ("pkg-config" ,pkg-config)
       ;; For the tests
       ("fftw" ,fftw)
       ("libpcap" ,libpcap)
       ("libsndfile" ,libsndfile)
       ("libjpeg" ,libjpeg-turbo)      ;XXX: should be propagated from libtiff
       ("libtiff" ,libtiff)
       ("netpbm" ,netpbm)
       ("sox" ,sox)
       ;; For the documentation
       ("docbook-xml" ,docbook-xml-4.3)
       ("docbook-xsl" ,docbook-xsl)
       ("doxygen" ,doxygen)
       ("libxml2" ,libxml2)
       ("libxslt" ,libxslt)))
    (synopsis "DSP library for telephony")
    (description "SpanDSP is a library of DSP functions for telephony, in the
8000 sample per second world of E1s, T1s, and higher order PCM channels.  It
contains low level functions, such as basic filters.  It also contains higher
level functions, such as cadenced supervisory tone detection, and a complete
software FAX machine.")
    (home-page "https://web.archive.org/web/20180626203108/\
https://www.soft-switch.org/index.html")
    (license (list license:lgpl2.1+  ;for the library
                   license:gpl2+)))) ;for the test suites and support programs

(define-public commoncpp
  (package
   (name "commoncpp")
   (version "1.8.1")
   (source (origin
            (method url-fetch)
            (uri (string-append "mirror://gnu/" name "/commoncpp2-"
                   version ".tar.gz"))
            (sha256 (base32
                     "0kmgr5w3b1qwzxnsnw94q6rqs0hr8nbv9clf07ca2a2fyypx9kjk"))))
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-before 'configure 'pre-configure
           (lambda _
             (substitute* "src/applog.cpp"
               (("^// TODO sc.*") "#include <sys/types.h>\n#include <sys/stat.h>\n"))
             #t)))))
   (build-system gnu-build-system)
   (synopsis "(u)Common C++ framework for threaded applications")
   (description "GNU Common C++ is an portable, optimized class framework for
threaded applications, supporting concurrent synchronization, inter-process
communications via sockets, and various methods for data handling, such as
serialization and XML parsing.  It includes the uCommon C++ library, a smaller
reimplementation.")
   (license license:gpl2+) ; plus runtime exception
   (properties '((ftp-directory . "/gnu/commoncpp")
                 (upstream-name . "commoncpp2")))
   (home-page "https://www.gnu.org/software/commoncpp/")))

(define-public ucommon
  (package
   (name "ucommon")
   (version "7.0.0")
   (source (origin
            (method url-fetch)
            (uri (string-append "mirror://gnu/commoncpp/" name "-"
                   version ".tar.gz"))
            (sha256 (base32
                     "1mv080rvrhyxyhgqiqr8r9jdqhg3xhfawjvfj5zgj47h59nggjba"))))
   (build-system gnu-build-system)
   (arguments
    ;; Does not work with std=c++17, which is the default in modern GCC versions.
    `(#:configure-flags '("CXXFLAGS=-std=c++14")))
   (inputs (list gnutls))
   (synopsis "Common C++ framework for threaded applications")
   (description "GNU uCommon C++ is meant as a very light-weight C++ library
to facilitate using C++ design patterns even for very deeply embedded
applications, such as for systems using uclibc along with posix threading
support.")
   (license license:gpl3+)
   (home-page "https://www.gnu.org/software/commoncpp/")
   (properties '((ftp-directory . "/gnu/commoncpp")))))

(define-public ccrtp
  (package
   (name "ccrtp")
   (version "2.1.2")
   (source (origin
            (method url-fetch)
            (uri (string-append "mirror://gnu/ccrtp/ccrtp-"
                   version ".tar.gz"))
            (sha256 (base32
                     "17ili8l7zqbbkzr1rcy4hlnazkf50mds41wg6n7bfdsx3c7cldgh"))))
   (build-system gnu-build-system)
   (inputs (list ucommon libgcrypt))
   (native-inputs (list pkg-config))
   (synopsis "Implementation of RTP (real-time transport protocol)")
   (description  "GNU ccRTP is an implementation of RTP, the real-time transport
protocol from the IETF.  It is suitable both for high capacity servers and
personal client applications.  It is flexible in its design, allowing it to
function as a framework for the framework, rather than just being a
packet-manipulation library.")
   (license license:gpl2+) ; plus runtime exception
   (home-page "https://www.gnu.org/software/ccrtp/")))

(define-public zrtpcpp
  (package
    (name "zrtpcpp")
    (version "4.6.6")
    (source
     (origin
       (method git-fetch)
       (uri
        (git-reference
         (url "https://github.com/wernerd/ZRTPCPP")
         (commit
          (string-append "V" version))))
       (file-name
        (git-file-name name version))
       (sha256
        (base32
         "06vphvh4dgi7ah5qkq53wqvswv8l273x0xwbc447qmgvamm0x1vs"))))
    (build-system cmake-build-system)
    (arguments
     `(#:tests? #f))                    ; No target
    (native-inputs
     (list pkg-config))
    (inputs
     (list ccrtp ucommon))
    (synopsis "C++ Implementation of ZRTP protocol")
    (description  "GNU ZRTP C++ provides a library that adds ZRTP support to the
GNU ccRTP stack and serves as library for other RTP stacks
(PJSIP, GStreamer).")
    (home-page "https://www.gnu.org/software/ccrtp/zrtp")
    (license license:lgpl3+)))

(define-public osip
  (package
   (name "osip")
   (version "5.3.1")
   (source (origin
            (method url-fetch)
            (uri (string-append "mirror://gnu/osip/libosip2-" version ".tar.gz"))
            (sha256
             (base32
              "0yfwd8g2nxf3i9d8gqh6a16ma350dlhih4awbb0nl9h82s2gx0py"))))
   (build-system gnu-build-system)

   (synopsis "Library implementing SIP (RFC-3261)")
   (description "GNU oSIP is an implementation of the SIP protocol.  It is
used to provide multimedia and telecom software developers with an interface
to initiate and control SIP sessions.")
   (license license:lgpl2.1+)
   (properties '((ftp-directory . "/gnu/osip")
                 (upstream-name . "libosip2")))
   (home-page "https://www.gnu.org/software/osip/")))

(define-public exosip
  (package
   (name "exosip")
   (version "5.3.0")
   (source (origin
            (method url-fetch)
            (uri (string-append "mirror://savannah/exosip/libexosip2-"
                                version ".tar.gz"))
            (sha256 (base32
                     "1hn9xgy8ny04hjqd1rra7c4nz5nf9abdd5ghr7nmrsiicjc26y2v"))))
   (build-system gnu-build-system)
   (inputs (list osip))
   (synopsis "Sip abstraction library")
   (description "EXosip is a library that hides the complexity of using the
SIP protocol for multimedia session establishment.  This protocol is mainly to
be used by VoIP telephony applications (endpoints or conference server) but
might be also useful for any application that wish to establish sessions like
multiplayer games.")
   (license license:gpl2+)
   ;; (plus OpenSSL linking exception)
   ;; http://git.savannah.gnu.org/cgit/exosip.git/plain/LICENSE.OpenSSL
    (home-page "https://savannah.nongnu.org/projects/exosip")))

(define-public sipwitch
  (package
   (name "sipwitch")
   (version "1.9.15")
   (source (origin
            (method url-fetch)
            (uri (string-append "mirror://gnu/sipwitch/sipwitch-"
                   version ".tar.gz"))
            (sha256 (base32
                     "10lli9c703d7qbarzc0lgmz963ppncvnrklwrnri0s1zcmmahyia"))
            (patches
             (search-patches "sipwitch-fix-build-with-exosip5.patch"))))
   (build-system gnu-build-system)
   ;; The configure.ac uses pkg-config but in a kludgy way which breaks when
   ;; cross-compiling.  Among other issues there the program name "pkg-config"
   ;; is hard coded instead of respecting the PKG_CONFIG environment variable.
   ;; Fortunately we can avoid the use of pkg-config and set the dependency
   ;; flags ourselves.
   (arguments `(#:configure-flags
                `("--without-pkg-config"
                  ,(string-append "UCOMMON_CFLAGS=-I"
                                  (assoc-ref %build-inputs "ucommon") "/include")
                  "UCOMMON_LIBS=-lusecure -lucommon -lrt -ldl -lpthread"
                  ,(string-append "LIBOSIP2_CFLAGS=-I"
                                  (assoc-ref %build-inputs "osip") "/include")
                  "LIBOSIP2_LIBS=-losipparser2 -losip2"
                  ,(string-append "--sysconfdir=" (assoc-ref %outputs "out")
                                  "/etc")
                  "EXOSIP2_LIBS=-leXosip2"
                  ,(string-append "EXOSIP2_CFLAGS=-I"
                                  (assoc-ref %build-inputs "exosip")
                                  "/include"))))
   (inputs (list ucommon exosip osip))
   (synopsis "Secure peer-to-peer VoIP server for the SIP protocol")
   (description "GNU SIP Witch is a peer-to-peer Voice-over-IP server that
uses the SIP protocol.  Calls can be made from behind NAT firewalls and
without the need for a service provider.  Its peer-to-peer design ensures that
there is no central point for media intercept or capture and thus it can be
used to construct a secure telephone system that operates over the public
internet.")
   (license license:gpl3+)
   (home-page "https://www.gnu.org/software/sipwitch/")))

(define-public libsrtp
  (package
    (name "libsrtp")
    (version "2.4.2")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                     (url "https://github.com/cisco/libsrtp")
                     (commit (string-append "v" version))))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "1gswpjm4jacfxmgglbf8hxi3yzsag4drk4q943p0wkmv21zj8l78"))))
    (native-inputs
     (list psmisc ;some tests require 'killall'
           procps))
    (build-system gnu-build-system)
    (arguments
     '(#:test-target "runtest"
       #:phases (modify-phases %standard-phases
                  (add-after 'build 'build-shared
                    (lambda* (#:key (make-flags '()) #:allow-other-keys)
                      ;; Build the shared library separately because
                      ;; the test runner requires a static build.
                      (apply invoke "make" "shared_library" make-flags)
                      #t))
                  (add-after 'install 'remove-static-library
                    (lambda* (#:key outputs #:allow-other-keys)
                      (delete-file (string-append (assoc-ref outputs "out")
                                                  "/lib/libsrtp2.a"))
                      #t)))))
    (synopsis "Secure RTP (SRTP) Reference Implementation")
    (description
     "This package provides an implementation of the Secure Real-time Transport
Protocol (@dfn{SRTP}), the Universal Security Transform (@dfn{UST}), and a
supporting cryptographic kernel.")
    (home-page "https://github.com/cisco/libsrtp")
    (license license:bsd-3)))

(define-public libiax2
  (let ((commit "0e5980f1d78ce462e2d1ed6bc39ff35c8341f201"))
    ;; This is the commit used by the Ring Project.
    (package
      (name "libiax2")
      (version (string-append "0.0.0-1." (string-take commit 7)))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://gitlab.savoirfairelinux.com/sflphone/libiax2.git")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32
           "0d269474kk1933c55hx4azw3sak5ycfrxkw6ida0sb2cm00kfich"))))
      (build-system gnu-build-system)
      (native-inputs
       (list autoconf automake libtool))
      (home-page "https://gitlab.savoirfairelinux.com/sflphone/libiax2")
      (synopsis "Inter-Asterisk-Protocol library")
      (description "LibIAX2 implements the Inter-Asterisk-Protocol for relaying
Voice-over-IP (VoIP) communications.")
      ;; The file 'src/md5.c' is released into the public domain by RSA Data
      ;; Security.  The files 'src/answer.h', 'src/miniphone.c',
      ;; 'src/options.c', 'src/options.h', 'src/ring10.h', 'src/winiphone.c' are
      ;; covered under the 'GPL'.
      ;; The package as a whole is distributed under the LGPL 2.0.
      (license (list license:lgpl2.0
                     license:public-domain
                     license:gpl2+)))))

(define-public seren
  (package
    (name "seren")
    (version "0.0.21")
    (source (origin
              (method url-fetch)
              (uri (string-append "http://holdenc.altervista.org/"
                                  "seren/downloads/seren-" version
                                  ".tar.gz"))
              (sha256
               (base32
                "06mams6bng7ib7p2zpfq88kdr4ffril9svzc9lprkb0wjgmkglk9"))))
    (build-system gnu-build-system)
    (arguments '(#:tests? #f))  ; no "check" target
    (inputs
     (list alsa-lib gmp libogg ncurses opus))
    (synopsis "Simple VoIP program to create conferences from the terminal")
    (description
     "Seren is a simple VoIP program based on the Opus codec that allows you
to create a voice conference from the terminal, with up to 10 participants,
without having to register accounts, exchange emails, or add people to contact
lists.  All you need to join an existing conference is the host name or IP
address of one of the participants.")
    (home-page "http://holdenc.altervista.org/seren/")
    (license license:gpl3+)))

(define find-python-interpreter-cmake-modules
  (let ((commit "bb4d3ea8434eebef40df35434a9b6ef410fce0b2")
        (revision "0"))
   (origin
    (method git-fetch)
    (uri (git-reference
          (url "https://github.com/Krzmbrzl/FindPythonInterpreter")
          (commit commit)))
    (file-name (git-file-name "find-python-interpreter"
                              (git-version "0" revision commit)))
    (sha256
     (base32
      "1ryhda2yqgrhnwndfg52mscdsclg1ivv746hvalcay5m1wy2h5bm")))))

(define-public mumble
  (package
    (name "mumble")
    (version "1.5.634")
    (source (origin
              (method url-fetch)
              (uri
               (string-append
                "https://github.com/mumble-voip/mumble/releases/download/v"
                version "/" name "-" version ".tar.gz"))
              (sha256
               (base32
                "0aar5if80w8ay9i03lpnznz6ln1gh1jjrzxfbj9fdc4as8rkckwh"))
              (modules '((guix build utils)
                         (ice-9 ftw)
                         (srfi srfi-1)))
              (snippet
               `(begin
                  (let ((keep
                         '("arc4random"
                           "cmake-compiler-flags"
                           "flag-icons"
                           "minhook" ; unused, reqd for licenses
                           "qqbonjour"
                           "renamenoise"
                           "smallft"
                           "speexdsp" ; unbundled, reqd for licenses
                           "tracy" ; disabled below, reqd by cmake
                           "xinputcheck-src" ; reqd for licenses
                           )))
	            (with-directory-excursion "3rdparty"
	              (for-each delete-file-recursively
			        (lset-difference string=?
                                                 (scandir ".")
                                                 (cons* "." ".." keep))))
                    #t)))))
    (build-system qt-build-system)
    (arguments
     (list
      #:configure-flags
      #~(list "-Dbundled-gsl=off"
              "-Dbundled-json=off"
              "-Dbundled-speex=off"
              "-Dbundled-opus=off"
              "-Dalsa=off" ; use pulse
              "-Dcoreaudio=off" ; use pulse
              "-Dice=off" ; not packaged
              "-Djackaudio=off" ; use pulse
              "-Doss=off" ; use pulse
              "-Dpulseaudio=on"
              "-Dportaudio=off" ; use pulse
              "-Dpipewire=off" ; use pulse
              "-Doverlay-xcompile=off"
              "-Dupdate=off" ; don't phone home
              "-Dtests=on"
              "-Dtracy=off" ; no profiling
              "-Dbundle-qt-translations=off")
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'unpack-submodules
            (lambda _
              (copy-recursively #$find-python-interpreter-cmake-modules
                                "3rdparty/FindPythonInterpreter")))
          (add-after 'unpack 'disable-murmur-ice
            (lambda _
              (substitute* "auxiliary_files/mumble-server.ini"
                (("^ice=") ";ice="))))
          ;; disable statistic gathering by default. see <https://bugs.gnu.org/25201>
          (add-after 'unpack 'fix-statistic-gathering-default
            (lambda _
              (substitute* "src/mumble/Settings.h"
                (("bUsage *= true;") "bUsage = false;"))))
          (add-after 'unpack 'fix-mumble-overlay
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (with-output-to-file "scripts/mumble-overlay"
                (lambda ()
                  (format #t "#!~a~%" (search-input-file inputs "/bin/bash"))
                  (format #t "export LD_PRELOAD=\"~a $LD_PRELOAD\"~%"
                          (string-append (assoc-ref outputs "out")
                                         "/lib/mumble/libmumbleoverlay.so"))
                  (format #t "exec \"${@}\"")))))
          (add-after 'unpack 'hardcode-pulseaudio
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "src/mumble/PulseAudio.cpp"
                (("libpulse.so") (search-input-file inputs "/lib/libpulse.so"))))))))
    (inputs
     (list avahi
           boost
           c++-gsl ; avoid bundled
           glib ; for speech-dispatcher
           libsndfile
           libxi
           mesa ; avoid bundled
           nlohmann-json ; avoid bundled
           openssl
           opus ; avoid bundled
           poco
           protobuf
           pulseaudio
           qtbase-5
           qtsvg-5
           speech-dispatcher
           speex ; avoid bundled
           speexdsp ; avoid bundled
           ))
    (native-inputs
     (list pkg-config python qttools-5))
    (synopsis "Low-latency, high quality voice chat software")
    (description
     "Mumble is an low-latency, high quality voice chat
software primarily intended for use while gaming.
Mumble consists of two applications for separate usage:
@code{mumble} for the client, and @code{murmur} for the server.")
    (home-page "https://wiki.mumble.info/wiki/Main_Page")
    (license (list license:bsd-3 ; mumble cmake-compiler-flags qqbonjour smallft
                   license:expat ; flag-icons
                   license:isc)))) ; arc4random

(define-public twinkle
  (package
    (name "twinkle")
    (version "1.10.2")
    (source
     (origin
       (method git-fetch)
       (uri
        (git-reference
         (url "https://github.com/LubosD/twinkle")
         (commit
          (string-append "v" version))))
       (file-name
        (git-file-name name version))
       (patches
        (search-patches "twinkle-bcg729.patch")) ; To support new BCG729 API.
       (sha256
        (base32
         "0s0gi03xwvzp02ah4q6j33r9jx9nbayr6dxlg2ck9pwbay1nq1hx"))))
    (build-system qt-build-system)
    (arguments
     `(#:tests? #f                      ; no test target
       #:configure-flags
       (list
        ;; FIX-ME: Make Twinkle compatible with libre version of iLBC.
        ;; "-DWITH_ILBC=On"                ; For iLBC Codec Support
        "-DWITH_ZRTP=On"                ; For ZRTP Support
        "-DWITH_G729=On"                ; For G729 Codec Support
        "-DWITH_SPEEX=On")))            ; For Speex Codec Support
    (native-inputs
     (list bison flex qttools-5))
    (inputs
     (list alsa-lib
           bcg729
           zrtpcpp
           ccrtp
           file
           libilbc
           libsndfile
           libxml2
           qtbase-5
           qtdeclarative-5
           qtquickcontrols-5
           readline
           speex
           speexdsp
           ucommon))
    (synopsis "Softphone for voice over IP and instant messaging")
    (description "Twinkle is a softphone for your voice over IP and instant
messaging communcations using the SIP protocol.  You can use it for direct
IP phone to IP phone communication or in a network using a SIP proxy to route
your calls and messages.")
    (home-page "http://twinkle.dolezel.info/")
    (license license:gpl2+)))

(define-public pjproject
  (package
    (name "pjproject")
    (version "2.13")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/pjsip/pjproject")
             (commit version)))
       (file-name (git-file-name name version))
       (sha256
        (base32
         "0ld0adp9y2ydnz2ldwdzig3hpk4ayx1va6aqc3nja8zfdnd36fyb"))
       (modules '((guix build utils)))
       (snippet
        '(begin
           ;; Remove bundled libraries.
           (delete-file-recursively "third_party")
           (substitute* "aconfigure.ac"
             (("third_party/build/os-auto.mak") ""))
           (substitute* "Makefile"
             (("third_party/build") ""))))))
    (build-system gnu-build-system)
    (outputs '("out" "debug" "static"))
    (arguments
     (list
      #:test-target "selftest"
      #:configure-flags
      #~(list "--enable-shared"
              "--with-external-speex"
              "--with-external-gsm"
              "--with-external-srtp"
              "--with-external-pa"
              ;; The following flag is Linux specific.
              #$@(if (string-contains (or (%current-system)
                                          (%current-target-system)) "linux")
                     #~("--enable-epoll")
                     #~())
              "--with-gnutls"           ;disable OpenSSL checks
              "--disable-libyuv"        ;TODO: add missing package
              "--disable-silk"          ;TODO: add missing package
              "--disable-libwebrtc"     ;TODO: add missing package
              "--disable-ilbc-codec"    ;cannot be unbundled
              "--disable-g7221-codec"   ;TODO: add missing package
              "--enable-libsamplerate"
              ;; -DNDEBUG is set to prevent pjproject from raising
              ;; assertions that aren't critical, crashing
              ;; applications as the result.
              "CFLAGS=-DNDEBUG"
              ;; Specify a runpath reference to itself, which is missing and
              ;; causes the validate-runpath phase to fail.
              (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
      #:phases
      #~(modify-phases %standard-phases
          (add-before 'build 'build-dep
            (lambda _ (invoke "make" "dep")))
          ;; The check phases is moved after the install phase so to
          ;; use the installed shared libraries for the tests.
          (delete 'check)
          (add-after 'install 'move-static-libraries
            (lambda* (#:key outputs #:allow-other-keys)
              (let ((s (string-append #$output:static "/lib")))
                (mkdir-p s)
                (with-directory-excursion #$output
                  (for-each (lambda (f)
                              (rename-file f (string-append s "/" (basename f))))
                            (find-files "." "\\.a$"))))))
          (add-after 'install 'check
            (assoc-ref %standard-phases 'check))
          (add-before 'patch-source-shebangs 'autoconf
            (lambda _
              (invoke "autoconf" "-v" "-f" "-i" "-o"
                      "aconfigure" "aconfigure.ac")))
          (add-before 'autoconf 'disable-some-tests
            (lambda _
              (substitute* "pjlib/src/pjlib-test/test.h"
                ;; Disable network tests which are slow and/or require an
                ;; actual network.
                (("#define GROUP_NETWORK.*")
                 "#define GROUP_NETWORK 0\n"))
              (substitute* "self-test.mak"
                ;; Fails with: pjlib-util-test-x86_64-unknown-linux-gnu:
                ;; ../src/pjlib-util-test/resolver_test.c:1501: action2_1:
                ;; Assertio n `pj_strcmp2(&pkt->q[0].name, "_sip._udp."
                ;; "domain2.com")==0' failed.
                ((" pjlib_util_test ") ""))
              (substitute* "pjsip/src/test/test.h"
                ;; Fails with: Error: unable to acquire TCP transport:
                ;; [pj_status_t=120101] Network is unreachable.
                (("#define INCLUDE_TCP_TEST.*")
                 "#define INCLUDE_TCP_TEST 0\n")
                ;; The TSX tests takes a very long time to run; skip them.
                (("#define INCLUDE_TSX_GROUP.*")
                 "#define INCLUDE_TSX_GROUP 0\n")
                ;; The resolve test requires a working domain name resolver.
                (("#define INCLUDE_RESOLVE_TEST.*")
                 "#define INCLUDE_RESOLVE_TEST 0\n"))
              (substitute* "pjsip/src/test/dns_test.c"
                ;; The round_robin_test fails non-deterministically (depending
                ;; on load); skip it (see:
                ;; https://github.com/pjsip/pjproject/issues/2500).
                (("round_robin_test(pool)") 0))
              (substitute* "pjmedia/src/test/test.h"
                ;; The following tests require a sound card.
                (("#define HAS_MIPS_TEST.*")
                 "#define HAS_MIPS_TEST 0\n")
                (("#define HAS_JBUF_TEST.*")
                 "#define HAS_JBUF_TEST 0\n"))
              (substitute* "Makefile"
                ;; Disable the pjnath and pjsua tests, which require an actual
                ;; network and an actual sound card, respectively.
                (("pjnath-test pjmedia-test pjsip-test pjsua-test")
                 "pjmedia-test pjsip-test")))))))
    (native-inputs
     (list autoconf
           automake
           libtool
           pkg-config))
    (inputs
     (list bcg729
           gnutls
           gsm
           libsamplerate
           libsrtp
           opus
           portaudio
           speex
           speexdsp))
    (home-page "https://www.pjsip.org")
    (synopsis "Session Initiation Protocol (SIP) stack")
    (description "PJProject provides an implementation of the Session
Initiation Protocol (SIP) and a multimedia framework.")
    (license license:gpl2+)))

(define-public pjproject-jami
  (let ((commit "797f1a38cc1066acc4adc9561aa1288afabe72d5")
        (revision "2"))
    (package
      (inherit pjproject)
      (name "pjproject-jami")
      ;; The version is taken from
      ;; <https://raw.githubusercontent.com/savoirfairelinux/pjproject/master/version.mak>.
      (version (git-version "2.13.1" revision commit))
      (source (origin
                (inherit (package-source pjproject))
                ;; The Jami development team regularly issues patches to
                ;; pjproject to extend the its functionality and fix bugs;
                ;; they are submitted for inclusion upstream but larger
                ;; patches take time to be reviewed and merged, hence this
                ;; forked repository.
                (method git-fetch)
                (uri (git-reference
                      (url "https://github.com/savoirfairelinux/pjproject")
                      (commit commit)))
                (file-name (git-file-name name version))
                (sha256
                 (base32
                  "1ssiffc48qg43c45fbpx86i1gbi969b8y34922z62irxbljdnc4m"))))
      (arguments
       (substitute-keyword-arguments (package-arguments pjproject)
         ((#:configure-flags _ ''())
          ;; This package is tailored for DhtNet; see how it is built for its
          ;; CI in
          ;; <https://git.jami.net/savoirfairelinux/dhtnet/-/raw/master/Dockerfile>.
          #~(list
             ;; Some flags preserved flags from parent package.
             "--with-external-srtp"
             #$@(if (string-contains (or (%current-system)
                                         (%current-target-system)) "linux")
                    #~("--enable-epoll")
                    #~())
             "--with-gnutls"            ;disable OpenSSL checks
             ;; -DNDEBUG is set to prevent pjproject from raising
             ;; assertions that aren't critical, crashing
             ;; applications as the result.
             "CFLAGS=-DNDEBUG"
             ;; Specify a runpath reference to itself, which is missing and
             ;; causes the validate-runpath phase to fail.
             (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
             "--enable-shared"
             "--disable-libyuv"         ;TODO: add missing package

             ;; These flags are specific to DhtNet.
             "--disable-sound"
             "--enable-video"
             "--enable-ext-sound"
             "--disable-speex-aec"
             "--disable-g711-codec"
             "--disable-l16-codec"
             "--disable-gsm-codec"
             "--disable-g722-codec"
             "--disable-g7221-codec"
             "--disable-speex-codec"
             "--disable-ilbc-codec"
             "--disable-opencore-amr"
             "--disable-silk"
             "--disable-sdl"
             "--disable-ffmpeg"
             "--disable-v4l2"
             "--disable-openh264"
             "--disable-resample"
             "--disable-libwebrtc")))))))

(define-public libtgvoip
  (package
    (name "libtgvoip")
    (version "2.4.4")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/grishka/libtgvoip")
             (commit version)))
       (file-name (git-file-name name version))
       ;; Fix compilation on i686-linux architecture.
       ;; NOTE: Applying these patches is order-dependent!
       ;; The patch for WebRTC /must/ precede the patch for SSE2.
       (patches
        (search-patches "libtgvoip-disable-webrtc.patch"
                        "libtgvoip-disable-sse2.patch"))
       (sha256
        (base32
         "122kn3jx6v0kkldlzlpzvlwqxgp6pmzxsjhrhcxw12bx9c08sar5"))))
    (build-system gnu-build-system)
    (inputs
     (list alsa-lib openssl opus pulseaudio))
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         ;; libtgvoip wants to dlopen libpulse and libasound, so tell it where
         ;; they are.
         (add-after 'unpack 'patch-dlopen
           (lambda* (#:key inputs #:allow-other-keys)
             (substitute* "os/linux/AudioPulse.cpp"
               (("libpulse\\.so")
                (search-input-file inputs "/lib/libpulse.so")))
             (substitute* '("os/linux/AudioInputALSA.cpp"
                            "os/linux/AudioOutputALSA.cpp")
               (("libasound\\.so")
                (search-input-file inputs "/lib/libasound.so"))))))))
    (synopsis "VoIP library for Telegram clients")
    (description "A collection of libraries and header files for implementing
telephony functionality into custom Telegram clients.")
    (home-page "https://github.com/zevlg/libtgvoip")
    (license license:unlicense)))

(define-public coturn
  (package
    (name "coturn")
    (version "4.6.2")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/coturn/coturn")
             (commit version)))
       (file-name (git-file-name name version))
       (sha256
        (base32 "16rr8666spi84qcc8l2qga42hpskjmvrpj1w58jbanxnpsijv8h4"))))
    (inputs
     (list openssl
           sqlite
           libevent-with-openssl
           hiredis))
    (native-inputs
     (list pkg-config))
    (build-system gnu-build-system)
    (synopsis "Implementation of a TURN and STUN server for VoIP")
    (description
     "This package provides a VoIP media traffic NAT traversal server and
gateway.  It implements the STUN (Session Traversal Utilities for NAT) and
TURN (Traversal Using Relays around NAT) server protocols.")
    (home-page "https://github.com/coturn/coturn")
    (license license:bsd-3)))

(define-public libosmocore
  (package
    (name "libosmocore")
    (version "1.7.0")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://gitea.osmocom.org/osmocom/libosmocore.git")
                    (commit version)))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "147ld3xwb9k6vb56hk8q8jkcb5ahxl66v87vdhazb6rxj3frsjqf"))))
    (arguments
     (list #:phases #~(modify-phases %standard-phases
                        (add-after 'unpack 'patch-bin-sh
                          (lambda _
                            (substitute* '("git-version-gen" "src/exec.c")
                              (("/bin/sh")
                               (which "sh"))))))))
    (inputs (list gnutls
                  libmnl
                  libusb
                  lksctp-tools
                  pcsc-lite
                  talloc))
    (native-inputs (list autoconf
                         automake
                         coreutils
                         doxygen
                         libtool
                         pkg-config
                         python))
    (build-system gnu-build-system)
    (synopsis "Libraries for sharing common code between osmocom projects")
    (description
     "Libosmocore includes several libraries:
@itemize
@item libosmocore: general-purpose functions
@item libosmovty: interactive VTY command-line interface
@item libosmogsm: definitions and helper code related to GSM protocols
@item libosmoctrl: shared implementation of the Osmocom control interface
@item libosmogb: implementation of the Gb interface with its NS/BSSGP protocols
@item libosmocodec: implementation of GSM voice codecs
@item libosmocoding: implementation of GSM 05.03 burst transcoding functions
@item libosmosim: infrastructure to interface with SIM/UICC/USIM cards
@end itemize")
    (home-page "https://osmocom.org/projects/libosmocore/wiki/Libosmocore")
    (license license:gpl2+)))

(define-public xgoldmon
  ;; There are no releases nor tags.
  (let ((revision "1")
        (commit "f2d5372acee4e492f31f6ba8b850cfb48fbbe478"))
    (package
      (name "xgoldmon")
      (version (git-version "1.0" revision commit))
      (source (origin
                (method git-fetch)
                (uri (git-reference
                      (url "https://github.com/2b-as/xgoldmon")
                      (commit commit)))
                (file-name (git-file-name name version))
                (sha256
                 (base32
                  "0dvgagqsbwq1sd5qjzk0hd9rxnv2vnmhazvv5mz4pj7v467amgdz"))))
      (arguments
       (list #:tests? #f ;no tests
             #:make-flags #~(list (string-append "CC="
                                                 #$(cc-for-target)))
             #:phases #~(modify-phases %standard-phases
                          (delete 'configure)
                          (replace 'install
                            (lambda _
                              (let ((bin (string-append #$output "/bin"))
                                    (doc (string-append #$output "/share/doc")))
                                (install-file "xgoldmon" bin)
                                (install-file "README" doc)
                                (install-file
                                 "screenshot-mtsms-while-in-a-call.png" doc)))))))
      (inputs (list libosmocore lksctp-tools talloc))
      (native-inputs (list pkg-config))
      (build-system gnu-build-system)
      (synopsis "Displays cellular network protocol traces in Wireshark")
      (description
       "xgoldmon is an utility that converts the USB logging mode
messages that various Intel/Infineon XGold modems send to the USB port to
gsmtap.  It then then sends them to a given IP address to enable users
to view cellular network protocol traces in Wireshark.

It supports the following smartphones:
@itemize
@item Samsung Galaxy S4, GT-I9500 variant
@item Samsung Galaxy SIII, GT-I9300 variant
@item Samsung Galaxy Nexus, GT-I9250 variant
@item Samsung Galaxy SII, GT-I9100 variant
@item Samsung Galaxy Note II, GT-N7100 variant
@end itemize")
      (home-page "https://github.com/2b-as/xgoldmon")
      (license license:gpl2+))))

(define-public sipp
  (package
    (name "sipp")
    (version "3.7.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/SIPp/sipp")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256 (base32 "0vplccia9zdva1wwny2xgs0b6rzmq4abxvw8lyz61wfw7jjmvin0"))))
    (build-system cmake-build-system)
    (arguments
     (list
      #:configure-flags
      #~(list "-DUSE_GSL=1" "-DUSE_PCAP=1" "-DUSE_SSL=1" "-DUSE_SCTP=1")
      #:phases
      #~(modify-phases %standard-phases
          ;; Modify build instructions to use external GTEST and GMOCK.
          (add-before 'configure 'unbundle-gtest
            (lambda _
              (rmdir "gtest")
              (symlink (assoc-ref %build-inputs "googletest") "gtest")
              (substitute* "CMakeLists.txt"
                ((".*gtest-all.*") "")
                ((".*gmock-all.*") "")
                (("target_compile_features\\(sipp_unittest" all)
                 (string-append "target_link_libraries(sipp_unittest gtest gmock)\n"
                                all)))))
          ;; Generate version.h without GIT.
          (add-before 'configure 'fix-version
            (lambda _
              (copy-file "include/version.h.in" "include/version.h")
              (substitute* "include/version.h" (("@VERSION@") #$version))
              (substitute* "CMakeLists.txt" (("find_package\\(Git\\)") ""))))
          (add-after 'build 'build-tests
            (lambda* (#:key parallel-build? #:allow-other-keys)
              (invoke "make"
                      (string-append
                       "-j" (if parallel-build?
                                (number->string (parallel-job-count))
                                "1"))
                      "sipp_unittest")))
          (replace 'check
            (lambda* (#:key tests? #:allow-other-keys)
              (when tests?
                (invoke "./sipp_unittest")))))))
    (inputs
     (list gsl libpcap lksctp-tools ncurses/tinfo openssl))
    (native-inputs
     (list googletest pkg-config))
    (synopsis "Performance testing tool for the SIP protocol")
    (description "SIPp can be used to test many real SIP equipements like SIP
proxies, B2BUAs, SIP media servers, SIP/x gateways, and SIP PBXes.  It is also
very useful to emulate thousands of user agents calling your SIP system.")
    (home-page "https://sipp.readthedocs.io/")
    (license (list license:gpl2+        ; sipp's main license
                   license:bsd-3        ; send_packets.c, send_packets.h
                   license:zlib)))) ; md5.c, md5.h

(define-public sofia-sip
  (package
    (name "sofia-sip")
    (version "1.13.16")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/freeswitch/sofia-sip")
                    (commit (string-append "v" version))))
              (file-name (git-file-name "sofia-sip" version))
              (sha256
               (base32
                "1hi9np49wcq91d1w93qi6by40qnr348hpzc2wkw3l955zh1n30lr"))))
    (build-system gnu-build-system)
    (arguments
     (list
      ;; run_addrinfo requires /etc/services for the 'echo' service.
      #:make-flags #~'("XFAIL_TESTS = run_addrinfo"
                       ;; libsofia-sip-ua/nta/Makefile.am sets
                       ;; TESTS_ENVIRONMENT = $(SHELL), which is odd, because
                       ;; according to the Automake manual, it should be
                       ;; AM_TESTS_ENVIRONMENT, and it should end with a
                       ;; semicolon.
                       "TESTS_ENVIRONMENT = \
export CHECK_NTA_VERBOSE=10; \
export CHECK_NUA_VERBOSE=10; ")
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'patch-shebangs
            (lambda _
              (patch-shebang "autogen.sh")))
          (add-after 'unpack 'disable-failing-test
            (lambda _
              ;; run_test_nta is disabled because it fails randomly (not for a
              ;; timeout-related reason).  The test suite is otherwise very
              ;; long, most tests backed by libcheck timeout even with a ×100
              ;; multiplier.  The tests are disabled here rather than put to
              ;; XFAIL_TESTS because it saves compilation time.  (see:
              ;; https://github.com/freeswitch/sofia-sip/issues/234)
              (substitute* "libsofia-sip-ua/nta/Makefile.am"
                (("TESTS =")
                 "TESTS = run_test_nta_api\n# Disabled: "))
              (substitute* "libsofia-sip-ua/nua/Makefile.am"
                (("TESTS \\+=")
                 "TESTS +=\n# Disabled: "))
              ;; The glib tests both wait forever without a timeout.
              (substitute* "libsofia-sip-ua-glib/su-glib/Makefile.am"
                (("TESTS =")
                 "TESTS =\n# Disabled: "))
              ;; Another timeout failing test:
              (substitute* "tests/Makefile.am"
                (("TESTS = test_nua")
                 "TESTS ="))
              ;; This test fails for unknown reason:
              (substitute* "tests/Makefile.am"
                (("TESTS \\+= check_dlopen_sofia check_sofia")
                 "TESTS += check_dlopen_sofia")))))))
    (inputs
     (list glib
           openssl
           zlib))
    (native-inputs
     (list autoconf
           autoconf-archive
           automake
           check
           libtool
           pkg-config))
    (home-page "https://sofia-sip.sourceforge.net/")
    (synopsis "SIP user-agent library")
    (description "Sofia-SIP is a @acronym{SIP, Session Initiation Protocol}
User-Agent library, compliant with the
@url{https://datatracker.ietf.org/doc/html/rfc3261, IETF RFC3261}
specification.  It can be used as a building block for @acronym{SIP} client
software foruses such as @acronym{VoIP, Voice over @acronym{IP, Internet
Protocol}}, @acronym{IM, Instant Messaging}, and many other real-time and
person-to-person communication services.")
    (license license:lgpl2.1)))

(define-public libcallaudio
  (package
    (name "libcallaudio")
    (version "0.1.9")
    (source (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://gitlab.com/mobian1/callaudiod/")
             (commit version)))
       (file-name (git-file-name name version))
       (sha256
        (base32
         "0qnllb28101c2ss1k3iwr04gljfyjqmbla5csj6vkq1y63aagr9s"))))
    (build-system meson-build-system)
    (inputs (list alsa-lib glib pulseaudio))
    (native-inputs
     (list `(,glib "bin")          ;for gdbus-codegen
           pkg-config))
    (home-page "https://gitlab.com/mobian1/callaudiod")
    (synopsis "Library for audio routing during voice calls")
    (description "This package provides @command{callaudiod}, a daemon to
route audio during phone calls, and a library.")
    (license license:gpl3+)))
ts #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (dir (string-append out "/share/emacs/site-lisp"))) (invoke "make" "-C" "bmacs" "all" "install" (string-append "EMACSBRAND=emacs25") (string-append "EMACSDIR=" dir)))))))) (inputs (list emacs ;UDE needs the X version of Emacs libgc libunistring libuv openssl sqlite ;; Optional APIs for which Bigloo has bindings. avahi libphidget pcre)) (native-inputs (list pkg-config)) (propagated-inputs (list gmp)) ; bigloo.h refers to gmp.h (home-page "https://www-sop.inria.fr/indes/fp/Bigloo/") (synopsis "Efficient Scheme compiler") (description "Bigloo is a Scheme implementation devoted to one goal: enabling Scheme based programming style where C(++) is usually required. Bigloo attempts to make Scheme practical by offering features usually presented by traditional programming languages but not offered by Scheme and functional programming. Bigloo compiles Scheme modules. It delivers small and fast stand alone binary executables. Bigloo enables full connections between Scheme and C programs and between Scheme and Java programs.") (license gpl2+)))) (define-public hop (package (name "hop") (version "3.2.0-pre1") (source (origin (method url-fetch) (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Hop/hop-" version ".tar.gz")) (sha256 (base32 "0jf418d0s9imv98s6qrpjxr1mdaxr37knh5qyfl5y4a9cc41mlg5")))) (build-system gnu-build-system) (arguments `(#:test-target "test" #:make-flags '("BIGLOO=bigloo") #:parallel-build? #f #:phases (modify-phases %standard-phases (replace 'configure (lambda* (#:key inputs outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (substitute* '("tools/Makefile" "test/hopjs/TEST.in") (("/bin/rm") (which "rm"))) (invoke "./configure" (string-append "--prefix=" out) "--hostcc=gcc" (string-append "--blflags=" ;; user flags completely override useful ;; default flags, so repeat them here. "-copt \\$(CPICFLAGS) " "-L \\$(BUILDLIBDIR) " "-ldopt -Wl,-rpath," out "/lib")))))))) (inputs (list avahi bigloo libgc libunistring libuv pcre sqlite which)) (home-page "http://hop.inria.fr/") (synopsis "Multi-tier programming language for the Web 2.0") (description "HOP is a multi-tier programming language for the Web 2.0 and the so-called diffuse Web. It is designed for programming interactive web applications in many fields such as multimedia (web galleries, music players, ...), ubiquitous and house automation (SmartPhones, personal appliance), mashups, office (web agendas, mail clients, ...), etc.") (license gpl2+))) (define-public scheme48 (package (name "scheme48") (version "1.9.2") (source (origin (method url-fetch) (uri (string-append "https://s48.org/" version "/scheme48-" version ".tgz")) (sha256 (base32 "1x4xfm3lyz2piqcw1h01vbs1iq89zq7wrsfjgh3fxnlm1slj2jcw")) (patches (search-patches "scheme48-tests.patch")))) (build-system gnu-build-system) (home-page "https://s48.org/") (synopsis "Scheme implementation using a bytecode interpreter") (description "Scheme 48 is an implementation of Scheme based on a byte-code interpreter and is designed to be used as a testbed for experiments in implementation techniques and as an expository tool.") ;; Most files are BSD-3; see COPYING for the few exceptions. (license bsd-3))) (define-public scheme48-prescheme (package (inherit scheme48) (name "scheme48-prescheme") (arguments (list #:tests? #f ; tests only cover scheme48 #:modules '((guix build gnu-build-system) (guix build utils) (ice-9 popen) (srfi srfi-1)) #:phases #~(modify-phases %standard-phases (add-after 'configure 'patch-prescheme-version (lambda _ ;; Ensure the Pre-Scheme version matches the package version (call-with-output-file "ps-compiler/minor-version-number" (lambda (port) (let* ((version #$(package-version this-package)) (vparts (string-split version #\.)) (vminor (string-join (drop vparts 1) "."))) (write vminor port)))))) (add-after 'configure 'patch-prescheme-headers (lambda _ ;; Rename "io.h" to play nicely with others (copy-file "c/io.h" "c/prescheme-io.h") (substitute* "c/prescheme.h" (("^#include \"io\\.h\"") "#include \"prescheme-io.h\"")))) (add-after 'configure 'generate-pkg-config (lambda _ ;; Generate a pkg-config file (call-with-output-file "prescheme.pc" (lambda (port) (let ((s48-version #$(package-version scheme48)) (version #$(package-version this-package))) (format port (string-join '("prefix=~a" "exec_prefix=${prefix}" "libdir=${prefix}/lib/scheme48-~a" "includedir=${prefix}/include" "" "Name: Pre-Scheme (Scheme 48)" "Description: Pre-Scheme C runtime" "Version: ~a" "Libs: -L${libdir} -lprescheme" "Cflags: -I${includedir}") "\n" 'suffix) #$output s48-version version)))))) (add-after 'configure 'generate-prescheme-wrapper (lambda _ ;; Generate a wrapper to load and run ps-compiler.image (call-with-output-file "prescheme" (lambda (port) (let ((s48-version #$(package-version scheme48))) (format port (string-join '("#!/bin/sh" "scheme48=~a/lib/scheme48-~a/scheme48vm" "prescheme=~a/lib/scheme48-~a/prescheme.image" "exec ${scheme48} -i ${prescheme} \"$@\"") "\n" 'suffix) #$scheme48 s48-version #$output s48-version)))) (chmod "prescheme" #o755))) (replace 'build (lambda _ ;; Build a minimal static library for linking Pre-Scheme code (let ((lib "c/libprescheme.a") (objs '("c/unix/io.o" "c/unix/misc.o"))) (apply invoke "make" objs) (apply invoke "ar" "rcs" lib objs)) ;; Dump a Scheme 48 image with both the Pre-Scheme compatibility ;; library and compiler pre-loaded, courtesy of Taylor Campbell's ;; Pre-Scheme Manual: ;; https://groups.scheme.org/prescheme/1.3/#Invoking-the-Pre_002dScheme-compiler (with-directory-excursion "ps-compiler" (let ((version #$(package-version this-package)) (port (open-pipe* OPEN_WRITE "scheme48"))) (format port (string-join '(",batch" ",config ,load ../scheme/prescheme/interface.scm" ",config ,load ../scheme/prescheme/package-defs.scm" ",exec ,load load-ps-compiler.scm" ",in prescheme-compiler prescheme-compiler" ",user (define prescheme-compiler ##)" ",dump ../prescheme.image \"(Pre-Scheme ~a)\"" ",exit") "\n" 'suffix) version) (close-pipe port))))) (replace 'install (lambda _ (let* ((s48-version #$(package-version scheme48)) (bin-dir (string-append #$output "/bin")) (lib-dir (string-append #$output "/lib/scheme48-" s48-version)) (pkgconf-dir (string-append #$output "/lib/pkgconfig")) (share-dir (string-append #$output "/share/scheme48-" s48-version)) (include-dir (string-append #$output "/include"))) ;; Install Pre-Scheme compiler image (install-file "prescheme" bin-dir) (install-file "prescheme.image" lib-dir) ;; Install Pre-Scheme config, headers, and lib (install-file "prescheme.pc" pkgconf-dir) (install-file "c/prescheme.h" include-dir) (install-file "c/prescheme-io.h" include-dir) (install-file "c/libprescheme.a" lib-dir) ;; Install Pre-Scheme sources (copy-recursively "scheme/prescheme" (string-append share-dir "/prescheme")) (copy-recursively "ps-compiler" (string-append share-dir "/ps-compiler")) ;; Remove files specific to building the Scheme 48 VM (for-each (lambda (file) (delete-file (string-append share-dir "/" file))) '("ps-compiler/compile-bibop-gc-32.scm" "ps-compiler/compile-bibop-gc-64.scm" "ps-compiler/compile-gc.scm" "ps-compiler/compile-twospace-gc-32.scm" "ps-compiler/compile-twospace-gc-64.scm" "ps-compiler/compile-vm-no-gc-32.scm" "ps-compiler/compile-vm-no-gc-64.scm")))))))) (propagated-inputs (list scheme48)) (home-page "http://s48.org/") (synopsis "Pre-Scheme compiler from Scheme 48") (description "Pre-Scheme is a statically compilable dialect of Scheme, used to implement the Scheme 48 virtual machine. Scheme 48 ships with a Pre-Scheme to C compiler written in Scheme, and a runtime library which allows Pre-Scheme code to run as Scheme.") (license bsd-3))) (define-public gambit-c (package (name "gambit-c") (version "4.9.5") (source (origin (method url-fetch) (uri (string-append "http://www.gambitscheme.org/" version "/gambit-v" (string-map (lambda (c) (if (char=? c #\.) #\_ c)) version) ".tgz")) (sha256 (base32 "1p61z1rp0ya4i61mq3hzmr67r3xbvi9h058cf9ci2yqfbzdzi3p2")))) (build-system gnu-build-system) (arguments '(#:configure-flags ;; According to the ./configure script, this makes the build slower and ;; use >= 1 GB memory, but makes Gambit much faster. '("--enable-single-host"))) (home-page "http://www.gambitscheme.org/") (synopsis "Efficient Scheme interpreter and compiler") (description "Gambit consists of two main programs: gsi, the Gambit Scheme interpreter, and gsc, the Gambit Scheme compiler. The interpreter contains the complete execution and debugging environment. The compiler is the interpreter extended with the capability of generating executable files. The compiler can produce standalone executables or compiled modules which can be loaded at run time. Interpreted code and compiled code can be freely mixed.") ;; Dual license. (license (list lgpl2.1+ asl2.0)))) (define-public chibi-scheme (package (name "chibi-scheme") (version "0.10") (home-page "https://github.com/ashinn/chibi-scheme") (source (origin (method git-fetch) (uri (git-reference (url home-page) (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "0yhmj0lws3r3bl4ivs31dhlzxqc7f0dinixi904mraz1fmrg3w7f")))) (build-system gnu-build-system) (arguments `(#:phases (modify-phases %standard-phases (delete 'configure)) ; no configure script #:make-flags (let ((out (assoc-ref %outputs "out"))) (list (string-append "PREFIX=" out) (string-append "CC=" ,(cc-for-target)) (string-append "LDFLAGS=-Wl,-rpath=" out "/lib"))) #:test-target "test")) (synopsis "Small embeddable Scheme implementation") (description "Chibi-Scheme is a very small library with no external dependencies intended for use as an extension and scripting language in C programs. In addition to support for lightweight VM-based threads, each VM itself runs in an isolated heap allowing multiple VMs to run simultaneously in different OS threads.") (license bsd-3))) (define-public sicp (let ((commit "bda03f79d6e2e8899ac2b5ca6a3732210e290a79") (revision "3")) (package (name "sicp") (version (git-version "20180718" revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/sarabander/sicp") (commit commit))) (sha256 (base32 "0mng7qrj2dvssyffr9ycnf4a5k0kadp4dslq7mc5bhzq1qxyjs2w")) (file-name (git-file-name name version)))) (build-system copy-build-system) (native-inputs (list gzip texinfo)) (arguments (list #:install-plan ''(("html" "share/doc/sicp/") ("sicp.info" "share/info/")) #:phases #~(modify-phases %standard-phases (add-after 'unpack 'remove-obsolete-commands (lambda _ ;; Reported upstream: ;; https://github.com/sarabander/sicp/issues/46. (substitute* "sicp-pocket.texi" (("@setshortcontentsaftertitlepage") "")))) (add-before 'install 'build (lambda _ (invoke "makeinfo" "--no-split" "--output=sicp.info" "sicp-pocket.texi")))))) (home-page "https://sarabander.github.io/sicp") (synopsis "Structure and Interpretation of Computer Programs") (description "Structure and Interpretation of Computer Programs (SICP) is a textbook aiming to teach the principles of computer programming. Using Scheme, a dialect of the Lisp programming language, the book explains core computer science concepts such as abstraction in programming, metalinguistic abstraction, recursion, interpreters, and modular programming.") (license cc-by-sa4.0)))) (define-public scheme48-rx (let* ((commit "dd9037f6f9ea01019390614f6b126b7dd293798d") (revision "2")) (package (name "scheme48-rx") (version (string-append "0.0.0-" revision "." (string-take commit 7))) (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/scheme/rx") (commit commit))) (sha256 (base32 "1bvriavxw5kf2izjbil3999vr983vkk2xplfpinafr86m40b2cci")) (file-name (string-append name "-" version "-checkout")))) (build-system trivial-build-system) (arguments `(#:modules ((guix build utils)) #:builder (begin (use-modules (guix build utils)) (let ((share (string-append %output "/share/scheme48-" ,(package-version scheme48) "/rx"))) (chdir (assoc-ref %build-inputs "source")) (mkdir-p share) (copy-recursively "." share) #t)))) (native-inputs `(("source" ,source) ("scheme48" ,scheme48))) (home-page "https://github.com/scheme/rx/") (synopsis "SRE String pattern-matching library for scheme48") (description "String pattern-matching library for scheme48 based on the SRE regular-expression notation.") (license bsd-3)))) (define-public slib (package (name "slib") (version "3b6") (source (origin (method url-fetch) (uri (string-append "http://groups.csail.mit.edu/mac/ftpdir/scm/slib-" version ".zip")) (sha256 (base32 "137dn2wwwwg0qbifgxfckjhzj4m4820crpg9kziv402l7f2b931f")))) (build-system gnu-build-system) (arguments `(#:tests? #f ; There is no check target. #:phases (modify-phases %standard-phases (add-after 'install 'remove-bin-share (lambda* (#:key inputs outputs #:allow-other-keys) (delete-file-recursively (string-append (assoc-ref outputs "out") "/bin")) #t)) (replace 'configure (lambda* (#:key inputs outputs #:allow-other-keys) (invoke "./configure" (string-append "--prefix=" (assoc-ref outputs "out")))))))) (native-inputs (list unzip texinfo)) (home-page "https://people.csail.mit.edu/jaffer/SLIB.html") (synopsis "Compatibility and utility library for Scheme") (description "SLIB is a portable Scheme library providing compatibility and utility functions for all standard Scheme implementations.") (license (non-copyleft "http://people.csail.mit.edu/jaffer/SLIB_COPYING.txt" "Or see COPYING in the distribution.")))) (define-public scm (package (name "scm") (version "5f3") (source (origin (method url-fetch) (uri (string-append "http://groups.csail.mit.edu/mac/ftpdir/scm/scm-" version ".zip")) (sha256 (base32 "1jxxlhmgal26mpcl97kz37djkn97rfy9h5pvw0hah6f3f6w49j97")))) (build-system gnu-build-system) (arguments `(#:phases (modify-phases %standard-phases (replace 'configure (lambda* (#:key inputs outputs #:allow-other-keys) (invoke "./configure" (string-append "--prefix=" (assoc-ref outputs "out"))))) (add-before 'build 'pre-build (lambda* (#:key inputs #:allow-other-keys) (substitute* "Makefile" (("ginstall-info") "install-info")) #t)) (replace 'build (lambda* (#:key inputs outputs #:allow-other-keys) (setenv "SCHEME_LIBRARY_PATH" (search-input-directory inputs "lib/slib/")) (invoke "make" "scmlit" "CC=gcc") (invoke "make" "all"))) (add-after 'install 'post-install (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (req (string-append out "/lib/scm/require.scm"))) (delete-file req) (format (open req (logior O_WRONLY O_CREAT)) "(define (library-vicinity) ~s)\n" (search-input-directory inputs "lib/slib/")) ;; We must generate the slibcat file. (invoke (string-append out "/bin/scm") "-br" "new-catalog"))))))) (inputs (list slib)) (native-inputs (list unzip texinfo)) (home-page "https://people.csail.mit.edu/jaffer/SCM") (synopsis "Scheme implementation conforming to R5RS and IEEE P1178") (description "GNU SCM is an implementation of Scheme. This implementation includes Hobbit, a Scheme-to-C compiler, which can generate C files whose binaries can be dynamically or statically linked with a SCM executable.") (license lgpl3+))) (define-public tinyscheme (package (name "tinyscheme") (version "1.42") (source (origin (method url-fetch) (uri (string-append "mirror://sourceforge/" name "/" name "/" name "-" version "/" name "-" version ".zip")) (sha256 (base32 "0rik3qnxqd8wjlazx8rw996pfzkjjg60v6hcbpcqzi7rgml8q4n8")))) (build-system gnu-build-system) (native-inputs (list unzip)) (arguments `(#:phases (modify-phases %standard-phases (replace 'unpack (lambda* (#:key source #:allow-other-keys) (invoke "unzip" source) (chdir (string-append ,name "-" ,version)) #t)) (add-after 'unpack 'set-scm-directory ;; Hard-code ‘our’ init.scm instead of looking in the current ;; working directory, so invoking ‘scheme’ just works. (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (scm (string-append out "/share/" ,name))) (substitute* "scheme.c" (("init.scm" all) (string-append scm "/" all))) #t))) (delete 'configure) ; no configure script (replace 'install ;; There's no ‘install’ target. Install files manually. (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (bin (string-append out "/bin")) (doc (string-append out "/share/doc/" ,name "-" ,version)) (include (string-append out "/include")) (lib (string-append out "/lib")) (scm (string-append out "/share/" ,name))) (install-file "scheme" bin) (install-file "Manual.txt" doc) (install-file "scheme.h" include) (install-file "libtinyscheme.so" lib) (install-file "init.scm" scm) #t)))) #:tests? #f)) ; no tests (home-page "https://tinyscheme.sourceforge.net/") (synopsis "Light-weight interpreter for the Scheme programming language") (description "TinyScheme is a light-weight Scheme interpreter that implements as large a subset of R5RS as was possible without getting very large and complicated. It's meant to be used as an embedded scripting interpreter for other programs. As such, it does not offer an Integrated Development Environment (@dfn{IDE}) or extensive toolkits, although it does sport a small (and optional) top-level loop. As an embedded interpreter, it allows multiple interpreter states to coexist in the same program, without any interference between them. Foreign functions in C can be added and values can be defined in the Scheme environment. Being quite a small program, it is easy to comprehend, get to grips with, and use.") (license bsd-3))) ; there are no licence headers (define-public stalin (let ((commit "ed1c9e339c352b7a6fee40bb2a47607c3466f0be")) ;; FIXME: The Stalin "source" contains C code generated by itself: ;; 'stalin-AMD64.c', etc. (package (name "stalin") (version "0.11") (source (origin ;; Use Pearlmutter's upstream branch with AMD64 patches ;; applied. Saves us from including those 20M! patches ;; in Guix. For more info, see: ;; <ftp.ecn.purdue.edu/qobi/stalin-0.11-amd64-patches.tgz> (method git-fetch) (uri (git-reference (url "https://github.com/barak/stalin") (commit commit))) (file-name (string-append name "-" version "-checkout")) (sha256 (base32 "15a5gxj9v7jqlgkg0543gdflw0rbrir7fj5zgifnb33m074wiyhn")) (modules '((guix build utils))) (snippet ;; remove gc libs from build, we have them as input '(begin (delete-file "gc6.8.tar.gz") (delete-file-recursively "benchmarks") (substitute* "build" ((".*gc6.8.*") "") ((" cd \\.\\.") "") ((".*B include/libgc.a") "") ((".*make.*") "")) #t)))) (build-system gnu-build-system) (arguments `(#:make-flags (list "ARCH_OPTS=-freg-struct-return") #:phases (modify-phases %standard-phases (replace 'configure (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (include-out (string-append out "/include"))) (invoke "./build") (for-each (lambda (fname) (install-file fname include-out)) (find-files "include")) (substitute* "makefile" (("\\./include") include-out)) (substitute* "post-make" (("`pwd`") out)) #t))) (delete 'check) (replace 'install (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (install-file "stalin.1" (string-append out "/share/man/man1")) (install-file "stalin" (string-append out "/bin")) #t)))))) (inputs (list libx11)) (propagated-inputs (list libgc)) (supported-systems '("x86_64-linux")) (home-page "https://engineering.purdue.edu/~qobi/papers/fdlcc.pdf") (synopsis "Brutally efficient Scheme compiler") (description "Stalin is an aggressively optimizing whole-program compiler for Scheme that does polyvariant interprocedural flow analysis, flow-directed interprocedural escape analysis, flow-directed lightweight CPS conversion, flow-directed lightweight closure conversion, flow-directed interprocedural lifetime analysis, automatic in-lining, unboxing, and flow-directed program-specific and program-point-specific low-level representation selection and code generation.") (license gpl2+)))) (define-public s9fes (package (name "s9fes") (version "20181205") (source (origin (method url-fetch) (uri (string-append "https://www.t3x.org/s9fes/s9fes-" version ".tgz")) (sha256 (base32 "0ynpl707bc9drwkdpdgvw14bz9zmwd3wffl1k02sxppjl28xm7rf")))) (build-system gnu-build-system) (arguments `(#:make-flags (list (string-append "CC=" ,(cc-for-target)) (string-append "PREFIX=" %output)) #:phases (modify-phases %standard-phases (replace 'install (lambda* (#:key make-flags #:allow-other-keys) (apply invoke "make" "install-all" make-flags)))) #:tests? #f)) ; No check target. (inputs (list ncurses)) (home-page "https://www.t3x.org/s9fes/") (synopsis "Interpreter for R4RS Scheme") (description "Scheme 9 from Empty Space (S9fES) is a mature, portable, and comprehensible public-domain interpreter for R4RS Scheme offering: @itemize @item bignum arithmetics @item decimal-based real number arithmetics @item support for low-level Unix programming @item cursor addressing with Curses @item basic networking procedures @item an integrated online help system @item loads of useful library functions @end itemize") (license public-domain))) (define-public femtolisp (let ((commit "ec7601076a976f845bc05ad6bd3ed5b8cde58a97") (revision "2")) (package (name "femtolisp") (version (string-append "0.0.0-" revision "." (string-take commit 7))) (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/JeffBezanson/femtolisp") (commit commit))) (file-name (string-append name "-" version "-checkout")) (sha256 (base32 "1fcyiqlqn27nd4wxi27km8mhmlzpzzsxzpwsl1bxbmhraq468njw")))) ;; See "utils.h" for supported systems. Upstream bug: ;; https://github.com/JeffBezanson/femtolisp/issues/25 (supported-systems (fold delete %supported-systems '("armhf-linux" "mips64el-linux" "aarch64-linux"))) (build-system gnu-build-system) (arguments `(#:make-flags '("CC=gcc" "release") #:test-target "test" #:phases (modify-phases %standard-phases (delete 'bootstrap) (delete 'configure) ; No configure script (replace 'install ; Makefile has no 'install phase (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (bin (string-append out "/bin"))) (install-file "flisp" bin) #t))) ;; The flisp binary is now available, run bootstrap to ;; generate flisp.boot and afterwards runs make test. (add-after 'install 'bootstrap-gen-and-test (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (bin (string-append out "/bin"))) (invoke "./bootstrap.sh") (install-file "flisp.boot" bin) #t)))))) (synopsis "Scheme-like lisp implementation") (description "@code{femtolisp} is a scheme-like lisp implementation with a simple, elegant Scheme dialect. It is a lisp-1 with lexical scope. The core is 12 builtin special forms and 33 builtin functions.") (home-page "https://github.com/JeffBezanson/femtolisp") (license bsd-3)))) (define-public gauche (package (name "gauche") (version "0.9.12") (home-page "https://practical-scheme.net/gauche/index.html") (source (origin (method url-fetch) (uri (string-append "https://github.com/shirok/Gauche/releases/download/release" (string-replace-substring version "." "_") "/Gauche-" version ".tgz")) (sha256 (base32 "05xnym1phg8i14bacip5d0d3v0gc1nn5mgayd5hnda873f969bml")))) (build-system gnu-build-system) (inputs (list libatomic-ops slib zlib)) (native-inputs (list texinfo openssl ; needed for tests pkg-config)) ; needed to find external libatomic-ops (arguments `(#:configure-flags (list (string-append "--with-slib=" (assoc-ref %build-inputs "slib") "/lib/slib")) #:phases (modify-phases %standard-phases (add-after 'unpack 'patch-/bin/sh ;; Needed only for tests. (lambda _ (substitute* '("test/www.scm" "ext/tls/test.scm" "lib/gauche/package/util.scm" "libsrc/gauche/process.scm") (("/bin/sh") (which "sh"))) #t)) (add-after 'build 'build-doc (lambda _ (with-directory-excursion "doc" (invoke "make" "info")) #t)) (add-before 'check 'patch-network-tests ;; Remove net checks. (lambda _ (delete-file "test/net.scm") (invoke "touch" "test/net.scm") #t)) (add-after 'install 'install-docs (lambda _ (with-directory-excursion "doc" (invoke "make" "install")) #t))))) (synopsis "Scheme scripting engine") (description "Gauche is a R7RS Scheme scripting engine aiming at being a handy tool that helps programmers and system administrators to write small to large scripts quickly. Quick startup, built-in system interface, native multilingual support are some of the goals. Gauche comes with a package manager/installer @code{gauche-package} which can download, compile, install and list gauche extension packages.") (license bsd-3))) (define-public sbcl-airship-scheme (let ((commit "1862db81dfa67729444916c361f39f9f1c5a2ccd") (revision "0")) (package (name "sbcl-airship-scheme") (version (git-version "0.0.0" revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://gitlab.com/mbabich/airship-scheme.git") (commit commit))) (file-name (git-file-name "cl-airship-scheme" version)) (sha256 (base32 "1d1kvrzlx5kcfsn3rn30ww8jihjflpgcka3n3awj2k4f0sq4mplg")))) (build-system asdf-build-system/sbcl) (native-inputs (list sbcl-fiveam)) (inputs (list sbcl-alexandria sbcl-float-features sbcl-trivial-features sbcl-zr-utils)) (synopsis "R7RS Scheme implementation in Common Lisp") (description "This is a R7RS Scheme implementation designed to run within a Common Lisp environment.") (home-page "https://gitlab.com/mbabich/airship-scheme") (license expat)))) (define-public cl-airship-scheme (sbcl-package->cl-source-package sbcl-airship-scheme)) (define-public gerbil (package (name "gerbil") (version "0.17.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/vyzo/gerbil") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "0c0nspm659ybgmqlppdv7sxzll4hwkvcp9qmcsip6d0kz0p8r9c3")))) (arguments (list #:phases #~(modify-phases %standard-phases (delete 'bootstrap) (add-before 'configure 'chdir (lambda _ (chdir "src"))) (replace 'configure (lambda _ (invoke "chmod" "755" "-R" ".") ;; Otherwise fails when editing an r--r--r-- file. (invoke "gsi-script" "configure" "--prefix" #$output "--with-gambit" #$gambit-c))) (add-before 'patch-generated-file-shebangs 'fix-gxi-shebangs (lambda _ ;; Some .ss files refer to gxi using /usr/bin/env gxi ;; and 'patch-generated-file-shebangs can't fix that ;; because gxi has not been compiled yet. ;; We know where gxi is going to end up so we ;; Doctor Who our fix here before the problem ;; happens towards the end of the build.sh script. (let ((abs-srcdir (getcwd))) (for-each (lambda (f) (substitute* f (("#!/usr/bin/env gxi") (string-append "#!" abs-srcdir "/../bin/gxi")))) '("./gerbil/gxc" "./lang/build.ss" "./misc/http-perf/build.ss" "./misc/rpc-perf/build.ss" "./misc/scripts/docsnarf.ss" "./misc/scripts/docstub.ss" "./misc/scripts/docsyms.ss" "./r7rs-large/build.ss" "./release.ss" "./std/build.ss" "./std/run-tests.ss" "./std/web/fastcgi-test.ss" "./std/web/rack-test.ss" "./tools/build.ss" "./tutorial/httpd/build.ss" "./tutorial/kvstore/build.ss" "./tutorial/lang/build.ss" "./tutorial/proxy/build-static.ss" "./tutorial/proxy/build.ss"))))) (add-after 'configure 'create-gx-version.scm (lambda _ (with-output-to-file (string-append (getcwd) "/gerbil/runtime/gx-version.scm") (lambda _ (write `(define (gerbil-version-string) ,(string-append "v" #$(version-major+minor version)))))))) (replace 'build (lambda _ (setenv "HOME" (getcwd)) (invoke ;; The build script needs a tty or it'll crash on an ioctl ;; trying to find the width of the terminal it's running on. ;; Calling in script prevents that. "script" "-qefc" "./build.sh"))) (replace 'install (lambda _ (let* ((bin (string-append #$output "/bin")) (lib (string-append #$output "/lib"))) (mkdir-p bin) (mkdir-p lib) (copy-recursively "../bin" bin) (copy-recursively "../lib" lib))))) #:tests? #f)) (native-inputs (list coreutils gambit-c util-linux)) (propagated-inputs (list gambit-c openssl sqlite zlib)) (build-system gnu-build-system) (synopsis "Meta-dialect of Scheme with post-modern features") (description "Gerbil is an opinionated dialect of Scheme designed for Systems Programming, with a state of the art macro and module system on top of the Gambit runtime. The macro system is based on quote-syntax, and provides the full meta-syntactic tower with a native implementation of syntax-case. It also provides a full-blown module system, similar to PLT Scheme's (sorry, Racket) modules. The main difference from Racket is that Gerbil modules are single instantiation, supporting high performance ahead of time compilation and compiled macros.") (home-page "https://cons.io") (license `(,lgpl2.1 ,asl2.0)))) (define-public emacs-gerbil-mode (package (inherit gerbil) (name "emacs-gerbil-mode") (version "1.0") (build-system emacs-build-system) (arguments (list #:phases #~(modify-phases %standard-phases (add-before 'install 'change-directory (lambda _ (chdir "etc")))))) (synopsis "Emacs major-mode for editing Gerbil code") (description "Gerbil mode provides font-lock, indentation, navigation, and REPL for Gerbil code within Emacs."))) (define-public stklos (package (name "stklos") (version "1.70") (source (origin (method url-fetch) ;; TODO: Unbundle pcre, libgc, and libffi. (uri (string-append "https://stklos.net/download/stklos-" version ".tar.gz")) (sha256 (base32 "1iw3pgycjz3kz3jd1855v2ngf8ib2almpf8v058n1mkj1qd2b88m")))) (build-system gnu-build-system) (arguments (list #:modules `((ice-9 ftw) ,@%gnu-build-system-modules) #:phases #~(modify-phases %standard-phases (add-before 'configure 'patch-sh-references (lambda* (#:key inputs #:allow-other-keys) (let ((bash (which "bash"))) (substitute* "configure" (("/bin/sh") bash))))) (add-after 'configure 'patch-rm-references (lambda _ (let ((rm (which "rm"))) (substitute* (find-files "." "^Makefile$") (("/bin/rm") rm)))))))) (properties '((release-monitoring-url . "https://stklos.net/download.html"))) (home-page "https://stklos.net") (synopsis "R7RS Scheme with CLOS-like object system") (description "STklos is a free Scheme system mostly compliant with the languages features defined in R7RS small. The aim of this implementation is to be fast as well as light. The implementation is based on an ad-hoc Virtual Machine. STklos can also be compiled as a library and embedded in an application.") (license gpl2+)))