projects/guix·blob java-team · refs

693 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 "1e09418678f567f24b53396f3175ca6863aa6b17"))
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 "1a4h0sprh02r618kn9zvg8cq6jx4krs7zdimk0jzjasw4r6r8nr5")))))
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 (begin
195 (substitute* "scripts/librewolf-patches.py"
196 (("l10n_dir = Path(\"..\", \"l10n\")")
197 (string-append
198 "l10n_dir = \"" #+l10n "\""))))
199
200 ;; Run the build script
201 (invoke "make" "all")
202 (copy-file (string-append "librewolf-" #$version
203 ".source.tar.gz")
204 #$output)))))
205 (patches
206 (search-patches
207 "librewolf-compare-paths.patch"
208 "librewolf-use-system-wide-dir.patch"
209 "librewolf-add-store-to-rdd-allowlist.patch"))
210 ;; Slim down the tarball by removing unbundled libraries and 75 Mo (800+
211 ;; Mo uncompressed) of unused tests.
212 ;; TODO: Unbundle security/nss and media/libpng.
213 (modules '((guix build utils)))
214 (snippet
215 #~(for-each delete-file-recursively
216 '("testing/web-platform"
217 "js/src/ctypes/libffi"
218 "ipc/chromium/src/third_party/libevent"
219 "media/libvpx"
220 "docs/nspr"
221 "media/libwebp"
222 "modules/zlib"))))))
223
224;; Needed for the .desktop.in file used in librewolf's 'install-desktop-entry
225(define librewolf-bsys6
226 (let ((commit "274e39ee40592f8bc6ca5d4ee699ec74aeeab983"))
227 (origin
228 (method git-fetch)
229 (uri (git-reference
230 (url "https://librewolf.dev/librewolf/bsys6.git")
231 (commit commit)))
232 (file-name (git-file-name "librewolf-bsys6" commit))
233 (sha256 (base32 "15a2j1r5xrxvb9vr55138canwaj44nswzsfjsvsjspwnirgrn91z")))))
234
235;;; Define the versions of rust needed to build Firefox, trying to match
236;;; upstream. See table at [0], `Uses' column for the specific version.
237;;; Using `rust' will likely lead to a newer version then listed in the table,
238;;; but since in Guix only the latest packaged Rust is officially supported,
239;;; it is a tradeoff worth making.
240;;; [0]: https://firefox-source-docs.mozilla.org/writing-rust-code/update-policy.html
241(define rust-librewolf rust-1.95)
242
243;; Update this id with every update to its release date.
244;; It's used for cache validation and therefore can lead to strange bugs.
245;; ex: date '+%Y%m%d%H%M%S'
246;; or: (format-time-string "%Y%m%d%H%M%S")
247(define %librewolf-build-id "20260905095637")
248
249(define-public librewolf
250 (package
251 (name "librewolf")
252 (version "155.0.1-1")
253 (source
254 (make-librewolf-source
255 #:version version
256 #:firefox-hash "04qd6xa7jx13x42lrzlwdmsgh784yxi4xqgrgv70skcdg3aaqj3m"
257 #:librewolf-hash "0p30yafs8kn33avy0qhwflyd3w1n46qmy9w56pf011k86h898caj"
258 #:l10n firefox-l10n))
259 (build-system gnu-build-system)
260 (arguments
261 (list
262 #:configure-flags
263 #~(let ((clang #$(this-package-native-input "clang")))
264 ;; Configuration.
265 `("--enable-jemalloc"
266 "--enable-system-pixman"
267 "--with-system-ffi"
268 "--with-system-icu"
269 "--with-system-jpeg"
270 "--with-system-libevent"
271 "--with-system-libvpx"
272 "--with-system-nspr"
273 "--with-system-nss"
274 "--with-system-png"
275 "--with-system-webp"
276 "--with-system-zlib"
277 "--without-wasm-sandboxed-libraries"
278
279 ,(string-append "--with-clang-path=" clang
280 "/bin/clang")
281 ,(string-append "--with-libclang-path=" clang
282 "/lib")
283
284 ;; Distribution
285 "--with-distribution-id=org.guix"
286
287 ;; Features
288 "--enable-pulseaudio"
289
290 ;; switch only available on x86, whereas EME is not supported on
291 ;; other targets
292 ,@(if #$(target-x86?) '("--disable-eme") '())
293
294 ;; Build details
295 "--disable-elf-hack"
296 "--enable-strip"
297 ;; Don't attempt to download toolchains. Upstream enables this,
298 ;; adding the flag ensures we don't use network in the build
299 ;; environment.
300 "--disable-bootstrap"))
301 #:imported-modules %cargo-utils-modules
302 #:modules `((ice-9 regex)
303 (ice-9 string-fun)
304 (ice-9 ftw)
305 (srfi srfi-1)
306 (srfi srfi-26)
307 (rnrs bytevectors)
308 (rnrs io ports)
309 (guix elf)
310 (guix build gremlin)
311 ,@%default-gnu-imported-modules)
312 #:phases
313 #~(modify-phases %standard-phases
314 (add-after 'unpack 'fix-ffmpeg-runtime-linker
315 (lambda* (#:key inputs #:allow-other-keys)
316 (let* ((ffmpeg (assoc-ref inputs "ffmpeg"))
317 (libavcodec (string-append ffmpeg
318 "/lib/libavcodec.so")))
319 ;; Arrange to load libavcodec.so by its absolute file name.
320 (substitute*
321 "dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp"
322 (("libavcodec\\.so")
323 libavcodec)))))
324 (add-after 'unpack 'neuter-genai
325 (lambda* _
326 ;; Lock the preferences so they can't be enabled.
327 (substitute* "lw/librewolf.cfg"
328 (("defaultPref\\(\"browser\\.ml\\.")
329 "lockPref(\"browser.ml."))))
330 (add-after 'unpack 'expand-extension-scope
331 (lambda* _
332 ;; Required for Guix packaged extensions
333 ;; SCOPE_PROFILE=1, SCOPE_APPLICATION=4, SCOPE_SYSTEM=8
334 ;; Default is 5.
335 (substitute* "lw/librewolf.cfg"
336 (("defaultPref\\(\"extensions.enabledScopes\", 5\\)")
337 "defaultPref(\"extensions.enabledScopes\", 13)"))))
338 (add-after 'unpack 'use-mozzarella
339 (lambda _
340 (substitute*
341 "toolkit/locales/en-US/toolkit/about/aboutAddons.ftl"
342 (("addons.mozilla.org")
343 "gnuzilla.gnu.org"))
344 (call-with-port (open-file "lw/librewolf.cfg" "a")
345 (lambda (port)
346 ;; Add-ons panel (see settings.js in Icecat source).
347 (for-each
348 (lambda (pref)
349 (format port
350 "defaultPref(~s, ~s);~%"
351 (car pref)
352 (cdr pref)))
353 `(("extensions.getAddons.search.browseURL"
354 ,(string-append
355 "https://gnuzilla.gnu.org/"
356 "search.php?q=%TERMS%"))
357 ("extensions.getAddons.get.url" .
358 "https://gnuzilla.gnu.org")
359 ("extensions.getAddons.link.url" .
360 "https://gnuzilla.gnu.org")
361 ("extensions.getAddons.discovery.api_url" .
362 "https://gnuzilla.gnu.org")
363 ("extensions.getAddons.langpacks.url" .
364 "https://gnuzilla.gnu.org")
365 ("lightweightThemes.getMoreURL" .
366 "https://gnuzilla.gnu.org")))))))
367 (add-after 'patch-source-shebangs 'patch-cargo-checksums
368 (lambda _
369 (use-modules (guix build cargo-utils))
370 (let ((null-hash
371 ;; This is the SHA256 output of an empty string.
372 (string-append
373 "e3b0c44298fc1c149afbf4c8996fb924"
374 "27ae41e4649b934ca495991b7852b855")))
375 (for-each
376 (lambda (file)
377 (format #t
378 "patch-cargo-checksums: patching checksums in ~a~%"
379 file)
380 (substitute* file
381 (("(checksum = )\".*\"" all name)
382 (string-append name "\"" null-hash
383 "\""))))
384 (find-files "." "Cargo\\.lock$"))
385 (for-each generate-all-checksums
386 '("build"
387 "dom/media"
388 "dom/webauthn"
389 "gfx"
390 "intl"
391 "js"
392 "media"
393 "modules"
394 "mozglue/static/rust"
395 "netwerk"
396 "remote"
397 "security/manager/ssl"
398 "servo"
399 "storage"
400 "third_party/rust"
401 "toolkit"
402 "xpcom/rust"
403 "services")))))
404 (add-after 'patch-cargo-checksums 'remove-cargo-frozen-flag
405 (lambda _
406 ;; Remove --frozen flag from cargo invocation, otherwise it'll
407 ;; complain that it's not able to change Cargo.lock.
408 ;; https://bugzilla.mozilla.org/show_bug.cgi?id=1726373
409 (substitute* "build/RunCbindgen.py"
410 (("args.append\\(\"--frozen\"\\)") "pass"))))
411 (delete 'bootstrap)
412 (add-before 'configure 'patch-SpeechDispatcherService.cpp
413 (lambda _
414 (let* ((lib "libspeechd.so.2")
415 (file (string-append
416 "dom/media/webspeech/synth/"
417 "speechd/SpeechDispatcherService.cpp"))
418 (old-content (call-with-input-file file
419 get-string-all)))
420 (substitute
421 file
422 `((,(format #f "~s" lib) unquote
423 (lambda (line _)
424 (string-replace-substring
425 line lib
426 (string-append #$speech-dispatcher
427 "/lib/" lib))))))
428 (if (string=? old-content
429 (call-with-input-file file
430 get-string-all))
431 (error
432 "substitute did nothing, phase requires an update")))))
433 (add-before 'configure 'set-build-id
434 ;; Build will write the timestamp to output, which is harmful
435 ;; for reproducibility, so change it to a fixed date. Use a
436 ;; separate phase for easier modification with inherit.
437 (lambda _
438 (setenv "MOZ_BUILD_DATE"
439 #$%librewolf-build-id)))
440 (replace 'configure
441 (lambda* (#:key inputs outputs configure-flags
442 #:allow-other-keys)
443 (setenv "AUTOCONF"
444 (string-append (assoc-ref inputs "autoconf")
445 "/bin/autoconf"))
446 (setenv "SHELL"
447 (which "bash"))
448 (setenv "CONFIG_SHELL"
449 (which "bash"))
450 (setenv "MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE"
451 "system")
452 (setenv "LANG" "en_US.utf8")
453 ;; This should use the host info probably (does it
454 ;; build on non-x86_64 though?)
455 (setenv "GUIX_PYTHONPATH"
456 (string-append
457 (getcwd)
458 "/obj-x86_64-pc-linux-gnu/_virtualenvs/build"))
459
460 ;; Use Clang, Clang is 2x faster than GCC
461 (setenv "AR" "llvm-ar")
462 (setenv "NM" "llvm-nm")
463 (setenv "CC" "clang")
464 (setenv "CXX" "clang++")
465 (setenv "MOZ_NOSPAM" "1")
466 (setenv "MOZ_APP_REMOTINGNAME" "LibreWolf")
467 (setenv "MOZ_APP_NAME" "librewolf")
468
469 (setenv "MOZBUILD_STATE_PATH"
470 (getcwd))
471
472 (let* ((mozconfig (string-append (getcwd) "/mozconfig"))
473 (out (assoc-ref outputs "out"))
474 (flags (cons (string-append "--prefix=" out)
475 configure-flags)))
476 (format #t "build directory: ~s~%"
477 (getcwd))
478 (format #t "configure flags: ~s~%" flags)
479
480 (call-with-port (open-file mozconfig "a")
481 (lambda (port)
482 (format port "~%## Guix-specific options ##~%~%")
483 (for-each
484 (lambda (flag) (format port "ac_add_options ~a\n" flag))
485 flags)
486 (display "\n" port)))
487 (setenv "MOZCONFIG" mozconfig))
488 (invoke "./mach" "configure")))
489 (replace 'build
490 (lambda* (#:key (make-flags '())
491 (parallel-build? #t) #:allow-other-keys)
492 (apply invoke "./mach" "build"
493 ;; mach will use parallel build if possible by default
494 (string-append
495 "-j" (if parallel-build?
496 (number->string (parallel-job-count))
497 "1"))
498 make-flags)))
499 (add-after 'build 'neutralise-store-references
500 (lambda _
501 ;; Mangle the store references to compilers &
502 ;; other build tools in about:buildconfig,
503 ;; reducing the package's closure by 1 GiB on
504 ;; x86-64.
505 (let* ((build-dir (car (scandir "."
506 (cut string-prefix?
507 "obj-" <>))))
508 (file (string-append build-dir
509 "/dist/bin/chrome/toolkit/"
510 "content/global/buildconfig.html")))
511 (substitute* file
512 (((format #f "(~a/)([0-9a-df-np-sv-z]{32})"
513 (regexp-quote (%store-directory)))
514 _ store hash)
515 (string-append store
516 (string-take hash 8)
517 "<!-- Guix: not a runtime dependency -->"
518 (string-drop hash 8)))))))
519 (replace 'install
520 (lambda _
521 (invoke "./mach" "install")))
522 (add-after 'install 'remove-duplicate-bin
523 (lambda* (#:key outputs #:allow-other-keys)
524 (delete-file (string-append #$output
525 "/lib/librewolf/librewolf-bin"))))
526 (add-after 'install 'wrap-program
527 (lambda* (#:key inputs outputs #:allow-other-keys)
528 ;; The following two functions are from Guix's icecat package in
529 ;; (gnu packages gnuzilla). See commit
530 ;; b7a0935420ee630a29b7e5ac73a32ba1eb24f00b.
531 (define (runpath-of lib)
532 (call-with-input-file lib
533 (compose elf-dynamic-info-runpath elf-dynamic-info
534 parse-elf get-bytevector-all)))
535 (define (runpaths-of-input label)
536 (let* ((dir (string-append (assoc-ref inputs label)
537 "/lib"))
538 (libs (find-files dir "\\.so$")))
539 (append-map runpath-of libs)))
540 (let* ((out (assoc-ref outputs "out"))
541 (lib (string-append out "/lib"))
542 (libs (map
543 (lambda (lib-name)
544 (string-append (assoc-ref inputs
545 lib-name)
546 "/lib"))
547 '("eudev" ; For U2F and WebAuthn
548 "libnotify"
549 "libpng-apng"
550 "libva"
551 "mesa"
552 "pipewire" ; For sharing on Wayland
553 "pulseaudio"
554 "libpciaccess")))
555
556 (gtk-share (string-append (assoc-ref inputs
557 "gtk+")
558 "/share")))
559 (wrap-program (car (find-files lib "^librewolf$"))
560 `("LD_LIBRARY_PATH" prefix ,libs)
561 `("XDG_DATA_DIRS" prefix
562 (,gtk-share))
563 `("MOZ_LEGACY_PROFILES" =
564 ("1"))
565 `("MOZ_ALLOW_DOWNGRADE" =
566 ("1"))))))
567 (add-after 'wrap-program 'install-desktop-entry
568 (lambda* (#:key inputs outputs #:allow-other-keys)
569 (let* ((desktop-file-name "librewolf.desktop")
570 (desktop-file-template
571 (search-input-file inputs "assets/linux.librewolf.desktop.in"))
572 (applications (string-append #$output
573 "/share/applications")))
574 (copy-file desktop-file-template desktop-file-name)
575 (substitute* desktop-file-name
576 (("MYDIR/librewolf")
577 (string-append #$output "/bin/librewolf"))
578 (("^Icon=librewolf")
579 (string-append "Icon="
580 #$output
581 "/share/icons/hicolor/128x128/apps/librewolf.png")))
582 (install-file desktop-file-name applications))))
583 (add-after 'install-desktop-entry 'install-icons
584 (lambda* (#:key outputs #:allow-other-keys)
585 (let ((icon-source-dir (string-append #$output
586 "/lib/librewolf/browser/"
587 "chrome/icons/default")))
588 (for-each (lambda (size)
589 (let ((dest (string-append #$output
590 "/share/icons/hicolor/"
591 size
592 "x"
593 size
594 "/apps")))
595 (mkdir-p dest)
596 (symlink (string-append icon-source-dir
597 "/default" size ".png")
598 (string-append dest
599 "/librewolf.png"))))
600 '("16" "32" "48" "64" "128")))))
601 ;; Make sure ICECAT_SYSTEM_DIR is set to avoid issues with Native
602 ;; Messaging and non-guix add-ons.
603 (add-after 'install-icons 'mkdir-lib-icecat
604 (lambda _
605 (mkdir-p (string-append #$output "/lib/icecat")))))
606
607 ;; Test will significantly increase build time but with little rewards.
608 #:tests? #f
609
610 ;; WARNING: Parallel build will consume lots of memory!
611 ;; If you have encountered OOM issue in build phase, try disable it.
612 #:parallel-build? #t
613
614 ;; Some dynamic lib was determined at runtime, so rpath check may fail.
615 #:validate-runpath? #f))
616 (inputs (list bash-minimal
617 bzip2
618 cairo
619 cups
620 dbus-glib
621 freetype
622 ffmpeg-6
623 gdk-pixbuf
624 glib
625 gtk+
626 hunspell
627 icu4c-78
628 jemalloc
629 libcanberra
630 libevent
631 libffi
632 libgnome
633 libjpeg-turbo
634 libnotify
635 libpciaccess
636 libpng-apng-next
637 libva
638 libvpx
639 libwebp
640 libxcomposite
641 libxft
642 libxinerama
643 libxscrnsaver
644 libxt
645 mesa
646 mit-krb5
647 nspr
648 nss-rapid
649 pango
650 pciutils
651 pipewire
652 pixman
653 pulseaudio
654 speech-dispatcher
655 sqlite
656 startup-notification
657 eudev
658 unzip
659 zip
660 zlib))
661 (native-inputs
662 (list
663 alsa-lib
664 autoconf-2.13
665 clang-21
666 librewolf-bsys6
667 llvm-21
668 m4
669 nasm
670 node-lts
671 perl
672 pkg-config
673 python
674 rust-cbindgen-0.29
675 rust-librewolf
676 `(,rust-librewolf "cargo")
677 which
678 yasm))
679 (native-search-paths
680 (list (search-path-specification
681 (variable "ICECAT_SYSTEM_DIR")
682 (separator #f) ;single entry
683 (files '("lib/icecat")))))
684 (home-page "https://librewolf.net/")
685 (synopsis
686 "Custom version of Firefox, focused on privacy, security and freedom")
687 (description
688 "LibreWolf is designed to increase protection against tracking and
689fingerprinting techniques, while also including a few security improvements.
690This is achieved through our privacy and security oriented settings and
691patches. LibreWolf also aims to remove all the telemetry, data collection and
692annoyances, as well as disabling anti-freedom features like DRM.")
693 (license license:mpl2.0)))