projects/guix·blob python-team · refs

694 lines · 29.2 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2015, 2024 Andreas Enge <[email protected]>
3;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <[email protected]>
4;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Mark H Weaver <[email protected]>
5;;; Copyright © 2015 Sou Bunnbu <[email protected]>
6;;; Copyright © 2016, 2017, 2018, 2019 Efraim Flashner <[email protected]>
7;;; Copyright © 2016 Alex Griffin <[email protected]>
8;;; Copyright © 2017, 2025 Clément Lassieur <[email protected]>
9;;; Copyright © 2017, 2018 Nikita <[email protected]>
10;;; Copyright © 2017, 2018 ng0 <[email protected]>
11;;; Copyright © 2017, 2018, 2020 Tobias Geerinckx-Rice <[email protected]>
12;;; Copyright © 2018, 2020, 2022 Ricardo Wurmus <[email protected]>
13;;; Copyright © 2019 Ivan Petkov <[email protected]>
14;;; Copyright © 2020 Oleg Pykhalov <[email protected]>
15;;; Copyright © 2020 Jakub Kądziołka <[email protected]>
16;;; Copyright © 2019, 2020 Adrian Malacoda <[email protected]>
17;;; Copyright © 2020-2023 Jonathan Brielmaier <[email protected]>
18;;; Copyright © 2020 Zhu Zihao <[email protected]>
19;;; Copyright © 2021 pineapples <[email protected]>
20;;; Copyright © 2021 Brice Waegeneire <[email protected]>
21;;; Copyright © 2021, 2022, 2023 John Kehayias <[email protected]>
22;;; Copyright © 2022 Pierre Langlois <[email protected]>
23;;; Copyright © 2023 Tomas Volf <[email protected]>
24;;; Copyright © 2023, 2024, 2025 Ian Eure <[email protected]>
25;;; Copyright © 2024 Remco van 't Veer <[email protected]>
26;;; Copyright © 2024 Ashvith Shetty <[email protected]>
27;;; Copyright © 2025, 2026 Untrusem <[email protected]>
28;;;
29;;; This file is part of GNU Guix.
30;;;
31;;; GNU Guix is free software; you can redistribute it and/or modify it
32;;; under the terms of the GNU General Public License as published by
33;;; the Free Software Foundation; either version 3 of the License, or (at
34;;; your option) any later version.
35;;;
36;;; GNU Guix is distributed in the hope that it will be useful, but
37;;; WITHOUT ANY WARRANTY; without even the implied warranty of
38;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
39;;; GNU General Public License for more details.
40;;;
41;;; You should have received a copy of the GNU General Public License
42;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
43
44(define-module (gnu packages librewolf)
45 #:use-module ((srfi srfi-1) #:hide (zip))
46 #:use-module (guix build-system gnu)
47 #:use-module (guix build-system cargo)
48 #:use-module (guix build-system trivial)
49 #:use-module (guix download)
50 #:use-module (guix git-download)
51 #:use-module ((guix licenses) #:prefix license:)
52 #:use-module (guix gexp)
53 #:use-module (guix packages)
54 #:use-module (guix utils)
55 #:use-module ((guix build utils) #:select (alist-replace))
56
57 #:use-module (gnu packages)
58 #:use-module (gnu packages assembly)
59 #:use-module (gnu packages autotools)
60 #:use-module (gnu packages base)
61 #:use-module (gnu packages bash)
62 #:use-module (gnu packages compression)
63 #:use-module (gnu packages cups)
64 #:use-module (gnu packages fontutils)
65 #:use-module (gnu packages gl)
66 #:use-module (gnu packages glib)
67 #:use-module (gnu packages gnome)
68 #:use-module (gnu packages gnuzilla)
69 #:use-module (gnu packages gtk)
70 #:use-module (gnu packages hunspell)
71 #:use-module (gnu packages icu4c)
72 #:use-module (gnu packages image)
73 #:use-module (gnu packages jemalloc)
74 #:use-module (gnu packages kerberos)
75 #:use-module (gnu packages libcanberra)
76 #:use-module (gnu packages libevent)
77 #:use-module (gnu packages libffi)
78 #:use-module (gnu packages linux)
79 #:use-module (gnu packages llvm)
80 #:use-module (gnu packages m4)
81 #:use-module (gnu packages node)
82 #:use-module (gnu packages nss)
83 #:use-module (gnu packages pciutils)
84 #:use-module (gnu packages perl)
85 #:use-module (gnu packages pkg-config)
86 #:use-module (gnu packages pulseaudio)
87 #:use-module (gnu packages python)
88 #:use-module (gnu packages python-xyz)
89 #:use-module (gnu packages rust)
90 #:use-module (gnu packages rust-apps)
91 #:use-module (gnu packages speech)
92 #:use-module (gnu packages sqlite)
93 #:use-module (gnu packages video)
94 #:use-module (gnu packages xdisorg)
95 #:use-module (gnu packages xorg))
96
97(define (firefox-source-origin version hash)
98 (origin
99 (method url-fetch)
100 (uri (string-append
101 "https://ftp.mozilla.org/pub/firefox/releases/"
102 version "/source/" "firefox-" version
103 ".source.tar.xz"))
104 (sha256 (base32 hash))))
105
106(define (librewolf-source-origin version hash)
107 (origin
108 (method git-fetch)
109 (uri (git-reference
110 (url "https://librewolf.dev/librewolf/source.git")
111 (commit version)
112 (recursive? #t)))
113 (file-name (git-file-name "librewolf-source" version))
114 (sha256 (base32 hash))))
115
116(define computed-origin-method (@@ (guix packages) computed-origin-method))
117
118(define firefox-l10n
119 ;; Match this commit to the upstream tarball. The hash is in
120 ;; firefox-NNN.0/browser/locales/l10n-changesets.json
121 ;; The hash repeasts for every language, but should be the same for
122 ;; everything.
123 ;;
124 ;; ex:
125 ;; tar xf /gnu/store/...-firefox-123.4.source.tar.xz --wildcards -O \
126 ;; firefox-*/browser/locales/l10n-changesets.json \
127 ;; | grep revision | sort | uniq
128 (let ((commit "c2b9350bb4495e702c8336f4536c217e60bbe33a"))
129 (origin
130 (method git-fetch)
131 (uri (git-reference
132 (url "https://github.com/mozilla-l10n/firefox-l10n.git")
133 (commit commit)))
134 (file-name (git-file-name "firefox-l10n" commit))
135 (sha256 (base32 "1z25hxyamm63jny6msl3jh6v33hlvn9ca0y34x3ggbxw1x9zzj8s")))))
136
137(define* (make-librewolf-source #:key version firefox-hash librewolf-hash l10n)
138 (let* ((ff-src (firefox-source-origin
139 (car (string-split version #\-))
140 firefox-hash))
141 (lw-src (librewolf-source-origin
142 version
143 librewolf-hash)))
144
145 (origin
146 (method computed-origin-method)
147 (file-name (string-append "librewolf-" version ".source.tar.gz"))
148 (sha256 #f)
149 (uri
150 (delay
151 (with-imported-modules '((guix build utils))
152 #~(begin
153 (use-modules (guix build utils))
154 (set-path-environment-variable
155 "PATH" '("bin")
156 (list #+python
157 #+(canonical-package bash)
158 #+(canonical-package gnu-make)
159 #+(canonical-package coreutils)
160 #+(canonical-package findutils)
161 #+(canonical-package patch)
162 #+(canonical-package xz)
163 #+(canonical-package sed)
164 #+(canonical-package grep)
165 #+(canonical-package pigz)
166 #+(canonical-package tar)))
167 (set-path-environment-variable
168 "PYTHONPATH"
169 (list #+(format #f "lib/python~a/site-packages"
170 (version-major+minor
171 (package-version python))))
172 '#+(cons python-jsonschema
173 (map second
174 (package-transitive-propagated-inputs
175 python-jsonschema))))
176
177 ;; Copy LibreWolf source into the build directory and make
178 ;; everything writable.
179 (copy-recursively #+lw-src ".")
180 (for-each make-file-writable (find-files "."))
181
182 ;; Patch Makefile to use the upstream source instead of
183 ;; downloading.
184 (substitute* '("Makefile")
185 (("^(ff_source_tarball *:= *).*" _ var)
186 (string-append var #+ff-src)))
187
188 ;; Neuter GPG signing of the tarball.
189 (substitute* '("Makefile")
190 (("if [ -f pk.asc ].*") ""))
191
192 ;; Stage locales.
193 (setenv "SKIP_FETCHING_LOCALES" "true")
194 (substitute* '("scripts/librewolf-patches.py")
195 (("^ exec\\('mkdir -p lw'\\)")
196 (string-append
197 " exec('mkdir -p lw')\n exec(\"cp -r "
198 #+l10n
199 " ./lw/l10n && chmod -R +w ./lw/l10n\")")))
200
201 ;; Run the build script
202 (invoke "make" "all")
203 (copy-file (string-append "librewolf-" #$version
204 ".source.tar.gz")
205 #$output)))))
206 (patches
207 (search-patches
208 "librewolf-compare-paths.patch"
209 "librewolf-use-system-wide-dir.patch"
210 "librewolf-add-store-to-rdd-allowlist.patch"))
211 ;; Slim down the tarball by removing unbundled libraries and 75 Mo (800+
212 ;; Mo uncompressed) of unused tests.
213 ;; TODO: Unbundle security/nss and media/libpng.
214 (modules '((guix build utils)))
215 (snippet
216 #~(for-each delete-file-recursively
217 '("testing/web-platform"
218 "js/src/ctypes/libffi"
219 "ipc/chromium/src/third_party/libevent"
220 "media/libvpx"
221 "docs/nspr"
222 "media/libwebp"
223 "modules/zlib"))))))
224
225;; Needed for the .desktop.in file used in librewolf's 'install-desktop-entry
226(define librewolf-bsys6
227 (let ((commit "274e39ee40592f8bc6ca5d4ee699ec74aeeab983"))
228 (origin
229 (method git-fetch)
230 (uri (git-reference
231 (url "https://librewolf.dev/librewolf/bsys6.git")
232 (commit commit)))
233 (file-name (git-file-name "librewolf-bsys6" commit))
234 (sha256 (base32 "15a2j1r5xrxvb9vr55138canwaj44nswzsfjsvsjspwnirgrn91z")))))
235
236;;; Define the versions of rust needed to build Firefox, trying to match
237;;; upstream. See table at [0], `Uses' column for the specific version.
238;;; Using `rust' will likely lead to a newer version then listed in the table,
239;;; but since in Guix only the latest packaged Rust is officially supported,
240;;; it is a tradeoff worth making.
241;;; [0]: https://firefox-source-docs.mozilla.org/writing-rust-code/update-policy.html
242(define rust-librewolf rust-1.95)
243
244;; Update this id with every update to its release date.
245;; It's used for cache validation and therefore can lead to strange bugs.
246;; ex: date '+%Y%m%d%H%M%S'
247;; or: (format-time-string "%Y%m%d%H%M%S")
248(define %librewolf-build-id "20261011155700")
249
250(define-public librewolf
251 (package
252 (name "librewolf")
253 (version "157.0.1-1")
254 (source
255 (make-librewolf-source
256 #:version version
257 #:firefox-hash "0k0w4kp65daf2q6dl2spsfpfpikk20xl872kwiwj9psrj3pfsfs8"
258 #:librewolf-hash "0r7n19g1in3kfrbb4bkjykgab7px292dyy0siwwrzj7sr2nd0g72"
259 #:l10n firefox-l10n))
260 (build-system gnu-build-system)
261 (arguments
262 (list
263 #:configure-flags
264 #~(let ((clang #$(this-package-native-input "clang")))
265 ;; Configuration.
266 `("--enable-jemalloc"
267 "--enable-system-pixman"
268 "--with-system-ffi"
269 "--with-system-icu"
270 "--with-system-jpeg"
271 "--with-system-libevent"
272 "--with-system-libvpx"
273 "--with-system-nspr"
274 "--with-system-nss"
275 "--with-system-png"
276 "--with-system-webp"
277 "--with-system-zlib"
278 "--without-wasm-sandboxed-libraries"
279
280 ,(string-append "--with-clang-path=" clang
281 "/bin/clang")
282 ,(string-append "--with-libclang-path=" clang
283 "/lib")
284
285 ;; Distribution
286 "--with-distribution-id=org.guix"
287
288 ;; Features
289 "--enable-pulseaudio"
290
291 ;; switch only available on x86, whereas EME is not supported on
292 ;; other targets
293 ,@(if #$(target-x86?) '("--disable-eme") '())
294
295 ;; Build details
296 "--disable-elf-hack"
297 "--enable-strip"
298 ;; Don't attempt to download toolchains. Upstream enables this,
299 ;; adding the flag ensures we don't use network in the build
300 ;; environment.
301 "--disable-bootstrap"))
302 #:imported-modules %cargo-utils-modules
303 #:modules `((ice-9 regex)
304 (ice-9 string-fun)
305 (ice-9 ftw)
306 (srfi srfi-1)
307 (srfi srfi-26)
308 (rnrs bytevectors)
309 (rnrs io ports)
310 (guix elf)
311 (guix build gremlin)
312 ,@%default-gnu-imported-modules)
313 #:phases
314 #~(modify-phases %standard-phases
315 (add-after 'unpack 'fix-ffmpeg-runtime-linker
316 (lambda* (#:key inputs #:allow-other-keys)
317 (let* ((ffmpeg (assoc-ref inputs "ffmpeg"))
318 (libavcodec (string-append ffmpeg
319 "/lib/libavcodec.so")))
320 ;; Arrange to load libavcodec.so by its absolute file name.
321 (substitute*
322 "dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp"
323 (("libavcodec\\.so")
324 libavcodec)))))
325 (add-after 'unpack 'neuter-genai
326 (lambda* _
327 ;; Lock the preferences so they can't be enabled.
328 (substitute* "lw/librewolf.cfg"
329 (("defaultPref\\(\"browser\\.ml\\.")
330 "lockPref(\"browser.ml."))))
331 (add-after 'unpack 'expand-extension-scope
332 (lambda* _
333 ;; Required for Guix packaged extensions
334 ;; SCOPE_PROFILE=1, SCOPE_APPLICATION=4, SCOPE_SYSTEM=8
335 ;; Default is 5.
336 (substitute* "lw/librewolf.cfg"
337 (("defaultPref\\(\"extensions.enabledScopes\", 5\\)")
338 "defaultPref(\"extensions.enabledScopes\", 13)"))))
339 (add-after 'unpack 'use-mozzarella
340 (lambda _
341 (substitute*
342 "toolkit/locales/en-US/toolkit/about/aboutAddons.ftl"
343 (("addons.mozilla.org")
344 "gnuzilla.gnu.org"))
345 (call-with-port (open-file "lw/librewolf.cfg" "a")
346 (lambda (port)
347 ;; Add-ons panel (see settings.js in Icecat source).
348 (for-each
349 (lambda (pref)
350 (format port
351 "defaultPref(~s, ~s);~%"
352 (car pref)
353 (cdr pref)))
354 `(("extensions.getAddons.search.browseURL"
355 ,(string-append
356 "https://gnuzilla.gnu.org/"
357 "search.php?q=%TERMS%"))
358 ("extensions.getAddons.get.url" .
359 "https://gnuzilla.gnu.org")
360 ("extensions.getAddons.link.url" .
361 "https://gnuzilla.gnu.org")
362 ("extensions.getAddons.discovery.api_url" .
363 "https://gnuzilla.gnu.org")
364 ("extensions.getAddons.langpacks.url" .
365 "https://gnuzilla.gnu.org")
366 ("lightweightThemes.getMoreURL" .
367 "https://gnuzilla.gnu.org")))))))
368 (add-after 'patch-source-shebangs 'patch-cargo-checksums
369 (lambda _
370 (use-modules (guix build cargo-utils))
371 (let ((null-hash
372 ;; This is the SHA256 output of an empty string.
373 (string-append
374 "e3b0c44298fc1c149afbf4c8996fb924"
375 "27ae41e4649b934ca495991b7852b855")))
376 (for-each
377 (lambda (file)
378 (format #t
379 "patch-cargo-checksums: patching checksums in ~a~%"
380 file)
381 (substitute* file
382 (("(checksum = )\".*\"" all name)
383 (string-append name "\"" null-hash
384 "\""))))
385 (find-files "." "Cargo\\.lock$"))
386 (for-each generate-all-checksums
387 '("build"
388 "dom/media"
389 "dom/webauthn"
390 "gfx"
391 "intl"
392 "js"
393 "media"
394 "modules"
395 "mozglue/static/rust"
396 "netwerk"
397 "remote"
398 "security/manager/ssl"
399 "servo"
400 "storage"
401 "third_party/rust"
402 "toolkit"
403 "xpcom/rust"
404 "services")))))
405 (add-after 'patch-cargo-checksums 'remove-cargo-frozen-flag
406 (lambda _
407 ;; Remove --frozen flag from cargo invocation, otherwise it'll
408 ;; complain that it's not able to change Cargo.lock.
409 ;; https://bugzilla.mozilla.org/show_bug.cgi?id=1726373
410 (substitute* "build/RunCbindgen.py"
411 (("args.append\\(\"--frozen\"\\)") "pass"))))
412 (delete 'bootstrap)
413 (add-before 'configure 'patch-SpeechDispatcherService.cpp
414 (lambda _
415 (let* ((lib "libspeechd.so.2")
416 (file (string-append
417 "dom/media/webspeech/synth/"
418 "speechd/SpeechDispatcherService.cpp"))
419 (old-content (call-with-input-file file
420 get-string-all)))
421 (substitute
422 file
423 `((,(format #f "~s" lib) unquote
424 (lambda (line _)
425 (string-replace-substring
426 line lib
427 (string-append #$speech-dispatcher
428 "/lib/" lib))))))
429 (if (string=? old-content
430 (call-with-input-file file
431 get-string-all))
432 (error
433 "substitute did nothing, phase requires an update")))))
434 (add-before 'configure 'set-build-id
435 ;; Build will write the timestamp to output, which is harmful
436 ;; for reproducibility, so change it to a fixed date. Use a
437 ;; separate phase for easier modification with inherit.
438 (lambda _
439 (setenv "MOZ_BUILD_DATE"
440 #$%librewolf-build-id)))
441 (replace 'configure
442 (lambda* (#:key inputs outputs configure-flags
443 #:allow-other-keys)
444 (setenv "AUTOCONF"
445 (string-append (assoc-ref inputs "autoconf")
446 "/bin/autoconf"))
447 (setenv "SHELL"
448 (which "bash"))
449 (setenv "CONFIG_SHELL"
450 (which "bash"))
451 (setenv "MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE"
452 "system")
453 (setenv "LANG" "en_US.utf8")
454 ;; This should use the host info probably (does it
455 ;; build on non-x86_64 though?)
456 (setenv "GUIX_PYTHONPATH"
457 (string-append
458 (getcwd)
459 "/obj-x86_64-pc-linux-gnu/_virtualenvs/build"))
460
461 ;; Use Clang, Clang is 2x faster than GCC
462 (setenv "AR" "llvm-ar")
463 (setenv "NM" "llvm-nm")
464 (setenv "CC" "clang")
465 (setenv "CXX" "clang++")
466 (setenv "MOZ_NOSPAM" "1")
467 (setenv "MOZ_APP_REMOTINGNAME" "LibreWolf")
468 (setenv "MOZ_APP_NAME" "librewolf")
469
470 (setenv "MOZBUILD_STATE_PATH"
471 (getcwd))
472
473 (let* ((mozconfig (string-append (getcwd) "/mozconfig"))
474 (out (assoc-ref outputs "out"))
475 (flags (cons (string-append "--prefix=" out)
476 configure-flags)))
477 (format #t "build directory: ~s~%"
478 (getcwd))
479 (format #t "configure flags: ~s~%" flags)
480
481 (call-with-port (open-file mozconfig "a")
482 (lambda (port)
483 (format port "~%## Guix-specific options ##~%~%")
484 (for-each
485 (lambda (flag) (format port "ac_add_options ~a\n" flag))
486 flags)
487 (display "\n" port)))
488 (setenv "MOZCONFIG" mozconfig))
489 (invoke "./mach" "configure")))
490 (replace 'build
491 (lambda* (#:key (make-flags '())
492 (parallel-build? #t) #:allow-other-keys)
493 (apply invoke "./mach" "build"
494 ;; mach will use parallel build if possible by default
495 (string-append
496 "-j" (if parallel-build?
497 (number->string (parallel-job-count))
498 "1"))
499 make-flags)))
500 (add-after 'build 'neutralise-store-references
501 (lambda _
502 ;; Mangle the store references to compilers &
503 ;; other build tools in about:buildconfig,
504 ;; reducing the package's closure by 1 GiB on
505 ;; x86-64.
506 (let* ((build-dir (car (scandir "."
507 (cut string-prefix?
508 "obj-" <>))))
509 (file (string-append build-dir
510 "/dist/bin/chrome/toolkit/"
511 "content/global/buildconfig.html")))
512 (substitute* file
513 (((format #f "(~a/)([0-9a-df-np-sv-z]{32})"
514 (regexp-quote (%store-directory)))
515 _ store hash)
516 (string-append store
517 (string-take hash 8)
518 "<!-- Guix: not a runtime dependency -->"
519 (string-drop hash 8)))))))
520 (replace 'install
521 (lambda _
522 (invoke "./mach" "install")))
523 (add-after 'install 'remove-duplicate-bin
524 (lambda* (#:key outputs #:allow-other-keys)
525 (delete-file (string-append #$output
526 "/lib/librewolf/librewolf-bin"))))
527 (add-after 'install 'wrap-program
528 (lambda* (#:key inputs outputs #:allow-other-keys)
529 ;; The following two functions are from Guix's icecat package in
530 ;; (gnu packages gnuzilla). See commit
531 ;; b7a0935420ee630a29b7e5ac73a32ba1eb24f00b.
532 (define (runpath-of lib)
533 (call-with-input-file lib
534 (compose elf-dynamic-info-runpath elf-dynamic-info
535 parse-elf get-bytevector-all)))
536 (define (runpaths-of-input label)
537 (let* ((dir (string-append (assoc-ref inputs label)
538 "/lib"))
539 (libs (find-files dir "\\.so$")))
540 (append-map runpath-of libs)))
541 (let* ((out (assoc-ref outputs "out"))
542 (lib (string-append out "/lib"))
543 (libs (map
544 (lambda (lib-name)
545 (string-append (assoc-ref inputs
546 lib-name)
547 "/lib"))
548 '("eudev" ; For U2F and WebAuthn
549 "libnotify"
550 "libpng-apng"
551 "libva"
552 "mesa"
553 "pipewire" ; For sharing on Wayland
554 "pulseaudio"
555 "libpciaccess")))
556
557 (gtk-share (string-append (assoc-ref inputs
558 "gtk+")
559 "/share")))
560 (wrap-program (car (find-files lib "^librewolf$"))
561 `("LD_LIBRARY_PATH" prefix ,libs)
562 `("XDG_DATA_DIRS" prefix
563 (,gtk-share))
564 `("MOZ_LEGACY_PROFILES" =
565 ("1"))
566 `("MOZ_ALLOW_DOWNGRADE" =
567 ("1"))))))
568 (add-after 'wrap-program 'install-desktop-entry
569 (lambda* (#:key inputs outputs #:allow-other-keys)
570 (let* ((desktop-file-name "librewolf.desktop")
571 (desktop-file-template
572 (search-input-file inputs "assets/linux.librewolf.desktop.in"))
573 (applications (string-append #$output
574 "/share/applications")))
575 (copy-file desktop-file-template desktop-file-name)
576 (substitute* desktop-file-name
577 (("MYDIR/librewolf")
578 (string-append #$output "/bin/librewolf"))
579 (("^Icon=librewolf")
580 (string-append "Icon="
581 #$output
582 "/share/icons/hicolor/128x128/apps/librewolf.png")))
583 (install-file desktop-file-name applications))))
584 (add-after 'install-desktop-entry 'install-icons
585 (lambda* (#:key outputs #:allow-other-keys)
586 (let ((icon-source-dir (string-append #$output
587 "/lib/librewolf/browser/"
588 "chrome/icons/default")))
589 (for-each (lambda (size)
590 (let ((dest (string-append #$output
591 "/share/icons/hicolor/"
592 size
593 "x"
594 size
595 "/apps")))
596 (mkdir-p dest)
597 (symlink (string-append icon-source-dir
598 "/default" size ".png")
599 (string-append dest
600 "/librewolf.png"))))
601 '("16" "32" "48" "64" "128")))))
602 ;; Make sure ICECAT_SYSTEM_DIR is set to avoid issues with Native
603 ;; Messaging and non-guix add-ons.
604 (add-after 'install-icons 'mkdir-lib-icecat
605 (lambda _
606 (mkdir-p (string-append #$output "/lib/icecat")))))
607
608 ;; Test will significantly increase build time but with little rewards.
609 #:tests? #f
610
611 ;; WARNING: Parallel build will consume lots of memory!
612 ;; If you have encountered OOM issue in build phase, try disable it.
613 #:parallel-build? #t
614
615 ;; Some dynamic lib was determined at runtime, so rpath check may fail.
616 #:validate-runpath? #f))
617 (inputs (list bash-minimal
618 bzip2
619 cairo
620 cups
621 dbus-glib
622 freetype
623 ffmpeg-6
624 gdk-pixbuf
625 glib
626 gtk+
627 hunspell
628 icu4c-78
629 jemalloc
630 libcanberra
631 libevent
632 libffi
633 libgnome
634 libjpeg-turbo
635 libnotify
636 libpciaccess
637 libpng-apng-next
638 libva
639 libvpx
640 libwebp
641 libxcomposite
642 libxft
643 libxinerama
644 libxscrnsaver
645 libxt
646 mesa
647 mit-krb5
648 nspr
649 nss-rapid
650 pango
651 pciutils
652 pipewire
653 pixman
654 pulseaudio
655 speech-dispatcher
656 sqlite
657 startup-notification
658 eudev
659 unzip
660 zip
661 zlib))
662 (native-inputs
663 (list
664 alsa-lib
665 autoconf-2.13
666 clang-21
667 librewolf-bsys6
668 llvm-21
669 m4
670 nasm
671 node-lts
672 perl
673 pkg-config
674 python
675 rust-cbindgen-0.29
676 rust-librewolf
677 `(,rust-librewolf "cargo")
678 which
679 yasm))
680 (native-search-paths
681 (list (search-path-specification
682 (variable "ICECAT_SYSTEM_DIR")
683 (separator #f) ;single entry
684 (files '("lib/icecat")))))
685 (home-page "https://librewolf.net/")
686 (synopsis
687 "Custom version of Firefox, focused on privacy, security and freedom")
688 (description
689 "LibreWolf is designed to increase protection against tracking and
690fingerprinting techniques, while also including a few security improvements.
691This is achieved through our privacy and security oriented settings and
692patches. LibreWolf also aims to remove all the telemetry, data collection and
693annoyances, as well as disabling anti-freedom features like DRM.")
694 (license license:mpl2.0)))