unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#55125] [PATCH 0/9] Cross-compile vcflib for RISC-V
@ 2022-04-26 12:44 Arun Isaac
  2022-04-26 12:46 ` [bug#55125] [PATCH 1/9] gnu: tabixpp: Use G-expressions Arun Isaac
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Arun Isaac @ 2022-04-26 12:44 UTC (permalink / raw)
  To: 55125; +Cc: Arun Isaac

This patchset patches the vcflib package and dependencies so that they
successfully cross-compile for the riscv64-linux-gnu target.

Arun Isaac (9):
  gnu: tabixpp: Use G-expressions.
  gnu: tabixpp: Use #:make-flags.
  gnu: tabixpp: Use build tools specific to the target.
  gnu: tabixpp: Add bzip2 and xz to inputs.
  gnu: fastahack: Use G-expressions.
  gnu: fastahack: Use compiler specific to the build target.
  gnu: vcflib: Use G-expressions.
  gnu: vcflib: Find submodule sources in native-inputs during
    cross-compilation.
  gnu: vcflib: Set absolute path to pkg-config.

 gnu/packages/bioinformatics.scm | 257 ++++++++++++++++----------------
 1 file changed, 132 insertions(+), 125 deletions(-)

-- 
2.35.1





^ permalink raw reply	[flat|nested] 13+ messages in thread

* [bug#55125] [PATCH 1/9] gnu: tabixpp: Use G-expressions.
  2022-04-26 12:44 [bug#55125] [PATCH 0/9] Cross-compile vcflib for RISC-V Arun Isaac
@ 2022-04-26 12:46 ` Arun Isaac
  2022-04-26 12:46   ` [bug#55125] [PATCH 2/9] gnu: tabixpp: Use #:make-flags Arun Isaac
                     ` (7 more replies)
  2022-05-07 21:45 ` [bug#55125] [PATCH 0/9] Cross-compile vcflib for RISC-V Ludovic Courtès
  2022-05-09  8:31 ` bug#55125: " Efraim Flashner
  2 siblings, 8 replies; 13+ messages in thread
From: Arun Isaac @ 2022-04-26 12:46 UTC (permalink / raw)
  To: 55125; +Cc: Arun Isaac

