summary refs log tree commit diff
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2020-08-30 14:15:07 +0300
committerEfraim Flashner <efraim@flashner.co.il>2020-08-30 14:15:07 +0300
commitab15bbea60413c8a2e7900a98b22c46adade34fb (patch)
treeadf7e36b33d687c9ef50e7216b7f75e79b3fa2f6
parentd9bba529fca41dcb36735121c2dc3d68dd4ffacb (diff)
downloadguix-ab15bbea60413c8a2e7900a98b22c46adade34fb.tar.gz
gnu: sdsl-lite: Install pkgconfig file.
* gnu/packages/datastructures.scm (sdsl-lite)[arguments]: Add custom
'install-pkgconfig-file phase to install sdsl-lite.pc.
-rw-r--r--gnu/packages/datastructures.scm26
1 files changed, 23 insertions, 3 deletions
diff --git a/gnu/packages/datastructures.scm b/gnu/packages/datastructures.scm
index a9f30831ec..6121d63325 100644
--- a/gnu/packages/datastructures.scm
+++ b/gnu/packages/datastructures.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2015, 2016, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016, 2017, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Meiyo Peng <meiyo.peng@gmail.com>
-;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2020 Mark H Weaver <mhw@netris.org>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -236,14 +236,34 @@ to the structure and choosing one or more fields to act as the key.")
                           "0m542xpys54bni29zibgrfpgpd0zgyny4h131virxsanixsbz52z")))))))
     (build-system cmake-build-system)
     (arguments
-     '(#:phases
+     `(#:phases
        (modify-phases %standard-phases
          (add-after 'install 'install-static-library
            (lambda* (#:key outputs #:allow-other-keys)
              (let ((out (assoc-ref outputs "out")))
                (copy-file "lib/libsdsl_static.a"
                           (string-append out "/lib/libsdsl.a")))
-             #t)))))
+             #t))
+        (add-after 'install 'install-pkgconfig-file
+          (lambda* (#:key outputs #:allow-other-keys)
+            (let ((out (assoc-ref outputs "out"))
+                  (lib (string-append out "/lib")))
+              (mkdir-p (string-append lib "/pkgconfig"))
+              (with-output-to-file (string-append lib "/pkgconfig/sdsl-lite.pc")
+                (lambda _
+                  (format #t "prefix=~a~@
+                          exec_prefix=${prefix}~@
+                          libdir=${exec_prefix}/lib~@
+                          includedir=${prefix}/include~@
+                          ~@
+                          ~@
+                          Name: sdsl~@
+                          Version: ~a~@
+                          Description: SDSL: Succinct Data Structure Library~@
+                          Libs: -L${libdir} -lsdsl -ldivsufsort -ldivsufsort64~@
+                          Cflags: -I${includedir}~%"
+                          out ,version)))
+              #t))))))
     (native-inputs
      `(("libdivsufsort" ,libdivsufsort)))
     (home-page "https://github.com/simongog/sdsl-lite")