gnu: bctoolbox: Update to 5.3.57.

* gnu/packages/linphone.scm (bctoolbox): Update to 5.3.57.
[arguments] <configure-flags>: Replace -DENABLE_STATIC=OFF with
-DBUILD_SHARED_LIBS=ON.
<phases>: Use gexps.  Use search-input-directory in patch-cmake phase.  Adjust
tester file name in check phase override.

Change-Id: I4571c238268220c0ac11f42f3caec3e41c879331
This commit is contained in:
Maxim Cournoyer 2024-06-08 23:34:45 -04:00 committed by Maxim Cournoyer
parent 1997b0d3b5
commit fb76d9ddda
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -124,7 +124,7 @@ writing, administering, and running unit tests in C.")
(define-public bctoolbox (define-public bctoolbox
(package (package
(name "bctoolbox") (name "bctoolbox")
(version "5.2.49") (version "5.3.57")
(source (source
(origin (origin
(method git-fetch) (method git-fetch)
@ -133,52 +133,51 @@ writing, administering, and running unit tests in C.")
(commit version))) (commit version)))
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 "0b51308jy5z32gp594r78jvbyrha16sanxdnbcmxgrwnb4myqx5j")))) (base32 "178axy7gmmi6fzjbz7aaawcx0qg50i4hnn7ab6w642b02vxfr386"))))
(build-system cmake-build-system) (build-system cmake-build-system)
(outputs '("out" "debug")) (outputs '("out" "debug"))
(arguments (arguments
`(#:configure-flags (list "-DENABLE_STATIC=OFF" (list
;; Do not use -Werror, because due to skipping #:configure-flags #~(list "-DBUILD_SHARED_LIBS=ON"
;; a test there are unused procedures. ;; Do not use -Werror, because due to skipping
"-DENABLE_STRICT=OFF") ;; a test there are unused procedures.
#:phases "-DENABLE_STRICT=OFF")
(modify-phases %standard-phases #:phases
(add-after 'unpack 'patch-cmake #~(modify-phases %standard-phases
(lambda* (#:key inputs #:allow-other-keys) (add-after 'unpack 'patch-cmake
;; Fix decaf dependency (see: (lambda* (#:key inputs #:allow-other-keys)
;; https://gitlab.linphone.org/BC/public/bctoolbox/-/issues/3). ;; Fix decaf dependency (see:
(let* ((decaf (assoc-ref inputs "libdecaf"))) ;; https://gitlab.linphone.org/BC/public/bctoolbox/-/issues/3).
(substitute* (find-files "." "CMakeLists.txt") (substitute* (find-files "." "CMakeLists.txt")
(("find_package\\(Decaf CONFIG\\)") (("find_package\\(Decaf CONFIG\\)")
"set(DECAF_FOUND 1)") "set(DECAF_FOUND 1)")
(("\\$\\{DECAF_INCLUDE_DIRS\\}") (("\\$\\{DECAF_INCLUDE_DIRS\\}")
(string-append decaf "/include/decaf")) (search-input-directory inputs "include/decaf"))
(("\\$\\{DECAF_TARGETNAME\\}") (("\\$\\{DECAF_TARGETNAME\\}")
"decaf"))))) "decaf"))))
(add-after 'unpack 'skip-problematic-tests (add-after 'unpack 'skip-problematic-tests
(lambda _ (lambda _
;; The following test relies on networking; disable it. ;; The following test relies on networking; disable it.
(substitute* "tester/port.c" (substitute* "tester/port.c"
(("[ \t]*TEST_NO_TAG.*bctbx_addrinfo_sort_test\\),") (("[ \t]*TEST_NO_TAG.*bctbx_addrinfo_sort_test\\),")
"")))) ""))))
(add-after 'unpack 'fix-installed-resource-directory-detection (add-after 'unpack 'fix-installed-resource-directory-detection
(lambda _ (lambda _
;; There's some broken logic in tester.c that checks if CWD, or ;; 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 ;; if its parent exist, and if so, sets the prefix where the test
;; resources are looked up to; disable it (see: ;; resources are looked up to; disable it (see:
;; https://gitlab.linphone.org/BC/public/bctoolbox/-/issues/4). ;; https://gitlab.linphone.org/BC/public/bctoolbox/-/issues/4).
(substitute* "src/tester.c" (substitute* "src/tester.c"
(("if \\(file_exists\\(\".\"\\)\\)") (("if \\(file_exists\\(\".\"\\)\\)")
"if (NULL)") "if (NULL)")
(("if \\(file_exists\\(\"..\"\\)\\)") (("if \\(file_exists\\(\"..\"\\)\\)")
"if (NULL)")))) "if (NULL)"))))
(replace 'check (replace 'check
(lambda* (#:key tests? #:allow-other-keys) (lambda* (#:key tests? #:allow-other-keys)
(when tests? (when tests?
(with-directory-excursion "tester" (with-directory-excursion "tester"
(invoke "./bctoolbox_tester")))))))) (invoke "./bctoolbox-tester"))))))))
(inputs (inputs (list bcunit libdecaf mbedtls-lts))
(list bcunit libdecaf mbedtls-lts))
(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.")