Subject: [bug#55125] [PATCH 3/9] gnu: tabixpp: Use build tools specific to the target.

From: Arun Isaac <[email-masked]>
Date: Tue, 26 Apr 2022 18:16:33 +0530

* gnu/packages/bioinformatics.scm (tabixpp)[arguments]: Set CC and CXX in
#:make-flags. In the build-libraries phase, use cxx-for-target instead of g++
and ar-for-target instead of ar.
---
 gnu/packages/bioinformatics.scm | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 6c24c1c26f..e745fa9353 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -14279,7 +14279,9 @@ (define-public tabixpp
    (inputs
     (list htslib zlib))
    (arguments
-    (list #:make-flags #~(list "HTS_HEADERS="
+    (list #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
+                               (string-append "CXX=" #$(cxx-for-target))
+                               "HTS_HEADERS="
                                (string-append "HTS_LIB="
                                               (search-input-file %build-inputs
                                                                  "/lib/libhts.a"))
@@ -14291,8 +14293,9 @@ (define-public tabixpp
               ;; Build shared and static libraries.
               (add-after 'build 'build-libraries
                 (lambda* (#:key inputs #:allow-other-keys)
-                  (invoke "g++" "-shared" "-o" "libtabixpp.so" "tabix.o" "-lhts")
-                  (invoke "ar" "rcs" "libtabixpp.a" "tabix.o")))
+                  (invoke #$(cxx-for-target)
+                          "-shared" "-o" "libtabixpp.so" "tabix.o" "-lhts")
+                  (invoke #$(ar-for-target) "rcs" "libtabixpp.a" "tabix.o")))
               (replace 'install
                 (lambda* (#:key outputs #:allow-other-keys)
                   (let* ((out (assoc-ref outputs "out"))
-- 
2.35.1