gnu: fltk: Use system zlib, libjpeg, and libpng.

* gnu/packages/fltk.scm (fltk)[inputs]: Add libjpeg, libpng, and zlib.
  [arguments]: Add 'patch-config' phase.
This commit is contained in:
Eric Bavier 2015-05-18 15:07:50 -05:00
parent d692678fee
commit ef698bf996
1 changed files with 25 additions and 5 deletions

View File

@ -18,8 +18,10 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages fltk) (define-module (gnu packages fltk)
#:use-module (guix licenses) #:use-module ((guix licenses) #:select (lgpl2.0))
#:use-module (gnu packages) #:use-module (gnu packages)
#:use-module (gnu packages compression)
#:use-module (gnu packages image)
#:use-module (gnu packages xorg) #:use-module (gnu packages xorg)
#:use-module (gnu packages gl) #:use-module (gnu packages gl)
#:use-module (guix packages) #:use-module (guix packages)
@ -41,8 +43,11 @@
(patches (list (search-patch "fltk-shared-lib-defines.patch"))))) (patches (list (search-patch "fltk-shared-lib-defines.patch")))))
(build-system gnu-build-system) (build-system gnu-build-system)
(inputs (inputs
`(("libx11" ,libx11) `(("libjpeg" ,libjpeg-8) ;jpeg_read_header argument error in libjpeg-9
("mesa" ,mesa))) ("libpng" ,libpng)
("libx11" ,libx11)
("mesa" ,mesa)
("zlib" ,zlib)))
(arguments (arguments
`(#:tests? #f ;TODO: compile programs in "test" dir `(#:tests? #f ;TODO: compile programs in "test" dir
#:configure-flags #:configure-flags
@ -54,7 +59,22 @@
(lambda _ (lambda _
(substitute* "makeinclude.in" (substitute* "makeinclude.in"
(("/bin/sh") (which "sh")))) (("/bin/sh") (which "sh"))))
%standard-phases))) (alist-cons-after
'install 'patch-config
;; Provide -L flags for image libraries when querying fltk-config to
;; avoid propagating inputs.
(lambda* (#:key inputs outputs #:allow-other-keys)
(use-modules (srfi srfi-26))
(let* ((conf (string-append (assoc-ref outputs "out")
"/bin/fltk-config"))
(jpeg (assoc-ref inputs "libjpeg"))
(png (assoc-ref inputs "libpng"))
(zlib (assoc-ref inputs "zlib")))
(substitute* conf
(("-ljpeg") (string-append "-L" jpeg "/lib -ljpeg"))
(("-lpng") (string-append "-L" png "/lib -lpng"))
(("-lz") (string-append "-L" zlib "/lib -lz")))))
%standard-phases))))
(home-page "http://www.fltk.org") (home-page "http://www.fltk.org")
(synopsis "3D C++ GUI library") (synopsis "3D C++ GUI library")
(description "FLTK is a C++ GUI toolkit providing modern GUI functionality (description "FLTK is a C++ GUI toolkit providing modern GUI functionality