diff mbox series

[bug#61148,2/5] gnu: tabixpp: Update to 1.1.2.

Message ID 29b7080a94dbfdc13c890742a4fabcf1d731617c.1674997469.git.efraim@flashner.co.il
State New
Headers show
Series Update vcflib | expand

Commit Message

Efraim Flashner Jan. 29, 2023, 1:12 p.m. UTC
* gnu/packages/bioinformatics.scm (tabixpp): Update to 1.1.2.
[source]: Add snippet to keep library name the same.
[arguments]: Adjust the make-flags to find htslib. Enable the tests.
Remove custom 'build-libraries phase, it is built by default now. Add a
phase to symlink the shared library to a generic .so name. Don't
override the 'install phase. Add a phase after 'install to create a
pkg-config file.
---
 gnu/packages/bioinformatics.scm | 60 ++++++++++++++++++---------------
 1 file changed, 33 insertions(+), 27 deletions(-)
diff mbox series

Patch

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 5cea726f8e..fa0a6c0dd6 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -4,7 +4,7 @@ 
 ;;; Copyright © 2015, 2016, 2018, 2019, 2020 Pjotr Prins <pjotr.guix@thebird.nl>
 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2016, 2020, 2021 Roel Janssen <roel@gnu.org>
-;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021, 2022 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016-2023 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016, 2020, 2022 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2016, 2018 Raoul Bonnal <ilpuccio.febo@gmail.com>
 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
@@ -15640,7 +15640,7 @@  (define-public tbsp
 (define-public tabixpp
   (package
    (name "tabixpp")
-   (version "1.1.0")
+   (version "1.1.2")
    (source (origin
              (method git-fetch)
              (uri (git-reference
@@ -15648,43 +15648,47 @@  (define-public tabixpp
                    (commit (string-append "v" version))))
              (file-name (git-file-name name version))
              (sha256
-              (base32 "1k2a3vbq96ic4lw72iwp5s3mwwc4xhdffjj584yn6l9637q9j1yd"))
+              (base32 "00aqs147yn8zcvxims5njwxqsbnlbjv7lnmiwqy80bfdcbhljkqf"))
              (modules '((guix build utils)))
              (snippet
               #~(begin
-                  (delete-file-recursively "htslib")))))
+                  (delete-file-recursively "htslib")
+                  ;; Keep it named tabixpp.
+                  (substitute* "Makefile"
+                    (("libtabix") "libtabixpp"))))))
    (build-system gnu-build-system)
-   (inputs
-    (list bzip2 htslib xz zlib))
    (arguments
     (list #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
                                (string-append "CXX=" #$(cxx-for-target))
+                               (string-append "AR=" #$(ar-for-target))
                                "HTS_HEADERS="
-                               (string-append "HTS_LIB="
-                                              (search-input-file %build-inputs
-                                                                 "/lib/libhts.a"))
-                               "INCLUDES=")
-          #:tests? #f ; There are no tests to run.
+                               "HTS_LIB="
+                               (string-append
+                                 "INCLUDES= -I"
+                                 (search-input-directory %build-inputs
+                                                         "include/htslib"))
+                               (string-append
+                                 "LIBPATH= -L. -L"
+                                 (dirname
+                                   (search-input-file %build-inputs
+                                                      "/lib/libhts.a")))
+                               (string-append "PREFIX=" #$output)
+                               "DESTDIR=")
+          #:test-target "test"
           #:phases
           #~(modify-phases %standard-phases
               (delete 'configure) ; There is no configure phase.
-              ;; Build shared and static libraries.
-              (add-after 'build 'build-libraries
-                (lambda* (#:key inputs #:allow-other-keys)
-                  (invoke #$(cxx-for-target)
-                          "-shared" "-o" "libtabixpp.so" "tabix.o" "-lhts")
-                  (invoke #$(ar-for-target) "rcs" "libtabixpp.a" "tabix.o")))
-              (replace 'install
+              (add-after 'install 'symlink-shared-library
+                (lambda* (#:key outputs #:allow-other-keys)
+                  (with-directory-excursion
+                    (string-append (assoc-ref outputs "out") "/lib")
+                    (symlink "libtabixpp.so.1" "libtabixpp.so"))))
+              (add-after 'install 'make-pkg-config-file
                 (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")
+                         (pkgconfig (string-append out "/lib/pkgconfig")))
+                    (mkdir-p pkgconfig)
+                    (with-output-to-file (string-append pkgconfig "/tabixpp.pc")
                       (lambda _
                         (format #t "prefix=~a~@
                           exec_prefix=${prefix}~@
@@ -15692,12 +15696,14 @@  (define-public tabixpp
                           includedir=${prefix}/include~@
                           ~@
                           ~@
-                          Name: libtabixpp~@
+                          Name: tabixpp~@
                           Version: ~a~@
                           Description: C++ wrapper around tabix project~@
                           Libs: -L${libdir} -ltabixpp~@
                           Cflags: -I${includedir}~%"
                                 out #$version)))))))))
+   (inputs
+    (list bzip2 curl htslib xz zlib))
    (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