gnu: bctoolbox: Update to 4.4.34 and enable libdecaf, tests.

* gnu/packages/linphone.scm (bctoolbox)[version]: Update to 4.4.34.
[source]: Switch to git repository.
[outputs]: Add a debug output.
[arguments]: Remove tests? argument, enabling tests.
[phases]{patch-cmake, skip-problematic-tests}
{fix-installed-resource-directory-detection}: New phases.
{check}: Override phase.
[inputs]: Add libdecaf.
[license]: Update to GPLv3+.

Co-authored-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
This commit is contained in:
Raghav Gururajan 2021-03-13 14:00:48 -05:00 committed by Maxim Cournoyer
parent 414fc58cef
commit bdd0d5bfbd
No known key found for this signature in database
GPG Key ID: 1260E46482E63562

View File

@ -1,7 +1,7 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; ;;;
;;; Copyright © 2020 Raghav Gururajan <raghavgururajan@disroot.org> ;;; Copyright © 2020, 2021 Raghav Gururajan <raghavgururajan@disroot.org>
;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
@ -25,6 +25,7 @@
#:use-module (gnu packages audio) #:use-module (gnu packages audio)
#:use-module (gnu packages base) #:use-module (gnu packages base)
#:use-module (gnu packages compression) #:use-module (gnu packages compression)
#:use-module (gnu packages crypto)
#:use-module (gnu packages documentation) #:use-module (gnu packages documentation)
#:use-module (gnu packages gettext) #:use-module (gnu packages gettext)
#:use-module (gnu packages gl) #:use-module (gnu packages gl)
@ -127,28 +128,64 @@ writing, administering, and running unit tests in C.")
(define-public bctoolbox (define-public bctoolbox
(package (package
(name "bctoolbox") (name "bctoolbox")
(version "0.6.0") (version "4.4.34")
(source (source
(origin (origin
(method url-fetch) (method git-fetch)
(uri (uri (git-reference
(string-append "https://www.linphone.org/releases/sources/" name (url "https://gitlab.linphone.org/BC/public/bctoolbox.git")
"/" name "-" version ".tar.gz")) (commit version)))
(file-name (git-file-name name version))
(sha256 (sha256
(base32 "1a1i70pb4hhnykkwyhhc7fv67q556l8kprny8xzgfqpj1nby2ms6")))) (base32 "0bfswwvvdshaahg4jd2j10f0sci8809s4khajd0m6b059zwc7y25"))))
(build-system cmake-build-system) (build-system cmake-build-system)
(outputs '("out" "debug"))
(arguments (arguments
'(#:tests? #f ; No test target `(#:configure-flags '("-DENABLE_STATIC=OFF")
#:configure-flags #:phases
(list "-DENABLE_STATIC=OFF"))) ; Not required (modify-phases %standard-phases
(add-after 'unpack 'patch-cmake
(lambda* (#:key inputs #:allow-other-keys)
;; Fix decaf dependency (see:
;; https://gitlab.linphone.org/BC/public/bctoolbox/-/issues/3).
(let* ((decaf (assoc-ref inputs "decaf")))
(substitute* (find-files "." "CMakeLists.txt")
(("find_package\\(Decaf CONFIG\\)")
"set(DECAF_FOUND 1)")
(("\\$\\{DECAF_INCLUDE_DIRS\\}")
(string-append decaf "/include/decaf"))
(("\\$\\{DECAF_TARGETNAME\\}")
"decaf")))))
(add-after 'unpack 'skip-problematic-tests
(lambda _
;; The following test relies on networking; disable it.
(substitute* "tester/port.c"
(("[ \t]*TEST_NO_TAG.*bctbx_addrinfo_sort_test\\)")
""))))
(add-after 'unpack 'fix-installed-resource-directory-detection
(lambda _
;; There's some broken logic in tester.c that checks if CWD, or
;; if its parent exist, and if so, sets the prefix where the test
;; resources are looked up to; disable it (see:
;; https://gitlab.linphone.org/BC/public/bctoolbox/-/issues/4).
(substitute* "src/tester.c"
(("if \\(file_exists\\(\".\"\\)\\)")
"if (NULL)")
(("if \\(file_exists\\(\"..\"\\)\\)")
"if (NULL)"))))
(replace 'check
(lambda _
(with-directory-excursion "tester"
(invoke "./bctoolbox_tester")))))))
(inputs (inputs
`(("bcunit" ,bcunit) `(("bcunit" ,bcunit)
("decaf" ,libdecaf)
("mbedtls" ,mbedtls-apache))) ("mbedtls" ,mbedtls-apache)))
(synopsis "Belledonne Communications Tool Box") (synopsis "Belledonne Communications Tool Box")
(description "BcToolBox is an utilities library used by Belledonne (description "BcToolBox is an utilities library used by Belledonne
Communications software like belle-sip, mediastreamer2 and linphone.") Communications software like belle-sip, mediastreamer2 and linphone.")
(home-page "https://gitlab.linphone.org/BC/public/bctoolbox") (home-page "https://gitlab.linphone.org/BC/public/bctoolbox")
(license license:gpl2+))) (license license:gpl3+)))
(define-public belr (define-public belr
(package (package