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.
This commit is contained in:
Tobias Geerinckx-Rice 2016-11-07 15:19:21 +01:00
parent 6e388b0839
commit 57742b35dc
No known key found for this signature in database
GPG Key ID: 91CCDB9B48541B99
1 changed files with 18 additions and 2 deletions

View File

@ -28,6 +28,7 @@
#:use-module (guix build-system perl) #:use-module (guix build-system perl)
#:use-module (gnu packages) #:use-module (gnu packages)
#:use-module (gnu packages perl) #:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages swig)) #:use-module (gnu packages swig))
(define-public ncurses (define-public ncurses
@ -70,7 +71,7 @@
(let ((out (assoc-ref outputs "out"))) (let ((out (assoc-ref outputs "out")))
;; When building a wide-character (Unicode) build, create backward ;; When building a wide-character (Unicode) build, create backward
;; compatibility links from the the "normal" libraries to the ;; 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") (with-directory-excursion (string-append out "/lib")
(for-each (lambda (lib) (for-each (lambda (lib)
(define libw.a (define libw.a
@ -83,6 +84,10 @@
(string-append "lib" lib ".so.6")) (string-append "lib" lib ".so.6"))
(define lib.so (define lib.so
(string-append "lib" 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) (when (file-exists? libw.a)
(format #t "creating symlinks for `lib~a'~%" lib) (format #t "creating symlinks for `lib~a'~%" lib)
@ -91,7 +96,11 @@
(false-if-exception (delete-file lib.so)) (false-if-exception (delete-file lib.so))
(call-with-output-file lib.so (call-with-output-file lib.so
(lambda (p) (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"))))))) '("curses" "ncurses" "form" "panel" "menu")))))))
(package (package
(name "ncurses") (name "ncurses")
@ -110,6 +119,11 @@
`(#:configure-flags `(#:configure-flags
`("--with-shared" "--without-debug" "--enable-widec" `("--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 ;; By default headers land in an `ncursesw' subdir, which is not
;; what users expect. ;; what users expect.
,(string-append "--includedir=" (assoc-ref %outputs "out") ,(string-append "--includedir=" (assoc-ref %outputs "out")
@ -130,6 +144,8 @@
(add-after 'unpack 'remove-unneeded-shebang (add-after 'unpack 'remove-unneeded-shebang
,remove-shebang-phase)))) ,remove-shebang-phase))))
(self-native-input? #t) ; for `tic' (self-native-input? #t) ; for `tic'
(native-inputs
`(("pkg-config" ,pkg-config)))
(native-search-paths (native-search-paths
(list (search-path-specification (list (search-path-specification
(variable "TERMINFO_DIRS") (variable "TERMINFO_DIRS")