From 9b9f3bc1c8b3f1a1f64863cc360640a38a752514 Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Mon, 15 Mar 2021 18:11:32 -0400 Subject: [PATCH 05/53] gnu: bcunit: Enable examples. * gnu/packages/linphone.scm (bcunit) [outputs]: New output "example". [arguments]<#:configure-flag>[-DENABLE_EXAMPLES]: New flag. <#:phases>['patch-source]: New phase. ['seperate-outputs]: Modify. --- gnu/packages/linphone.scm | 72 ++++++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 28 deletions(-) diff --git a/gnu/packages/linphone.scm b/gnu/packages/linphone.scm index bbea6411f7..6b161d326f 100644 --- a/gnu/packages/linphone.scm +++ b/gnu/packages/linphone.scm @@ -73,36 +73,52 @@ (file-name (git-file-name name version)) (sha256 (base32 "0npdwvanjkfg9vrqs5yi8vh6wliv50ycdli8pzavir84nb31nq1b")))) - (build-system cmake-build-system) - (outputs '("out" "doc")) - (arguments - `(#:tests? #f ; No test target - #:configure-flags - (list - "-DENABLE_STATIC=NO" - "-DENABLE_CURSES=ON" - "-DENABLE_DOC=ON") - #:phases - (modify-phases %standard-phases - (add-after 'install 'seperate-outputs - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (doc (assoc-ref outputs "doc"))) - (mkdir-p (string-append doc "/share/doc")) - (rename-file - (string-append out "/share/doc/BCUnit") - (string-append doc "/share/doc/BCUnit"))) - #t))))) - (native-inputs - `(("perl" ,perl))) - (inputs - `(("ncurses" ,ncurses))) - (synopsis "Belledonne Communications Unit Testing Framework") - (description "BCUnit is a fork of the defunct project CUnit, with several + (build-system cmake-build-system) + (outputs '("out" "doc" "example")) + (arguments + `(#:tests? #f ; No test target + #:configure-flags + (list + "-DENABLE_STATIC=NO" + "-DENABLE_CURSES=ON" + "-DENABLE_DOC=ON" + "-DENABLE_EXAMPLES=ON") + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-source + (lambda _ + ;; Include BCunit headers for examples. + (substitute* "Examples/CMakeLists.txt" + (("\\$\\{CMAKE_CURRENT_SOURCE_DIR\\}") + (string-append "${CMAKE_CURRENT_SOURCE_DIR} " + "${PROJECT_SOURCE_DIR}/BCUnit/Headers " + "${CMAKE_BINARY_DIR}/BCUnit/Headers"))) + #t)) + (add-after 'install 'seperate-outputs + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (doc (assoc-ref outputs "doc")) + (example (assoc-ref outputs "example"))) + (for-each mkdir-p + `(,(string-append doc "/share/doc") + ,(string-append example "/share/BCUnit"))) + (rename-file + (string-append out "/share/doc/BCUnit") + (string-append doc "/share/doc/BCUnit")) + (rename-file + (string-append out "/share/BCUnit/Examples") + (string-append example "/share/BCUnit/Examples"))) + #t))))) + (native-inputs + `(("perl" ,perl))) + (inputs + `(("ncurses" ,ncurses))) + (synopsis "Belledonne Communications Unit Testing Framework") + (description "BCUnit is a fork of the defunct project CUnit, with several fixes and patches applied. It is an unit testing framework for writing, administering, and running unit tests in C.") - (home-page "https://gitlab.linphone.org/BC/public/bcunit") - (license license:lgpl2.0+)))) + (home-page "https://gitlab.linphone.org/BC/public/bcunit") + (license license:lgpl2.0+)))) (define-public bctoolbox (package -- 2.31.0