projects/guix·blob librewolf-updates · refs

392 lines · 18.1 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2017 David Hashe <[email protected]>
3;;; Copyright © 2017 Kei Kebreau <address@hidden>
4;;; Copyright © 2020 Eric Bavier <[email protected]>
5;;; Copyright © 2021 Maxim Cournoyer <[email protected]>
6;;; Copyright © 2022 Ricardo Wurmus <[email protected]>
7;;; Copyright © 2023 Efraim Flashner <[email protected]>
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 pascal)
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix git-download)
29 #:use-module (guix gexp)
30 #:use-module (guix utils)
31 #:use-module (guix build-system gnu)
32 #:use-module (gnu packages)
33 #:use-module (gnu packages base)
34 #:use-module (gnu packages bootstrap)
35 #:use-module (gnu packages compression)
36 #:use-module (gnu packages gcc)
37 #:use-module (gnu packages glib)
38 #:use-module (gnu packages gtk)
39 #:use-module (gnu packages ncurses)
40 #:use-module (gnu packages perl)
41 #:use-module (gnu packages pkg-config)
42 #:use-module (gnu packages xml)
43 #:use-module (gnu packages xorg)
44 #:use-module (ice-9 match))
45
46(define %fpc-version "3.2.2")
47(define %fpc-release-date "2021/05/19")
48
49;;; FIXME: Bootstrap properly; these are prebuilt binaries.
50(define fpc-bootstrap-aarch64
51 (origin
52 (method url-fetch)
53 (uri (string-append "mirror://sourceforge/freepascal/Linux/"
54 %fpc-version "/fpc-" %fpc-version ".aarch64-linux.tar"))
55 (sha256
56 (base32
57 "0lalar6qk04acb2j8p6654hlz0yj6zdab046zi82zf5mnvwp155k"))))
58
59(define fpc-bootstrap-i386
60 (origin
61 (method url-fetch)
62 (uri (string-append "mirror://sourceforge/freepascal/Linux/"
63 %fpc-version "/fpc-" %fpc-version ".i386-linux.tar"))
64 (sha256
65 (base32
66 "0n4r85dsr86zlk7r4hbd4nj14sda6rwgdgzxg4gj4q981fn80agn"))))
67
68(define fpc-bootstrap-powerpc
69 (origin
70 (method url-fetch)
71 (uri (string-append "mirror://sourceforge/freepascal/Linux/"
72 %fpc-version "/fpc-" %fpc-version ".powerpc-linux.tar"))
73 (sha256
74 (base32
75 "1zhdypm99bzs5706g4nxwajiadv82jwd87cr300lrivy1rzj5h4a"))))
76
77(define fpc-bootstrap-powerpc64le
78 (origin
79 (method url-fetch)
80 (uri (string-append "mirror://sourceforge/freepascal/Linux/"
81 %fpc-version "/fpc-" %fpc-version ".powerpc64le-linux.tar"))
82 (sha256
83 (base32
84 "12p3lmi1vn7agpw4pipp6ra8r85319sjcvbzh7z6kangmry7vic3"))))
85
86(define fpc-bootstrap-x86_64
87 (origin
88 (method url-fetch)
89 (uri (string-append "mirror://sourceforge/freepascal/Linux/"
90 %fpc-version "/fpc-" %fpc-version ".x86_64-linux.tar"))
91 (sha256
92 (base32
93 "10qywczzz4qlcmmzxb7axnvwniq76ky130vd8iv6ljskll4c7njs"))))
94
95(define-public fpc
96 (package
97 (name "fpc")
98 (version %fpc-version)
99 (source (origin
100 (method url-fetch)
101 (uri (string-append "mirror://sourceforge/freepascal/Source/"
102 version "/fpcbuild-" version ".tar.gz"))
103 (file-name (string-append name "-" version ".tar.gz"))
104 (sha256
105 (base32
106 "07qna2pvlpa7j0i2wdixjxpizdvffv51nbr1waczk0xv8cq9kvw5"))
107 (patches (search-patches "fpc-reproducibility.patch"
108 "fpc-glibc-2.34-compat.patch"))
109 (modules '((guix build utils)))
110 (snippet
111 '(begin
112 (rename-file "install/doc" "install-doc")
113 (rename-file "install/man" "install-man")
114 ;; Contains executables--some of them created by
115 ;; closed-source compilers.
116 (delete-file-recursively "install")
117 (mkdir-p "install")
118 (rename-file "install-doc" "install/doc")
119 (rename-file "install-man" "install/man")
120 (delete-file "fpcsrc/tests/utils/dosbox/exitcode.exe")))))
121 (build-system gnu-build-system)
122 (supported-systems '("i686-linux" "x86_64-linux"
123 "powerpc-linux" "powerpc64le-linux"
124 "aarch64-linux"))
125 (inputs
126 (list expat glibc ncurses zlib))
127 (native-inputs
128 ;; FPC is built with FPC, so we need bootstrap binaries.
129 `(("fpc-binary" ,(match (or (%current-target-system)
130 (%current-system))
131 ("aarch64-linux" fpc-bootstrap-aarch64)
132 ("i686-linux" fpc-bootstrap-i386)
133 ("powerpc-linux" fpc-bootstrap-powerpc)
134 ("powerpc64le-linux" fpc-bootstrap-powerpc64le)
135 ("x86_64-linux" fpc-bootstrap-x86_64)
136 ;; XXX: Wrong, but innocuous so long
137 ;; `supported-systems' is kept in sync.
138 (_ fpc-bootstrap-x86_64)))))
139 (arguments
140 `(#:tests? #f ; no tests available
141 #:phases
142 (let ((fpc-bootstrap-path
143 (string-append (getcwd) "/" ,name "-" ,version "/fpc-bin"))
144 (arch ,(cond
145 ((target-aarch64?) "aarch64")
146 ((target-x86-32?) "i386")
147 ((target-ppc32?) "powerpc")
148 ((target-ppc64le?) "powerpc64")
149 ((target-x86-64?) "x86_64")
150 (else "unknown"))))
151 (modify-phases %standard-phases
152 (add-after 'unpack 'unpack-bin
153 (lambda* (#:key inputs #:allow-other-keys)
154 (mkdir-p fpc-bootstrap-path)
155 (with-directory-excursion fpc-bootstrap-path
156 (invoke "tar" "xvf" (assoc-ref inputs "fpc-binary")))))
157 (add-after 'unpack-bin 'install-bin
158 (lambda* (#:key inputs #:allow-other-keys)
159 (with-directory-excursion
160 (string-append fpc-bootstrap-path "/fpc-" ,version "."
161 arch "-linux")
162 (let ((binary-tarball
163 (string-append "binary." arch "-linux.tar"))
164 (compiler-tarball
165 (string-append "base." arch "-linux.tar.gz"))
166 (fpcmake-tarball
167 (string-append "utils-fpcm." arch "-linux.tar.gz")))
168 ;; Only the base compiler and fpcmake are needed.
169 (invoke "tar" "xvf" binary-tarball compiler-tarball
170 fpcmake-tarball)
171 (invoke "tar" "xvf" compiler-tarball "-C..")
172 (invoke "tar" "xvf" fpcmake-tarball "-C..")))))
173 (add-after 'patch-source-shebangs 'patch-inline-shebangs
174 (lambda _
175 (substitute* "fpcsrc/compiler/cscript.pas"
176 (("#!/bin/sh") (string-append "#!" (which "sh"))))))
177 (add-before 'build 'patch-release-date
178 (lambda _ ; reproducibility
179 (substitute* (list "fpcdocs/prog.tex"
180 "fpcsrc/packages/amunits/examples/sortdemo.pas"
181 "fpcsrc/packages/libogcfpc/src/ogc/libversion.inc"
182 "fpcsrc/utils/fpcres/fpcjres.pas"
183 "fpcsrc/utils/fpcres/fpcres.pas"
184 "fpcsrc/utils/fpcm/fpcmmain.pp"
185 "fpcsrc/utils/fpcreslipo/fpcreslipo.pp"
186 "fpcsrc/compiler/version.pas")
187 (("\\{\\$I(NCLUDE)? %DATE%\\}")
188 (format #f "'~a'" ,%fpc-release-date)))))
189 (replace 'configure
190 (lambda* (#:key inputs outputs #:allow-other-keys)
191 (substitute* "fpcsrc/compiler/systems/t_linux.pas"
192 ;; Point to the current glibc dynamic linker.
193 (("/lib/ld-linux.so.2")
194 (search-input-file inputs ,(glibc-dynamic-linker)))
195 (("/lib64/ld-linux-x86-64.so.2")
196 (search-input-file inputs ,(glibc-dynamic-linker)))
197 (("/lib/ld.so.1")
198 (search-input-file inputs ,(glibc-dynamic-linker)))
199 (("/lib64/ld64.so.[12]")
200 (search-input-file inputs ,(glibc-dynamic-linker)))
201 (("/lib/ld-linux(-armhf)?.so.3")
202 (search-input-file inputs ,(glibc-dynamic-linker)))
203 (("/lib/ld-linux-aarch64.so.1")
204 (search-input-file inputs ,(glibc-dynamic-linker)))
205 ;; Add glibc to ld's search path.
206 (("if \\(isdll\\) then")
207 (string-append
208 "Add('SEARCH_DIR(\""
209 (assoc-ref inputs "libc") "/lib"
210 "\")');\n"
211 "if (isdll) then")))
212 (substitute* "fpcsrc/compiler/options.pas"
213 (("exepath\\+'../etc/'")
214 (string-append "'" (assoc-ref outputs "out") "/etc'")))))
215 (replace 'build
216 (lambda* (#:key inputs #:allow-other-keys)
217 (let* ((fpc-bin (string-append fpc-bootstrap-path "/bin"))
218 (fpc (string-append fpc-bin "/fpc"))
219 (fpcmake (string-append fpc-bin "/fpcmake")))
220 ;; The fpc binary needs to run the ppc[arch] binary (which
221 ;; does the actual compiling) in this directory.
222 (setenv "PATH"
223 (string-append (getenv "PATH") ":"
224 fpc-bootstrap-path
225 "/lib/fpc/" ,version))
226 (setenv "FPC" fpc)
227 ;; Specify target operating system using "-T" option
228 (invoke fpcmake (string-append "-T" arch "-linux"))
229 (invoke "make" "build" "NOGDB=1"))))
230 (replace 'install
231 (lambda* (#:key outputs #:allow-other-keys)
232 (let* ((out (assoc-ref outputs "out"))
233 ;; This is the suffix of the ppc[arch] binary.
234 (suffix ,(cond
235 ((target-aarch64?) "a64")
236 ((target-x86-32?) "386")
237 ((target-ppc32?) "ppc")
238 ((target-ppc64le?) "ppc64")
239 ((target-x86-64?) "x64")
240 (else "")))
241 (ppc (string-append "ppc" suffix)))
242 (invoke "make" "install" "NOGDB=1"
243 (string-append "INSTALL_PREFIX=" out))
244 ;; Remove files that fail RUNPATH validation.
245 ;; TODO: Fix it instead.
246 (delete-file (string-append out "/lib/libpas2jslib.so"))
247 ;; Add a symlink to the ppc[arch] binary so fpc works.
248 (symlink (string-append out "/lib/fpc/" ,version "/" ppc)
249 (string-append out "/bin/" ppc))
250 ;; Install the example configuration file.
251 (mkdir (string-append out "/etc"))
252 (invoke
253 (string-append out "/lib/fpc/" ,version "/samplecfg")
254 (string-append out "/lib/fpc/" ,version)
255 (string-append out "/etc")))))
256 (add-after 'install 'wrap
257 (lambda* (#:key inputs outputs #:allow-other-keys)
258 (let* ((out (assoc-ref outputs "out"))
259 (fpc (string-append out "/bin/fpc"))
260 (ld (assoc-ref inputs "ld-wrapper"))
261 (glibc (assoc-ref inputs "glibc")))
262 (wrap-program fpc
263 `("PATH" ":" prefix (,(string-append ld "/bin")))
264 `("LIBRARY_PATH" ":" prefix
265 (,(string-append glibc "/lib")))))))))))
266 ;; fpc invokes gcc, so make sure LIBRARY_PATH et.al are set.
267 ;(native-search-paths (package-native-search-paths gcc))
268 (home-page "https://www.freepascal.org")
269 (synopsis "The Free Pascal Compiler")
270 (description
271 "Free Pascal is a professional Object Pascal compiler. It supports the
272Turbo Pascal 7.0, Delphi, and Mac Pascal dialects. Free Pascal also supports
273many useful extensions to the Pascal programming language.")
274 ;; The majority of the software included is licensed under the GPLv2
275 ;; or later. For more licensing details, see the appropriate files in
276 ;; the install/doc directory of the source distribution.
277 (license license:gpl2+)))
278
279(define-public p2c
280 (package
281 (name "p2c")
282 (version "2.02")
283 (source (origin
284 (method url-fetch)
285 (uri (string-append "http://users.fred.net/tds/lab/p2c/p2c-"
286 version ".zip"))
287 (sha256
288 (base32
289 "17q6s0vbz298pks80bxf4r6gm8kwbrml1q3vfs6g6yj75sqj58xs"))))
290 (build-system gnu-build-system)
291 (arguments
292 (list
293 #:make-flags
294 #~(list (string-append "CC=" #$(cc-for-target))
295 "CFLAGS=-Wno-implicit-function-declaration"
296 (string-append "HOMEDIR=" #$output "/lib/p2c")
297 (string-append "INCDIR=" #$output "/include/p2c")
298 (string-append "BINDIR=" #$output "/bin")
299 (string-append "LIBDIR=" #$output "/lib")
300 (string-append "MANDIR=" #$output "/share/man/man1")
301 "MANFILE=p2c.man.inst")
302 #:test-target "test"
303 #:phases
304 #~(modify-phases %standard-phases
305 (delete 'configure)
306 (add-before 'build 'mkdir
307 (lambda _
308 (mkdir-p (string-append #$output "/share/man"))
309 (mkdir-p (string-append #$output "/lib"))
310 (mkdir-p (string-append #$output "/bin"))
311 (mkdir-p (string-append #$output "/include"))))
312 (add-before 'build 'chdir
313 (lambda _ (chdir "src"))))))
314 (native-inputs
315 (list perl unzip which))
316 (synopsis "Convert Pascal programs to C programs")
317 (description "This package provides @command{p2c}, a program to convert
318Pascal source code to C source code, and @command{p2cc}, a compiler for
319Pascal programs.")
320 (home-page "http://users.fred.net/tds/lab/p2c/")
321 (license license:gpl2+)))
322
323(define-public lazarus
324 (package
325 (name "lazarus")
326 (version "2.2.6")
327 (source (origin
328 (method git-fetch)
329 (uri (git-reference
330 (url
331 "https://gitlab.com/freepascal.org/lazarus/lazarus.git")
332 (commit (string-append "lazarus_"
333 (string-join (string-split version
334 #\.)
335 "_")))))
336 (file-name (string-append name "-" version "-checkout"))
337 (sha256
338 (base32
339 "0hpk6fxmy1h1q0df41jg1vnp8g8vynrg5v5ad43lv229nizfs3wj"))))
340 (build-system gnu-build-system)
341 (arguments
342 (list #:tests? #f ;No tests exist
343 #:make-flags #~(list (string-append "INSTALL_PREFIX="
344 #$output))
345 #:phases #~(modify-phases %standard-phases
346 (delete 'configure)
347 (replace 'build
348 (lambda* (#:key inputs outputs #:allow-other-keys)
349 (let* ((libdirs (map (lambda (x)
350 (assoc-ref inputs x))
351 '("glib" "gdk-pixbuf"
352 "gtk+"
353 "libx11"
354 "libx11"
355 "pango"
356 "cairo"
357 "at-spi2-core")))
358 (libs (append (map (lambda (name)
359 (string-append "-Fl"
360 name
361 "/lib"))
362 libdirs)
363 (map (lambda (name)
364 (string-append
365 "-k-rpath=" name
366 "/lib")) libdirs))))
367 (setenv "LAZARUS_LIBPATHS"
368 (string-join libs " "))
369 (setenv "MAKEFLAGS"
370 (string-append "LHELP_OPT="
371 (string-join libs "\\ "))))
372 (invoke "make" "bigide"))))))
373 (native-inputs (list fpc pkg-config))
374 (inputs (list glib
375 gdk-pixbuf
376 gtk+-2
377 libx11
378 pango
379 cairo
380 at-spi2-core))
381 (synopsis "Integrated development environment for Pascal")
382 (description "This package provides an integrated development environment
383for Pascal.")
384 (home-page "https://www.lazarus-ide.org/")
385 ;; Some Android stuff is under asl2.0. Some artwork is under CC-BY-SA-3
386 ;; or CC-BY-SA-4.
387 ;; Some components are under MIT expat.
388 ;; The Freetype components are under Freetype license.
389 ;; A lot of components are under LGPL-2+.
390 ;; synedit and turbopower_ipro are under MPL-1.1
391 ;; PascalScript is under a zlib-like license.
392 (license (list license:gpl2+ license:lgpl2.0+))))