summary refs log tree commit diff
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2020-08-27 18:08:13 +0300
committerEfraim Flashner <efraim@flashner.co.il>2020-08-27 18:08:13 +0300
commitf075bf09bda9f7b146a600c6c6ebbbbf72c3cf13 (patch)
treef4746e76fa93518be6ee177fba3fbac7df9f8125
parent5c789971881a536e98dd466717c709f9ce77498b (diff)
downloadguix-f075bf09bda9f7b146a600c6c6ebbbbf72c3cf13.tar.gz
gnu: fastahack: Build and install shared library and headers.
* gnu/packages/bioinformatics.scm (fastahack)[arguments]: Add phase to
build PIE objects. Add custom phase to build dynamic library. Adjust
custom 'install phase to install shared library and headers.
-rw-r--r--gnu/packages/bioinformatics.scm22
1 files changed, 20 insertions, 2 deletions
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index c188500620..092ecf147a 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -15582,10 +15582,28 @@ neural networks.")
        #: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 ((bin (string-append (assoc-ref outputs "out") "/bin")))
-               (install-file "fastahack" bin))
+             (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))
              #t)))))
     (home-page "https://github.com/ekg/fastahack")
     (synopsis "Indexing and sequence extraction from FASTA files")