summary refs log tree commit diff
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <me@tobias.gr>2016-11-07 15:19:21 +0100
committerTobias Geerinckx-Rice <me@tobias.gr>2016-11-22 01:12:02 +0100
commit57742b35dc0260ad8779438273cccce5f3d6e2c0 (patch)
tree6af1a8e6afab712199eb9b660688e8fd5fd668a9
parent6e388b08399b322121d9113ab7367366ad14eba0 (diff)
downloadguix-57742b35dc0260ad8779438273cccce5f3d6e2c0.tar.gz
gnu: ncurses: Install pkg-config ‘.pc’ files.
* gnu/packages/ncurses.scm (ncurses)[arguments]: Add ‘--enable-pc-files’
and ‘--with-pkg-config-libdir=’ to #:configure-flags. Create ‘non-wide’
compatibility symbolic links for ‘.pc’ files in the post-install-phase.
[native-inputs]: Add pkg-config.
-rw-r--r--gnu/packages/ncurses.scm20
1 files changed, 18 insertions, 2 deletions
diff --git a/gnu/packages/ncurses.scm b/gnu/packages/ncurses.scm
index e21e477f4f..81da864413 100644
--- a/gnu/packages/ncurses.scm
+++ b/gnu/packages/ncurses.scm
@@ -28,6 +28,7 @@
   #:use-module (guix build-system perl)
   #:use-module (gnu packages)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages swig))
 
 (define-public ncurses
@@ -70,7 +71,7 @@
             (let ((out (assoc-ref outputs "out")))
               ;; When building a wide-character (Unicode) build, create backward
               ;; compatibility links from the the "normal" libraries to the
-              ;; wide-character libraries (e.g. libncurses.so to libncursesw.so).
+              ;; wide-character ones (e.g. libncurses.so to libncursesw.so).
               (with-directory-excursion (string-append out "/lib")
                 (for-each (lambda (lib)
                             (define libw.a
@@ -83,6 +84,10 @@
                               (string-append "lib" lib ".so.6"))
                             (define lib.so
                               (string-append "lib" lib ".so"))
+                            (define packagew.pc
+                              (string-append lib "w.pc"))
+                            (define package.pc
+                              (string-append lib ".pc"))
 
                             (when (file-exists? libw.a)
                               (format #t "creating symlinks for `lib~a'~%" lib)
@@ -91,7 +96,11 @@
                               (false-if-exception (delete-file lib.so))
                               (call-with-output-file lib.so
                                 (lambda (p)
-                                  (format p "INPUT (-l~aw)~%" lib)))))
+                                  (format p "INPUT (-l~aw)~%" lib))))
+                            (with-directory-excursion "pkgconfig"
+                              (format #t "creating symlink for `~a'~%" package.pc)
+                              (when (file-exists? packagew.pc)
+                                (symlink packagew.pc package.pc))))
                           '("curses" "ncurses" "form" "panel" "menu")))))))
     (package
      (name "ncurses")
@@ -110,6 +119,11 @@
       `(#:configure-flags
         `("--with-shared" "--without-debug" "--enable-widec"
 
+          "--enable-pc-files"
+          ,(string-append "--with-pkg-config-libdir="
+                          (assoc-ref %outputs "out")
+                          "/lib/pkgconfig")
+
           ;; By default headers land in an `ncursesw' subdir, which is not
           ;; what users expect.
           ,(string-append "--includedir=" (assoc-ref %outputs "out")
@@ -130,6 +144,8 @@
                    (add-after 'unpack 'remove-unneeded-shebang
                      ,remove-shebang-phase))))
      (self-native-input? #t)                      ; for `tic'
+     (native-inputs
+      `(("pkg-config" ,pkg-config)))
      (native-search-paths
       (list (search-path-specification
              (variable "TERMINFO_DIRS")