| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 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 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 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 | |
| 178 | |
| 179 | (copy-recursively #+lw-src ".")
|
| 180 | (for-each make-file-writable (find-files "."))
|
| 181 |
|
| 182 | |
| 183 | |
| 184 | (substitute* '("Makefile")
|
| 185 | (("^(ff_source_tarball *:= *).*" _ var)
|
| 186 | (string-append var #+ff-src)))
|
| 187 |
|
| 188 | |
| 189 | (substitute* '("Makefile")
|
| 190 | (("if [ -f pk.asc ].*") ""))
|
| 191 |
|
| 192 | |
| 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 | |
| 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 | |
| 211 | |
| 212 | |
| 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 | |
| 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 | |
| 236 | |
| 237 | |
| 238 | |
| 239 | |
| 240 | |
| 241 | (define rust-librewolf rust-1.95)
|
| 242 |
|
| 243 | |
| 244 | |
| 245 | |
| 246 | |
| 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 | |
| 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 | |
| 285 | "--with-distribution-id=org.guix"
|
| 286 |
|
| 287 | |
| 288 | "--enable-pulseaudio"
|
| 289 |
|
| 290 | |
| 291 | |
| 292 | ,@(if #$(target-x86?) '("--disable-eme") '())
|
| 293 |
|
| 294 | |
| 295 | "--disable-elf-hack"
|
| 296 | "--enable-strip"
|
| 297 | |
| 298 | |
| 299 | |
| 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 | |
| 320 | (substitute*
|
| 321 | "dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp"
|
| 322 | (("libavcodec\\.so")
|
| 323 | libavcodec)))))
|
| 324 | (add-after 'unpack 'neuter-genai
|
| 325 | (lambda* _
|
| 326 | |
| 327 | (substitute* "lw/librewolf.cfg"
|
| 328 | (("defaultPref\\(\"browser\\.ml\\.")
|
| 329 | "lockPref(\"browser.ml."))))
|
| 330 | (add-after 'unpack 'expand-extension-scope
|
| 331 | (lambda* _
|
| 332 | |
| 333 | |
| 334 | |
| 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 | |
| 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 | |
| 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 | |
| 407 | |
| 408 | |
| 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 | |
| 435 | |
| 436 | |
| 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 | |
| 454 | |
| 455 | (setenv "GUIX_PYTHONPATH"
|
| 456 | (string-append
|
| 457 | (getcwd)
|
| 458 | "/obj-x86_64-pc-linux-gnu/_virtualenvs/build"))
|
| 459 |
|
| 460 | |
| 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 | |
| 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 | |
| 502 | |
| 503 | |
| 504 | |
| 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 | |
| 529 | |
| 530 | |
| 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" |
| 548 | "libnotify"
|
| 549 | "libpng-apng"
|
| 550 | "libva"
|
| 551 | "mesa"
|
| 552 | "pipewire" |
| 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 | |
| 602 | |
| 603 | (add-after 'install-icons 'mkdir-lib-icecat
|
| 604 | (lambda _
|
| 605 | (mkdir-p (string-append #$output "/lib/icecat")))))
|
| 606 |
|
| 607 | |
| 608 | #:tests? #f
|
| 609 |
|
| 610 | |
| 611 | |
| 612 | #:parallel-build? #t
|
| 613 |
|
| 614 | |
| 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) |
| 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
|
| 689 | fingerprinting techniques, while also including a few security improvements.
|
| 690 | This is achieved through our privacy and security oriented settings and
|
| 691 | patches. LibreWolf also aims to remove all the telemetry, data collection and
|
| 692 | annoyances, as well as disabling anti-freedom features like DRM.")
|
| 693 | (license license:mpl2.0)))
|