projects/guix·blob java-team · refs

166 lines · 6.5 KiB

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