| 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 "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 | |
| 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 | (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 | |
| 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 | |
| 212 | |
| 213 | |
| 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 | |
| 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 | |
| 237 | |
| 238 | |
| 239 | |
| 240 | |
| 241 | |
| 242 | (define rust-librewolf rust-1.95)
|
| 243 |
|
| 244 | |
| 245 | |
| 246 | |
| 247 | |
| 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 | |
| 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 | |
| 286 | "--with-distribution-id=org.guix"
|
| 287 |
|
| 288 | |
| 289 | "--enable-pulseaudio"
|
| 290 |
|
| 291 | |
| 292 | |
| 293 | ,@(if #$(target-x86?) '("--disable-eme") '())
|
| 294 |
|
| 295 | |
| 296 | "--disable-elf-hack"
|
| 297 | "--enable-strip"
|
| 298 | |
| 299 | |
| 300 | |
| 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 | |
| 321 | (substitute*
|
| 322 | "dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp"
|
| 323 | (("libavcodec\\.so")
|
| 324 | libavcodec)))))
|
| 325 | (add-after 'unpack 'neuter-genai
|
| 326 | (lambda* _
|
| 327 | |
| 328 | (substitute* "lw/librewolf.cfg"
|
| 329 | (("defaultPref\\(\"browser\\.ml\\.")
|
| 330 | "lockPref(\"browser.ml."))))
|
| 331 | (add-after 'unpack 'expand-extension-scope
|
| 332 | (lambda* _
|
| 333 | |
| 334 | |
| 335 | |
| 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 | |
| 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 | |
| 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 | |
| 408 | |
| 409 | |
| 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 | |
| 436 | |
| 437 | |
| 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 | |
| 455 | |
| 456 | (setenv "GUIX_PYTHONPATH"
|
| 457 | (string-append
|
| 458 | (getcwd)
|
| 459 | "/obj-x86_64-pc-linux-gnu/_virtualenvs/build"))
|
| 460 |
|
| 461 | |
| 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 | |
| 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 | |
| 503 | |
| 504 | |
| 505 | |
| 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 | |
| 530 | |
| 531 | |
| 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" |
| 549 | "libnotify"
|
| 550 | "libpng-apng"
|
| 551 | "libva"
|
| 552 | "mesa"
|
| 553 | "pipewire" |
| 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 | |
| 603 | |
| 604 | (add-after 'install-icons 'mkdir-lib-icecat
|
| 605 | (lambda _
|
| 606 | (mkdir-p (string-append #$output "/lib/icecat")))))
|
| 607 |
|
| 608 | |
| 609 | #:tests? #f
|
| 610 |
|
| 611 | |
| 612 | |
| 613 | #:parallel-build? #t
|
| 614 |
|
| 615 | |
| 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) |
| 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
|
| 690 | fingerprinting techniques, while also including a few security improvements.
|
| 691 | This is achieved through our privacy and security oriented settings and
|
| 692 | patches. LibreWolf also aims to remove all the telemetry, data collection and
|
| 693 | annoyances, as well as disabling anti-freedom features like DRM.")
|
| 694 | (license license:mpl2.0)))
|