gnu: Add wl-clipboard.
[jackhill/guix/guix.git] / gnu / packages / fltk.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 John Darrington <jmd@gnu.org>
3 ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
4 ;;; Copyright © 2015, 2018 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2016 Kei Kebreau <kkebreau@posteo.net>
6 ;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
7 ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages fltk)
25 #:use-module ((guix licenses) #:select (lgpl2.0 lgpl2.0+))
26 #:use-module (gnu packages)
27 #:use-module (gnu packages compression)
28 #:use-module (gnu packages image)
29 #:use-module (gnu packages xorg)
30 #:use-module (gnu packages gl)
31 #:use-module (gnu packages gtk) ;for "cairo"
32 #:use-module (gnu packages pkg-config)
33 #:use-module (gnu packages python)
34 #:use-module (guix packages)
35 #:use-module (guix download)
36 #:use-module (guix git-download)
37 #:use-module (guix build-system gnu)
38 #:use-module (guix build-system waf)
39 #:use-module (srfi srfi-1))
40
41 (define-public fltk
42 (package
43 (name "fltk")
44 (version "1.3.4-2")
45 (source
46 (origin
47 (method url-fetch)
48 (uri (string-append "http://fltk.org/pub/fltk/"
49 (first (string-split version #\-))
50 "/fltk-" version "-source.tar.gz"))
51 (sha256
52 (base32
53 "0459rm1gl5x3famiqma7ja7k6hvan8p5l8lgshvqfl4rik0lklr5"))))
54 (build-system gnu-build-system)
55 (native-inputs
56 `(("pkg-config" ,pkg-config)))
57 (inputs
58 `(("libjpeg" ,libjpeg)
59 ("libpng" ,libpng)
60 ("libx11" ,libx11)
61 ("libxft" ,libxft)
62 ("mesa" ,mesa)
63 ("zlib" ,zlib)))
64 (arguments
65 `(#:tests? #f ;TODO: compile programs in "test" dir
66 #:configure-flags
67 (list "--enable-shared"
68 (string-append "DSOFLAGS=-Wl,-rpath=" %output "/lib"))
69 #:phases
70 (modify-phases %standard-phases
71 (add-before 'configure 'patch-makeinclude
72 (lambda _
73 (substitute* "makeinclude.in"
74 (("/bin/sh") (which "sh")))
75 #t))
76 (add-after 'install 'patch-config
77 ;; Provide -L flags for image libraries when querying fltk-config to
78 ;; avoid propagating inputs.
79 (lambda* (#:key inputs outputs #:allow-other-keys)
80 (let ((conf (string-append (assoc-ref outputs "out")
81 "/bin/fltk-config"))
82 (jpeg (assoc-ref inputs "libjpeg"))
83 (png (assoc-ref inputs "libpng"))
84 (zlib (assoc-ref inputs "zlib")))
85 (substitute* conf
86 (("-ljpeg") (string-append "-L" jpeg "/lib -ljpeg"))
87 (("-lpng") (string-append "-L" png "/lib -lpng"))
88 (("-lz") (string-append "-L" zlib "/lib -lz"))))
89 #t)))))
90 (home-page "http://www.fltk.org")
91 (synopsis "3D C++ GUI library")
92 (description "FLTK is a C++ GUI toolkit providing modern GUI functionality
93 without the bloat. It supports 3D graphics via OpenGL and its built-in GLUT
94 emulation. FLTK is designed to be small and modular enough to be statically
95 linked, but works fine as a shared library. FLTK also includes an excellent
96 UI builder called FLUID that can be used to create applications in minutes.")
97 (license lgpl2.0))) ; plus certain additional permissions
98
99 (define-public ntk
100 (package
101 (name "ntk")
102 (version "1.3.1000")
103 (source (origin
104 (method git-fetch)
105 (uri (git-reference
106 (url "git://git.tuxfamily.org/gitroot/non/fltk.git")
107 (commit (string-append "v" version))))
108 (sha256
109 (base32
110 "0j38mhnfqy6swcrnc5zxcwlqi8b1pgklyghxk6qs1lf4japv2zc0"))
111 (file-name (string-append name "-" version "-checkout"))))
112 (build-system waf-build-system)
113 (arguments
114 `(#:tests? #f ;no "check" target
115 #:configure-flags '("--enable-gl")
116 #:phases
117 (modify-phases %standard-phases
118 (add-before 'configure 'setup-waf
119 (lambda* (#:key inputs #:allow-other-keys)
120 (let ((waf (assoc-ref inputs "waf")))
121 (delete-file "waf")
122 (copy-file (string-append waf "/bin/waf") "waf"))
123 #t))
124 (add-before 'configure 'set-ldflags
125 (lambda* (#:key outputs #:allow-other-keys)
126 (setenv "LDFLAGS"
127 (string-append "-Wl,-rpath="
128 (assoc-ref outputs "out") "/lib"))
129 #t)))))
130 (inputs
131 `(("libjpeg" ,libjpeg)
132 ("glu" ,glu)
133 ("waf" ,python-waf)))
134 ;; ntk.pc lists "x11" and "xft" in Requires.private, and "cairo" in
135 ;; Requires.
136 (propagated-inputs
137 `(("cairo" ,cairo)
138 ("libxft" ,libxft)
139 ("libx11" ,libx11)))
140 (native-inputs
141 `(("pkg-config" ,pkg-config)))
142 (home-page "http://non.tuxfamily.org/ntk/")
143 (synopsis "Fork of FLTK with graphics rendering via Cairo")
144 (description "The Non Tool Kit (NTK) is a fork of the Fast Light ToolKit
145 library, adding improved graphics rendering via Cairo, a streamlined and
146 enhanced widget set, and other features designed to improve the appearance and
147 performance of the Non applications.")
148 (license lgpl2.0+))) ; plus certain additional permissions