* gnu/packages/bioinformatics.scm (tabixpp)[source]: Reindent.
[arguments]: Use search-input-file and search-input-directory.
[source, arguments]: Rewrite using G-expressions. Do not return #t from
snippets and custom phases.
---
 gnu/packages/bioinformatics.scm | 80 ++++++++++++++++-----------------
 1 file changed, 39 insertions(+), 41 deletions(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 40ccba247c..774da809d8 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -14264,49 +14264,48 @@ (define-public tabixpp
    (name "tabixpp")
    (version "1.1.0")
    (source (origin
-     (method git-fetch)
-     (uri (git-reference
-           (url "https://github.com/ekg/tabixpp")
-           (commit (string-append "v" version))))
-     (file-name (git-file-name name version))
-     (sha256
-      (base32 "1k2a3vbq96ic4lw72iwp5s3mwwc4xhdffjj584yn6l9637q9j1yd"))
-     (modules '((guix build utils)))
-     (snippet
-      `(begin
-         (delete-file-recursively "htslib") #t))))
+             (method git-fetch)
+             (uri (git-reference
+                   (url "https://github.com/ekg/tabixpp")
+                   (commit (string-append "v" version))))
+             (file-name (git-file-name name version))
+             (sha256
+              (base32 "1k2a3vbq96ic4lw72iwp5s3mwwc4xhdffjj584yn6l9637q9j1yd"))
+             (modules '((guix build utils)))
+             (snippet
+              #~(begin
+                  (delete-file-recursively "htslib")))))
    (build-system gnu-build-system)
    (inputs
     (list htslib zlib))
    (arguments
-    `(#:tests? #f ; There are no tests to run.
-      #:phases
-      (modify-phases %standard-phases
-        (delete 'configure) ; There is no configure phase.
-        ;; The build phase needs overriding the location of htslib.
-        (replace 'build
-          (lambda* (#:key inputs #:allow-other-keys)
-            (let ((htslib-ref (assoc-ref inputs "htslib")))
-              (invoke "make"
-                      (string-append "HTS_LIB=" htslib-ref "/lib/libhts.a")
-                      (string-append "INCLUDES= -I" htslib-ref "/include/htslib")
-                      "HTS_HEADERS="    ; No need to check for headers here.
-                      (string-append "LIBPATH=-L. -L" htslib-ref "/include"))
-              (invoke "g++" "-shared" "-o" "libtabixpp.so" "tabix.o" "-lhts")
-              (invoke "ar" "rcs" "libtabixpp.a" "tabix.o"))))
-        (replace 'install
-          (lambda* (#:key outputs #:allow-other-keys)
-            (let* ((out (assoc-ref outputs "out"))
-                   (lib (string-append out "/lib"))
-                   (bin (string-append out "/bin")))
-              (install-file "tabix++" bin)
-              (install-file "libtabixpp.so" lib)
-              (install-file "libtabixpp.a" lib)
-              (install-file "tabix.hpp" (string-append out "/include"))
-              (mkdir-p (string-append lib "/pkgconfig"))
-              (with-output-to-file (string-append lib "/pkgconfig/tabixpp.pc")
-                (lambda _
-                  (format #t "prefix=~a~@
+    (list #:tests? #f ; There are no tests to run.
+          #:phases
+          #~(modify-phases %standard-phases
+              (delete 'configure) ; There is no configure phase.
+              ;; The build phase needs overriding the location of htslib.
+              (replace 'build
+                (lambda* (#:key inputs #:allow-other-keys)
+                  (invoke "make"
+                          (string-append "HTS_LIB=" (search-input-file inputs "/lib/libhts.a"))
+                          (string-append "INCLUDES= -I" (search-input-directory inputs "/include/htslib"))
+                          "HTS_HEADERS=" ; No need to check for headers here.
+                          (string-append "LIBPATH=-L. -L" (search-input-directory inputs "/include")))
+                  (invoke "g++" "-shared" "-o" "libtabixpp.so" "tabix.o" "-lhts")
+                  (invoke "ar" "rcs" "libtabixpp.a" "tabix.o")))
+              (replace 'install
+                (lambda* (#:key outputs #:allow-other-keys)
+                  (let* ((out (assoc-ref outputs "out"))
+                         (lib (string-append out "/lib"))
+                         (bin (string-append out "/bin")))
+                    (install-file "tabix++" bin)
+                    (install-file "libtabixpp.so" lib)
+                    (install-file "libtabixpp.a" lib)
+                    (install-file "tabix.hpp" (string-append out "/include"))
+                    (mkdir-p (string-append lib "/pkgconfig"))
+                    (with-output-to-file (string-append lib "/pkgconfig/tabixpp.pc")
+                      (lambda _
+                        (format #t "prefix=~a~@
                           exec_prefix=${prefix}~@
                           libdir=${exec_prefix}/lib~@
                           includedir=${prefix}/include~@
@@ -14317,8 +14316,7 @@ (define-public tabixpp
                           Description: C++ wrapper around tabix project~@
                           Libs: -L${libdir} -ltabixpp~@
                           Cflags: -I${includedir}~%"
-                          out ,version)))
-              #t))))))
+                                out #$version)))))))))
    (home-page "https://github.com/ekg/tabixpp")
    (synopsis "C++ wrapper around tabix project")
    (description "This is a C++ wrapper around the Tabix project which abstracts
-- 
2.35.1





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#55125] [PATCH 2/9] gnu: tabixpp: Use #:make-flags.
  2022-04-26 12:46 ` [bug#55125] [PATCH 1/9] gnu: tabixpp: Use G-expressions Arun Isaac
@ 2022-04-26 12:46   ` Arun Isaac
  2022-04-26 12:46   ` [bug#55125] [PATCH 3/9] gnu: tabixpp: Use build tools specific to the target Arun Isaac
                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Arun Isaac @ 2022-04-26 12:46 UTC (permalink / raw)
  To: 55125; +Cc: Arun Isaac

* gnu/packages/bioinformatics.scm (tabixpp)[arguments]: Do not override the
build phase. Move the required make arguments to #:make-flags. Add
build-libraries phase.
---
 gnu/packages/bioinformatics.scm | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 774da809d8..6c24c1c26f 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -14279,18 +14279,18 @@ (define-public tabixpp
    (inputs
     (list htslib zlib))
    (arguments
-    (list #:tests? #f ; There are no tests to run.
+    (list #:make-flags #~(list "HTS_HEADERS="
+                               (string-append "HTS_LIB="
+                                              (search-input-file %build-inputs
+                                                                 "/lib/libhts.a"))
+                               "INCLUDES=")
+          #:tests? #f ; There are no tests to run.
           #:phases
           #~(modify-phases %standard-phases
               (delete 'configure) ; There is no configure phase.
-              ;; The build phase needs overriding the location of htslib.
-              (replace 'build
+              ;; Build shared and static libraries.
+              (add-after 'build 'build-libraries
                 (lambda* (#:key inputs #:allow-other-keys)
-                  (invoke "make"
-                          (string-append "HTS_LIB=" (search-input-file inputs "/lib/libhts.a"))
-                          (string-append "INCLUDES= -I" (search-input-directory inputs "/include/htslib"))
-                          "HTS_HEADERS=" ; No need to check for headers here.
-                          (string-append "LIBPATH=-L. -L" (search-input-directory inputs "/include")))
                   (invoke "g++" "-shared" "-o" "libtabixpp.so" "tabix.o" "-lhts")
                   (invoke "ar" "rcs" "libtabixpp.a" "tabix.o")))
               (replace 'install
-- 
2.35.1





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#55125] [PATCH 3/9] gnu: tabixpp: Use build tools specific to the target.
  2022-04-26 12:46 ` [bug#55125] [PATCH 1/9] gnu: tabixpp: Use G-expressions Arun Isaac
  2022-04-26 12:46   ` [bug#55125] [PATCH 2/9] gnu: tabixpp: Use #:make-flags Arun Isaac
@ 2022-04-26 12:46   ` Arun Isaac
  2022-04-26 12:46   ` [bug#55125] [PATCH 4/9] gnu: tabixpp: Add bzip2 and xz to inputs Arun Isaac
                     ` (5 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Arun Isaac @ 2022-04-26 12:46 UTC (permalink / raw)
  To: 55125; +Cc: Arun Isaac

* 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





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#55125] [PATCH 4/9] gnu: tabixpp: Add bzip2 and xz to inputs.
  2022-04-26 12:46 ` [bug#55125] [PATCH 1/9] gnu: tabixpp: Use G-expressions Arun Isaac
  2022-04-26 12:46   ` [bug#55125] [PATCH 2/9] gnu: tabixpp: Use #:make-flags Arun Isaac
  2022-04-26 12:46   ` [bug#55125] [PATCH 3/9] gnu: tabixpp: Use build tools specific to the target Arun Isaac
@ 2022-04-26 12:46   ` Arun Isaac
  2022-04-26 12:46   ` [bug#55125] [PATCH 5/9] gnu: fastahack: Use G-expressions Arun Isaac
                     ` (4 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Arun Isaac @ 2022-04-26 12:46 UTC (permalink / raw)
  To: 55125; +Cc: Arun Isaac

tabixpp links to libbz2 from bzip2 and liblzma from xz. Therefore, bzip2 and
xz should be listed in inputs even though they are already present implicitly
in native-inputs. Else, cross-compilation will fail.

* gnu/packages/bioinformatics.scm (tabixpp)[inputs]: Add bzip2 and xz.
---
 gnu/packages/bioinformatics.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index e745fa9353..7cdbb748ef 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -14277,7 +14277,7 @@ (define-public tabixpp
                   (delete-file-recursively "htslib")))))
    (build-system gnu-build-system)
    (inputs
-    (list htslib zlib))
+    (list bzip2 htslib xz zlib))
    (arguments
     (list #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
                                (string-append "CXX=" #$(cxx-for-target))
-- 
2.35.1





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#55125] [PATCH 5/9] gnu: fastahack: Use G-expressions.
  2022-04-26 12:46 ` [bug#55125] [PATCH 1/9] gnu: tabixpp: Use G-expressions Arun Isaac
                     ` (2 preceding siblings ...)
  2022-04-26 12:46   ` [bug#55125] [PATCH 4/9] gnu: tabixpp: Add bzip2 and xz to inputs Arun Isaac
@ 2022-04-26 12:46   ` Arun Isaac
  2022-04-26 12:46   ` [bug#55125] [PATCH 6/9] gnu: fastahack: Use compiler specific to the build target Arun Isaac
                     ` (3 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Arun Isaac @ 2022-04-26 12:46 UTC (permalink / raw)
  To: 55125; +Cc: Arun Isaac

* gnu/packages/bioinformatics.scm (fastahack)[arguments]: Rewrite
using G-expressions. Do not return #t from custom phases.
---
 gnu/packages/bioinformatics.scm | 60 ++++++++++++++++-----------------
 1 file changed, 29 insertions(+), 31 deletions(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 7cdbb748ef..699a4eaf47 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -14483,36 +14483,35 @@ (define-public fastahack
        (base32 "0rp1blskhzxf7vbh253ibpxbgl9wwgyzf1wbkxndi08d3j4vcss9"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:tests? #f ; Unclear how to run tests: https://github.com/ekg/fastahack/issues/15
-       #:phases
-       (modify-phases %standard-phases
-         (delete 'configure) ; There is no configure phase.
-           (add-after 'unpack 'patch-source
-             (lambda _
-               (substitute* "Makefile"
-                 (("-c ") "-c -fPIC "))
-               #t))
-         (add-after 'build 'build-dynamic
-           (lambda _
-             (invoke "g++"
-                     "-shared" "-o" "libfastahack.so"
-                     "Fasta.o" "FastaHack.o" "split.o" "disorder.o")))
-         (replace 'install
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (lib (string-append out "/lib"))
-                    (bin (string-append out "/bin")))
-               (mkdir-p (string-append out "/include/fastahack"))
-               (for-each
-                 (lambda (file)
-                   (install-file file (string-append out "/include/fastahack")))
-                 (find-files "." "\\.h$"))
-               (install-file "fastahack" bin)
-               (install-file "libfastahack.so" lib)
-               (mkdir-p (string-append lib "/pkgconfig"))
-               (with-output-to-file (string-append lib "/pkgconfig/fastahack.pc")
+     (list #:tests? #f ; Unclear how to run tests: https://github.com/ekg/fastahack/issues/15
+           #:phases
+           #~(modify-phases %standard-phases
+               (delete 'configure) ; There is no configure phase.
+               (add-after 'unpack 'patch-source
                  (lambda _
-                   (format #t "prefix=~a~@
+                   (substitute* "Makefile"
+                     (("-c ") "-c -fPIC "))))
+               (add-after 'build 'build-dynamic
+                 (lambda _
+                   (invoke "g++"
+                           "-shared" "-o" "libfastahack.so"
+                           "Fasta.o" "FastaHack.o" "split.o" "disorder.o")))
+               (replace 'install
+                 (lambda* (#:key outputs #:allow-other-keys)
+                   (let* ((out (assoc-ref outputs "out"))
+                          (lib (string-append out "/lib"))
+                          (bin (string-append out "/bin")))
+                     (mkdir-p (string-append out "/include/fastahack"))
+                     (for-each
+                      (lambda (file)
+                        (install-file file (string-append out "/include/fastahack")))
+                      (find-files "." "\\.h$"))
+                     (install-file "fastahack" bin)
+                     (install-file "libfastahack.so" lib)
+                     (mkdir-p (string-append lib "/pkgconfig"))
+                     (with-output-to-file (string-append lib "/pkgconfig/fastahack.pc")
+                       (lambda _
+                         (format #t "prefix=~a~@
                            exec_prefix=${prefix}~@
                            libdir=${exec_prefix}/lib~@
                            includedir=${prefix}/include/fastahack~@
@@ -14523,8 +14522,7 @@ (define-public fastahack
                            Description: Indexing and sequence extraction from FASTA files~@
                            Libs: -L${libdir} -lfastahack~@
                            Cflags: -I${includedir}~%"
-                           out ,version))))
-             #t)))))
+                                 out #$version)))))))))
     (home-page "https://github.com/ekg/fastahack")
     (synopsis "Indexing and sequence extraction from FASTA files")
     (description "Fastahack is a small application for indexing and
-- 
2.35.1





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#55125] [PATCH 6/9] gnu: fastahack: Use compiler specific to the build target.
  2022-04-26 12:46 ` [bug#55125] [PATCH 1/9] gnu: tabixpp: Use G-expressions Arun Isaac
                     ` (3 preceding siblings ...)
  2022-04-26 12:46   ` [bug#55125] [PATCH 5/9] gnu: fastahack: Use G-expressions Arun Isaac
@ 2022-04-26 12:46   ` Arun Isaac
  2022-04-26 12:46   ` [bug#55125] [PATCH 7/9] gnu: vcflib: Use G-expressions Arun Isaac
                     ` (2 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Arun Isaac @ 2022-04-26 12:46 UTC (permalink / raw)
  To: 55125; +Cc: Arun Isaac

* gnu/packages/bioinformatics.scm (fastahack)[arguments]: Set CXX in
#:make-flags. In the build-dynamic phase, use cxx-for-target instead of g++.
---
 gnu/packages/bioinformatics.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 699a4eaf47..ad69ca59cf 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -14483,7 +14483,8 @@ (define-public fastahack
        (base32 "0rp1blskhzxf7vbh253ibpxbgl9wwgyzf1wbkxndi08d3j4vcss9"))))
     (build-system gnu-build-system)
     (arguments
-     (list #:tests? #f ; Unclear how to run tests: https://github.com/ekg/fastahack/issues/15
+     (list #:make-flags #~(list (string-append "CXX=" #$(cxx-for-target)))
+           #:tests? #f ; Unclear how to run tests: https://github.com/ekg/fastahack/issues/15
            #:phases
            #~(modify-phases %standard-phases
                (delete 'configure) ; There is no configure phase.
@@ -14493,7 +14494,7 @@ (define-public fastahack
                      (("-c ") "-c -fPIC "))))
                (add-after 'build 'build-dynamic
                  (lambda _
-                   (invoke "g++"
+                   (invoke #$(cxx-for-target)
                            "-shared" "-o" "libfastahack.so"
                            "Fasta.o" "FastaHack.o" "split.o" "disorder.o")))
                (replace 'install
-- 
2.35.1





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#55125] [PATCH 7/9] gnu: vcflib: Use G-expressions.
  2022-04-26 12:46 ` [bug#55125] [PATCH 1/9] gnu: tabixpp: Use G-expressions Arun Isaac
                     ` (4 preceding siblings ...)
  2022-04-26 12:46   ` [bug#55125] [PATCH 6/9] gnu: fastahack: Use compiler specific to the build target Arun Isaac
@ 2022-04-26 12:46   ` Arun Isaac
  2022-04-26 12:46   ` [bug#55125] [PATCH 8/9] gnu: vcflib: Find submodule sources in native-inputs during cross-compilation Arun Isaac
  2022-04-26 12:46   ` [bug#55125] [PATCH 9/9] gnu: vcflib: Set absolute path to pkg-config Arun Isaac
  7 siblings, 0 replies; 13+ messages in thread
From: Arun Isaac @ 2022-04-26 12:46 UTC (permalink / raw)
  To: 55125; +Cc: Arun Isaac

* gnu/packages/bioinformatics.scm (vcflib)[source, arguments]: Rewrite using
G-expressions.
[arguments]: Do not return #t from custom phases.
---
 gnu/packages/bioinformatics.scm | 103 ++++++++++++++++----------------
 1 file changed, 51 insertions(+), 52 deletions(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index ad69ca59cf..d74b8a0eb6 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -14548,27 +14548,27 @@ (define-public vcflib
         (base32 "1r7pnajg997zdjkf1b38m14v0zqnfx52w7nbldwh1xpbpahb1hjh"))
        (modules '((guix build utils)))
        (snippet
-        '(begin
-           (substitute* "CMakeLists.txt"
-             ((".*fastahack.*") "")
-             ((".*smithwaterman.*") "")
-             (("(pkg_check_modules\\(TABIXPP)" text)
-              (string-append
+        #~(begin
+            (substitute* "CMakeLists.txt"
+              ((".*fastahack.*") "")
+              ((".*smithwaterman.*") "")
+              (("(pkg_check_modules\\(TABIXPP)" text)
+               (string-append
                 "pkg_check_modules(FASTAHACK REQUIRED fastahack)\n"
                 "pkg_check_modules(SMITHWATERMAN REQUIRED smithwaterman)\n"
                 text))
-             (("\\$\\{TABIXPP_LIBRARIES\\}" text)
-              (string-append "${FASTAHACK_LIBRARIES} "
-                             "${SMITHWATERMAN_LIBRARIES} "
-                             text)))
-           (substitute* (find-files "." "\\.(h|c)(pp)?$")
-             (("\"SmithWatermanGotoh.h\"") "<smithwaterman/SmithWatermanGotoh.h>")
-             (("\"convert.h\"") "<smithwaterman/convert.h>")
-             (("\"disorder.h\"") "<smithwaterman/disorder.h>")
-             (("Fasta.h") "fastahack/Fasta.h"))
-           (for-each delete-file-recursively
-                     '("fastahack" "filevercmp" "fsom" "googletest" "intervaltree"
-                       "libVCFH" "multichoose" "smithwaterman"))))))
+              (("\\$\\{TABIXPP_LIBRARIES\\}" text)
+               (string-append "${FASTAHACK_LIBRARIES} "
+                              "${SMITHWATERMAN_LIBRARIES} "
+                              text)))
+            (substitute* (find-files "." "\\.(h|c)(pp)?$")
+              (("\"SmithWatermanGotoh.h\"") "<smithwaterman/SmithWatermanGotoh.h>")
+              (("\"convert.h\"") "<smithwaterman/convert.h>")
+              (("\"disorder.h\"") "<smithwaterman/disorder.h>")
+              (("Fasta.h") "fastahack/Fasta.h"))
+            (for-each delete-file-recursively
+                      '("fastahack" "filevercmp" "fsom" "googletest" "intervaltree"
+                        "libVCFH" "multichoose" "smithwaterman"))))))
     (build-system cmake-build-system)
     (inputs
      (list bzip2
@@ -14589,39 +14589,39 @@ (define-public vcflib
        ("intervaltree-src" ,(package-source intervaltree))
        ("multichoose-src" ,(package-source multichoose))))
     (arguments
-     `(#:tests? #f ; no tests
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'build-shared-library
-           (lambda _
-             (substitute* "CMakeLists.txt"
-               (("vcflib STATIC") "vcflib SHARED"))
-             (substitute* "test/Makefile"
-               (("libvcflib.a") "libvcflib.so"))))
-         (add-after 'unpack 'unpack-submodule-sources
-           (lambda* (#:key inputs #:allow-other-keys)
-             (let ((unpack (lambda (source target)
-                             (mkdir target)
-                             (with-directory-excursion target
-                               (if (file-is-directory? (assoc-ref inputs source))
-                                   (copy-recursively (assoc-ref inputs source) ".")
-                                   (invoke "tar" "xvf"
-                                           (assoc-ref inputs source)
-                                           "--strip-components=1"))))))
-               (and
-                (unpack "filevercmp-src" "filevercmp")
-                (unpack "fsom-src" "fsom")
-                (unpack "intervaltree-src" "intervaltree")
-                (unpack "multichoose-src" "multichoose")))))
-         ;; This pkg-config file is provided by other distributions.
-         (add-after 'install 'install-pkg-config-file
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (pkgconfig (string-append out "/lib/pkgconfig")))
-               (mkdir-p pkgconfig)
-               (with-output-to-file (string-append pkgconfig "/vcflib.pc")
+     (list #:tests? #f ; no tests
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'build-shared-library
                  (lambda _
-                   (format #t "prefix=~a~@
+                   (substitute* "CMakeLists.txt"
+                     (("vcflib STATIC") "vcflib SHARED"))
+                   (substitute* "test/Makefile"
+                     (("libvcflib.a") "libvcflib.so"))))
+               (add-after 'unpack 'unpack-submodule-sources
+                 (lambda* (#:key inputs #:allow-other-keys)
+                   (let ((unpack (lambda (source target)
+                                   (mkdir target)
+                                   (with-directory-excursion target
+                                     (if (file-is-directory? (assoc-ref inputs source))
+                                         (copy-recursively (assoc-ref inputs source) ".")
+                                         (invoke "tar" "xvf"
+                                                 (assoc-ref inputs source)
+                                                 "--strip-components=1"))))))
+                     (and
+                      (unpack "filevercmp-src" "filevercmp")
+                      (unpack "fsom-src" "fsom")
+                      (unpack "intervaltree-src" "intervaltree")
+                      (unpack "multichoose-src" "multichoose")))))
+               ;; This pkg-config file is provided by other distributions.
+               (add-after 'install 'install-pkg-config-file
+                 (lambda* (#:key outputs #:allow-other-keys)
+                   (let* ((out (assoc-ref outputs "out"))
+                          (pkgconfig (string-append out "/lib/pkgconfig")))
+                     (mkdir-p pkgconfig)
+                     (with-output-to-file (string-append pkgconfig "/vcflib.pc")
+                       (lambda _
+                         (format #t "prefix=~a~@
                            exec_prefix=${prefix}~@
                            libdir=${exec_prefix}/lib~@
                            includedir=${prefix}/include~@
@@ -14632,8 +14632,7 @@ (define-public vcflib
                            Description: C++ library for parsing and manipulating VCF files~@
                            Libs: -L${libdir} -lvcflib~@
                            Cflags: -I${includedir}~%"
-                           out ,version)))
-                 #t))))))
+                                 out #$version)))))))))
     (home-page "https://github.com/vcflib/vcflib/")
     (synopsis "Library for parsing and manipulating VCF files")
     (description "Vcflib provides methods to manipulate and interpret
-- 
2.35.1





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#55125] [PATCH 8/9] gnu: vcflib: Find submodule sources in native-inputs during cross-compilation.
  2022-04-26 12:46 ` [bug#55125] [PATCH 1/9] gnu: tabixpp: Use G-expressions Arun Isaac
                     ` (5 preceding siblings ...)
  2022-04-26 12:46   ` [bug#55125] [PATCH 7/9] gnu: vcflib: Use G-expressions Arun Isaac
@ 2022-04-26 12:46   ` Arun Isaac
  2022-04-26 12:46   ` [bug#55125] [PATCH 9/9] gnu: vcflib: Set absolute path to pkg-config Arun Isaac
  7 siblings, 0 replies; 13+ messages in thread
From: Arun Isaac @ 2022-04-26 12:46 UTC (permalink / raw)
  To: 55125; +Cc: Arun Isaac

* gnu/packages/bioinformatics.scm (vcflib)[arguments]: In the
unpack-submodule-sources phase, look for submodule sources in both inputs and
native-inputs.
---
 gnu/packages/bioinformatics.scm | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index d74b8a0eb6..b4d809b4db 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -14599,15 +14599,17 @@ (define-public vcflib
                    (substitute* "test/Makefile"
                      (("libvcflib.a") "libvcflib.so"))))
                (add-after 'unpack 'unpack-submodule-sources
-                 (lambda* (#:key inputs #:allow-other-keys)
+                 (lambda* (#:key inputs native-inputs #:allow-other-keys)
                    (let ((unpack (lambda (source target)
                                    (mkdir target)
                                    (with-directory-excursion target
-                                     (if (file-is-directory? (assoc-ref inputs source))
-                                         (copy-recursively (assoc-ref inputs source) ".")
-                                         (invoke "tar" "xvf"
-                                                 (assoc-ref inputs source)
-                                                 "--strip-components=1"))))))
+                                     (let ((source (or (assoc-ref inputs source)
+                                                       (assoc-ref native-inputs source))))
+                                       (if (file-is-directory? source)
+                                           (copy-recursively source ".")
+                                           (invoke "tar" "xvf"
+                                                   source
+                                                   "--strip-components=1")))))))
                      (and
                       (unpack "filevercmp-src" "filevercmp")
                       (unpack "fsom-src" "fsom")
-- 
2.35.1





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#55125] [PATCH 9/9] gnu: vcflib: Set absolute path to pkg-config.
  2022-04-26 12:46 ` [bug#55125] [PATCH 1/9] gnu: tabixpp: Use G-expressions Arun Isaac
                     ` (6 preceding siblings ...)
  2022-04-26 12:46   ` [bug#55125] [PATCH 8/9] gnu: vcflib: Find submodule sources in native-inputs during cross-compilation Arun Isaac
@ 2022-04-26 12:46   ` Arun Isaac
  7 siblings, 0 replies; 13+ messages in thread
From: Arun Isaac @ 2022-04-26 12:46 UTC (permalink / raw)
  To: 55125; +Cc: Arun Isaac

Setting the absolute path to pkg-config is required to support
cross-compilation.

* gnu/packages/bioinformatics.scm (vcflib)[arguments]: Set
PKG_CONFIG_EXECUTABLE in #:configure-flags.
---
 gnu/packages/bioinformatics.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index b4d809b4db..7f374873ac 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -14589,7 +14589,13 @@ (define-public vcflib
        ("intervaltree-src" ,(package-source intervaltree))
        ("multichoose-src" ,(package-source multichoose))))
     (arguments
-     (list #:tests? #f ; no tests
+     (list #:configure-flags
+           #~(list (string-append
+                    "-DPKG_CONFIG_EXECUTABLE="
+                    (search-input-file
+                     %build-inputs (string-append
+                                    "/bin/" #$(pkg-config-for-target)))))
+           #:tests? #f ; no tests
            #:phases
            #~(modify-phases %standard-phases
                (add-after 'unpack 'build-shared-library
-- 
2.35.1





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#55125] [PATCH 0/9] Cross-compile vcflib for RISC-V
  2022-04-26 12:44 [bug#55125] [PATCH 0/9] Cross-compile vcflib for RISC-V Arun Isaac
  2022-04-26 12:46 ` [bug#55125] [PATCH 1/9] gnu: tabixpp: Use G-expressions Arun Isaac
@ 2022-05-07 21:45 ` Ludovic Courtès
  2022-05-12  7:57   ` Arun Isaac
  2022-05-09  8:31 ` bug#55125: " Efraim Flashner
  2 siblings, 1 reply; 13+ messages in thread
From: Ludovic Courtès @ 2022-05-07 21:45 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 55125

Hi Arun,

Arun Isaac <arunisaac@systemreboot.net> skribis:

> This patchset patches the vcflib package and dependencies so that they
> successfully cross-compile for the riscv64-linux-gnu target.
>
> Arun Isaac (9):
>   gnu: tabixpp: Use G-expressions.
>   gnu: tabixpp: Use #:make-flags.
>   gnu: tabixpp: Use build tools specific to the target.
>   gnu: tabixpp: Add bzip2 and xz to inputs.
>   gnu: fastahack: Use G-expressions.
>   gnu: fastahack: Use compiler specific to the build target.
>   gnu: vcflib: Use G-expressions.
>   gnu: vcflib: Find submodule sources in native-inputs during
>     cross-compilation.
>   gnu: vcflib: Set absolute path to pkg-config.

I had a quick look: the first patch has a couple of long lines :-), but
apart from that, it LGTM.

Thanks!

Ludo’.




^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#55125: [PATCH 0/9] Cross-compile vcflib for RISC-V
  2022-04-26 12:44 [bug#55125] [PATCH 0/9] Cross-compile vcflib for RISC-V Arun Isaac
  2022-04-26 12:46 ` [bug#55125] [PATCH 1/9] gnu: tabixpp: Use G-expressions Arun Isaac
  2022-05-07 21:45 ` [bug#55125] [PATCH 0/9] Cross-compile vcflib for RISC-V Ludovic Courtès
@ 2022-05-09  8:31 ` Efraim Flashner
  2 siblings, 0 replies; 13+ messages in thread
From: Efraim Flashner @ 2022-05-09  8:31 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 55125-done

[-- Attachment #1: Type: text/plain, Size: 248 bytes --]

Looks good to me. Patches pushed!

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [bug#55125] [PATCH 0/9] Cross-compile vcflib for RISC-V
  2022-05-07 21:45 ` [bug#55125] [PATCH 0/9] Cross-compile vcflib for RISC-V Ludovic Courtès
@ 2022-05-12  7:57   ` Arun Isaac
  0 siblings, 0 replies; 13+ messages in thread
From: Arun Isaac @ 2022-05-12  7:57 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 55125


Hi Ludo,

> I had a quick look: the first patch has a couple of long lines :-)

I fixed one of the long lines in the fastahack package in
a1a55e5b607bc5ebb3310b5c592f2a2b1161625a. But, there are two more---one
in fastahack and one in vcflib that are probably not easy to fix.

Regards,
Arun




^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-05-12  7:58 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-26 12:44 [bug#55125] [PATCH 0/9] Cross-compile vcflib for RISC-V Arun Isaac
2022-04-26 12:46 ` [bug#55125] [PATCH 1/9] gnu: tabixpp: Use G-expressions Arun Isaac
2022-04-26 12:46   ` [bug#55125] [PATCH 2/9] gnu: tabixpp: Use #:make-flags Arun Isaac
2022-04-26 12:46   ` [bug#55125] [PATCH 3/9] gnu: tabixpp: Use build tools specific to the target Arun Isaac
2022-04-26 12:46   ` [bug#55125] [PATCH 4/9] gnu: tabixpp: Add bzip2 and xz to inputs Arun Isaac
2022-04-26 12:46   ` [bug#55125] [PATCH 5/9] gnu: fastahack: Use G-expressions Arun Isaac
2022-04-26 12:46   ` [bug#55125] [PATCH 6/9] gnu: fastahack: Use compiler specific to the build target Arun Isaac
2022-04-26 12:46   ` [bug#55125] [PATCH 7/9] gnu: vcflib: Use G-expressions Arun Isaac
2022-04-26 12:46   ` [bug#55125] [PATCH 8/9] gnu: vcflib: Find submodule sources in native-inputs during cross-compilation Arun Isaac
2022-04-26 12:46   ` [bug#55125] [PATCH 9/9] gnu: vcflib: Set absolute path to pkg-config Arun Isaac
2022-05-07 21:45 ` [bug#55125] [PATCH 0/9] Cross-compile vcflib for RISC-V Ludovic Courtès
2022-05-12  7:57   ` Arun Isaac
2022-05-09  8:31 ` bug#55125: " Efraim Flashner

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).