+ #:use-module (guix build-system gnu)
+ #:use-module (guix build-system qt))
+
+(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
+ `(("pkg-config" ,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