gnu: kdenlive: Add missing dependencies.
[jackhill/guix/guix.git] / gnu / packages / gnuzilla.scm
index a642f6a..7d6ed6b 100644 (file)
@@ -1,15 +1,19 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
-;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
 ;;; Copyright © 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
-;;; Copyright © 2017 ng0 <ng0@n0.is>
-;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
-;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2017, 2018 Nikita <nikita@n0.is>
+;;; Copyright © 2017, 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2018, 2020 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2019 Ivan Petkov <ivanppetkov@gmail.com>
+;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
+;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
+;;; Copyright © 2019, 2020 Adrian Malacoda <malacoda@monarch-pass.net>
+;;; Copyright © 2020 Jonathan Brielmaier <jonathan.brielmaier@web.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -41,6 +45,7 @@
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system cargo)
+  #:use-module (guix build-system trivial)
   #:use-module (gnu packages admin)
   #:use-module (gnu packages audio)
   #:use-module (gnu packages autotools)
      `(;; XXX: parallel build fails, lacking:
        ;;   mkdir -p "system_wrapper_js/"
        #:parallel-build? #f
+       #:make-flags '("CXXFLAGS=-fpermissive")
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'delete-timedout-test
@@ -550,8 +556,8 @@ from forcing GEXP-PROMISE."
                       #:system system
                       #:guile-for-build guile)))
 
-(define %icecat-version "68.3.0-guix0-preview1")
-(define %icecat-build-id "20191204000000") ;must be of the form YYYYMMDDhhmmss
+(define %icecat-version "68.12.0-guix0-preview1")
+(define %icecat-build-id "20200825000000") ;must be of the form YYYYMMDDhhmmss
 
 ;; 'icecat-source' is a "computed" origin that generates an IceCat tarball
 ;; from the corresponding upstream Firefox ESR tarball, using the 'makeicecat'
@@ -573,11 +579,11 @@ from forcing GEXP-PROMISE."
                   "firefox-" upstream-firefox-version ".source.tar.xz"))
             (sha256
              (base32
-              "0sfwp9vyjizj1lkvj6z51r85dl41q3l8380fkdyqdbp7f2d18cg1"))))
+              "1k17pi4zh9hrvkzbw4rzzw879a15hpvwriylp75wl22rl7r2nsdf"))))
 
-         (upstream-icecat-base-version "68.3.0") ; maybe older than base-version
+         (upstream-icecat-base-version "68.12.0") ; maybe older than base-version
          ;;(gnuzilla-commit (string-append "v" upstream-icecat-base-version))
-         (gnuzilla-commit "85e99badac11983f6d50b0d9942f66a30f55b8e5")
+         (gnuzilla-commit "15a7c3d991a670b6489d4f432b52a188358f4ca5")
          (gnuzilla-source
           (origin
             (method git-fetch)
@@ -589,10 +595,12 @@ from forcing GEXP-PROMISE."
                                       (string-take gnuzilla-commit 8)))
             (sha256
              (base32
-              "00mb734yvm0r7i64mbg7hvrvhbwkcii9f9hjgwi37aizd9k0n78a"))))
+              "0n7p067yay413iy0gzprz0xrdkcxj5f8ywhkcghhhzw1nwajckba"))))
 
          (makeicecat-patch
-          (local-file (search-patch "icecat-makeicecat.patch"))))
+          (local-file (search-patch "icecat-makeicecat.patch")))
+         (gnuzilla-fixes-patch
+          (local-file (search-patch "icecat-use-older-reveal-hidden-html.patch"))))
 
     (origin
       (method computed-origin-method)
@@ -638,6 +646,8 @@ from forcing GEXP-PROMISE."
                   (make-file-writable "makeicecat")
                   (invoke "patch" "--force" "--no-backup-if-mismatch"
                           "-p1" "--input" #+makeicecat-patch)
+                  (invoke "patch" "--force" "--no-backup-if-mismatch"
+                          "-p1" "--input" #+gnuzilla-fixes-patch)
                   (patch-shebang "makeicecat")
                   (substitute* "makeicecat"
                     (("^FFMAJOR=(.*)" all ffmajor)
@@ -746,7 +756,7 @@ from forcing GEXP-PROMISE."
        ("libxt" ,libxt)
        ("libffi" ,libffi)
        ("ffmpeg" ,ffmpeg)
-       ("libvpx" ,libvpx-1.7)
+       ("libvpx" ,libvpx)
        ("icu4c" ,icu4c)
        ("pixman" ,pixman)
        ("pulseaudio" ,pulseaudio)
@@ -756,6 +766,7 @@ from forcing GEXP-PROMISE."
        ;;   and related comments in the 'remove-bundled-libraries' phase.
        ;; UNBUNDLE-ME! ("nspr" ,nspr)
        ;; UNBUNDLE-ME! ("nss" ,nss)
+       ("shared-mime-info" ,shared-mime-info)
        ("sqlite" ,sqlite)
        ("startup-notification" ,startup-notification)
        ("unzip" ,unzip)
@@ -879,9 +890,14 @@ from forcing GEXP-PROMISE."
 
        #:modules ((ice-9 ftw)
                   (ice-9 rdelim)
+                  (ice-9 regex)
                   (ice-9 match)
                   (srfi srfi-34)
                   (srfi srfi-35)
+                  (rnrs bytevectors)
+                  (rnrs io ports)
+                  (guix elf)
+                  (guix build gremlin)
                   ,@%gnu-build-system-modules)
        #:phases
        (modify-phases %standard-phases
@@ -966,11 +982,31 @@ from forcing GEXP-PROMISE."
              #t))
          (add-after 'link-libxul-with-libraries 'fix-ffmpeg-runtime-linker
            (lambda* (#:key inputs #:allow-other-keys)
-             ;; Arrange to load libavcodec.so by its absolute file name.
-             (substitute* "dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp"
-               (("libavcodec\\.so")
-                (string-append (assoc-ref inputs "ffmpeg") "/lib/libavcodec.so")))
-             #t))
+             (let* ((ffmpeg (assoc-ref inputs "ffmpeg"))
+                    (libavcodec (string-append ffmpeg "/lib/libavcodec.so")))
+               ;; Arrange to load libavcodec.so by its absolute file name.
+               (substitute* "dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp"
+                 (("libavcodec\\.so")
+                  libavcodec))
+               ;; Populate the sandbox read-path whitelist as needed by ffmpeg.
+               (let* ((mime-info (assoc-ref inputs "shared-mime-info"))
+                      (libavcodec-runpath (call-with-input-file libavcodec
+                                            (compose elf-dynamic-info-runpath
+                                                     elf-dynamic-info
+                                                     parse-elf
+                                                     get-bytevector-all)))
+                      (whitelist (cons (string-append mime-info "/share/mime/")
+                                       (map (lambda (dir)
+                                              (string-append dir "/"))
+                                            libavcodec-runpath)))
+                      (whitelist-string (string-join whitelist ","))
+                      (port (open-file "browser/app/profile/icecat.js" "a")))
+                 (format #t "setting 'security.sandbox.content.read_path_whitelist' to '~a'~%"
+                         whitelist-string)
+                 (format port "~%pref(\"security.sandbox.content.read_path_whitelist\", ~S);~%"
+                         whitelist-string)
+                 (close-output-port port))
+               #t)))
          (replace 'bootstrap
            (lambda _
              (invoke "sh" "-c" "autoconf old-configure.in > old-configure")
@@ -986,20 +1022,6 @@ from forcing GEXP-PROMISE."
                   (string-append name "\"" null-hash "\"")))
                (generate-all-checksums "third_party/rust"))
              #t))
-         (add-before 'configure 'augment-CPLUS_INCLUDE_PATH
-           (lambda* (#:key build inputs #:allow-other-keys)
-             ;; Here, we add additional entries to CPLUS_INCLUDE_PATH, to work
-             ;; around a problem that otherwise occurs when attempting to
-             ;; build Stylo, which requires Rust and Clang.  Without these
-             ;; additional entries, errors occur during the build indicating
-             ;; that the <cstddef> and "c++config.h" headers cannot be found.
-             ;; Note that the 'build' keyword argument contains the GNU
-             ;; triplet, e.g. "x86_64-unknown-linux-gnu".
-             (let ((gcc (assoc-ref inputs "gcc")))
-               (setenv "CPLUS_INCLUDE_PATH"
-                       (string-append gcc "/include/c++" ":"
-                                      gcc "/include/c++/" build)))
-             #t))
          (replace 'configure
            ;; configure does not work followed by both "SHELL=..." and
            ;; "CONFIG_SHELL=..."; set environment variables instead
@@ -1040,6 +1062,20 @@ from forcing GEXP-PROMISE."
                                 (force-output)
                                 (retry (- remaining-attempts 1))))
                        (apply build args)))))))
+         (add-after 'build 'neutralise-store-references
+           (lambda _
+             ;; Mangle the store references to compilers & other build tools in
+             ;; about:buildconfig, reducing IceCat's closure by 1 GiB on x86-64.
+             (substitute*
+                 "dist/bin/chrome/toolkit/content/global/buildconfig.html"
+               (((format #f "(~a/)([0-9a-df-np-sv-z]{32})"
+                         (regexp-quote (%store-directory)))
+                 _ store hash)
+                (string-append store
+                               (string-take hash 8)
+                               "<!-- Guix: not a runtime dependency -->"
+                               (string-drop hash 8))))
+             #t))
          (add-before 'configure 'install-desktop-entry
            (lambda* (#:key outputs #:allow-other-keys)
              ;; Install the '.desktop' file.
@@ -1076,11 +1112,15 @@ from forcing GEXP-PROMISE."
                     (lib (string-append out "/lib"))
                     (gtk (assoc-ref inputs "gtk+"))
                     (gtk-share (string-append gtk "/share"))
+                    (mesa (assoc-ref inputs "mesa"))
+                    (mesa-lib (string-append mesa "/lib"))
                     (pulseaudio (assoc-ref inputs "pulseaudio"))
-                    (pulseaudio-lib (string-append pulseaudio "/lib")))
+                    (pulseaudio-lib (string-append pulseaudio "/lib"))
+                    (libxscrnsaver (assoc-ref inputs "libxscrnsaver"))
+                    (libxscrnsaver-lib (string-append libxscrnsaver "/lib")))
                (wrap-program (car (find-files lib "^icecat$"))
                  `("XDG_DATA_DIRS" prefix (,gtk-share))
-                 `("LD_LIBRARY_PATH" prefix (,pulseaudio-lib)))
+                 `("LD_LIBRARY_PATH" prefix (,pulseaudio-lib ,mesa-lib ,libxscrnsaver-lib)))
                #t))))))
     (home-page "https://www.gnu.org/software/gnuzilla/")
     (synopsis "Entirely free browser derived from Mozilla Firefox")
@@ -1098,7 +1138,364 @@ standards of the IceCat project.")
        (cpe-name . "firefox_esr")
        (cpe-version . ,(first (string-split version #\-)))))))
 
-(define-public conkeror
-  ;; The Conkeror web browser relied on XULRunner, which IceCat > 50 no longer
-  ;; provides.  See <http://conkeror.org> for the original web page.
-  (deprecated-package "conkeror" icecat))
+;; Update this together with icecat!
+(define %icedove-build-id "20200825000000") ;must be of the form YYYYMMDDhhmmss
+(define-public icedove
+  (package
+    (name "icedove")
+    (version "68.12.0")
+    (source icecat-source)
+    (properties
+     `((cpe-name . "thunderbird_esr")))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                              ; no check target
+       #:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums'
+       #:modules ((guix build utils)    ;find-files
+                  (sxml simple)
+                  (ice-9 regex)
+                  ,@%gnu-build-system-modules)
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'prepare-thunderbird-sources
+           (lambda* (#:key inputs #:allow-other-keys)
+             (mkdir "comm")
+             (copy-recursively (assoc-ref inputs "thunderbird-sources")
+                               "comm")
+             (delete-file-recursively "obj-x86_64-pc-linux-gnu")
+             (delete-file "sourcestamp.txt")
+             #t))
+         (add-after 'patch-source-shebangs 'patch-cargo-checksums
+           (lambda _
+             (use-modules (guix build cargo-utils))
+             (let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
+               (substitute* '("Cargo.lock" "gfx/wr/Cargo.lock")
+                 (("(\"checksum .* = )\".*\"" all name)
+                  (string-append name "\"" null-hash "\"")))
+               (generate-all-checksums "third_party/rust"))
+             #t))
+         ;; Fixes issue where each installation directory generates its own profile.
+         ;; See e.g. https://trac.torproject.org/projects/tor/ticket/31457
+         (add-after 'patch-source-shebangs 'fix-profile-setting
+           (lambda _
+             (substitute* "comm/mail/moz.configure"
+               (("'MOZ_DEDICATED_PROFILES', True")
+                "'MOZ_DEDICATED_PROFILES', False"))
+             #t))
+         (add-after 'prepare-thunderbird-sources 'rename-to-icedove
+           (lambda _
+             (substitute* "comm/mail/confvars.sh"
+               (("MOZ_APP_BASENAME=Thunderbird")
+                "MOZ_APP_BASENAME=Icedove\nMOZ_APP_DISPLAYNAME=Icedove")
+               (("MOZ_APP_NAME=thunderbird")
+                "MOZ_APP_NAME=icedove")
+               (("MOZ_UPDATER=1")
+                "MOZ_UPDATER=0"))
+             ;; Remove branding to comply with Mozilla's trademark policy
+             (with-directory-excursion "comm/mail/branding/nightly"
+               (delete-file "content/about-wordmark.svg")
+               (call-with-output-file "content/about-wordmark.svg"
+                 (lambda (port)
+                   (sxml->xml '(svg (@ (xmlns "http://www.w3.org/2000/svg")
+                                       (viewBox "0 0 789.1 90.78")
+                                       (width "333")
+                                       (height "48")
+                                       (fill "#fff"))
+                                    (text (@ (x "400") (y "70")
+                                             (text-anchor "middle")
+                                             (font-size "90"))
+                                          "Icedove Daily"))
+                              port)))
+               (substitute* '("locales/en-US/brand.properties"
+                              "locales/en-US/brand.ftl"
+                              "locales/en-US/brand.dtd"
+                              "configure.sh")
+                 (("Thunderbird") "Icedove")
+                 (("mozilla.org") "guix.gnu.org")))
+             ;; Remove other mentions of Thunderbird in user-visible text.
+             (with-directory-excursion "comm/mail/base/content"
+               (substitute* '("newInstallPage.xhtml"
+                              "overrides/app-license-name.html"
+                              "newInstall.xul")
+                 (("Thunderbird") "Icedove")))
+             (with-directory-excursion "comm/mail/components/"
+               (substitute* '("mailGlue.js"
+                              "extensions/schemas/addressBook.json"
+                              "extensions/schemas/tabs.json"
+                              "extensions/schemas/cloudFile.json"
+                              "extensions/schemas/chrome_settings_overrides.json"
+                              "extensions/schemas/windows.json"
+                              "extensions/parent/ext-mail.js"
+                              "im/messages/mail/Info.plist"
+                              "enterprisepolicies/moz.build"
+                              "enterprisepolicies/helpers/moz.build"
+                              "enterprisepolicies/schemas/moz.build"
+                              "preferences/chat.inc.xul")
+                 (("Thunderbird") "Icedove")))
+             (substitute* "comm/calendar/lightning/lightning-packager.mk"
+               (("ifeq \\(thunderbird")
+                "ifeq (icedove"))
+             (substitute* '("comm/mailnews/base/prefs/content/accountUtils.js"
+                            "comm/mailnews/extensions/newsblog/content/feed-subscriptions.js"
+                            "comm/common/src/customizeToolbar.js")
+               (("AppConstants.MOZ_APP_NAME (.)= \"thunderbird" _ e)
+                (format #f "AppConstants.MOZ_APP_NAME ~a= \"icedove" e)))
+
+             ;; Override addon URLs and settings
+             (substitute* "comm/mail/app/profile/all-thunderbird.js"
+               (("(pref\\(\"extensions.webservice.discoverURL\").*" _ m)
+                (string-append m ", \"https://directory.fsf.org/wiki/Icedove\");"))
+               (("(pref\\(\"extensions.getAddons.search.url\").*" _ m)
+                (string-append m ", \"https://guix.gnu.org/packages\");"))
+               (("(pref\\(\"extensions.update.enabled\").*" _ m)
+                (string-append m ", false);"))
+               (("(pref\\(\"extensions.systemAddon.update.enabled\").*" _ m)
+                (string-append m ", false);"))
+               (("(pref\\(\"lightweightThemes.update.enabled\").*" _ m)
+                (string-append m ", false);")))
+             #t))
+         (add-after 'build 'neutralize-store-references
+           (lambda _
+             ;; Mangle the store references to compilers & other build tools in
+             ;; about:buildconfig, reducing Icedove's closure significant.
+             ;; The resulting files are saved in lib/thunderbird/omni.ja
+             (substitute*
+                 ;; Use find because the path "obj-x86_64-pc-linux-gnu" contains
+                 ;; the architecture and the system -> more complicated.
+                 (find-files "." "buildconfig.html")
+               (((format #f "(~a/)([0-9a-df-np-sv-z]{32})"
+                         (regexp-quote (%store-directory)))
+                 _ store hash)
+                (string-append store
+                               (string-take hash 8)
+                               "<!-- Guix: not a runtime dependency -->"
+                               (string-drop hash 8))))
+             #t))
+         (replace 'configure
+           (lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bash (which "bash"))
+                    (abs-srcdir (getcwd))
+                    (srcdir (string-append "../" (basename abs-srcdir)))
+                    (flags `(,(string-append "--prefix=" out)
+                             ,@configure-flags))
+                    (mozconfig (string-append (getcwd) "/.mozconfig")))
+               (setenv "SHELL" bash)
+               (setenv "AUTOCONF"
+                       (string-append (assoc-ref %build-inputs
+                                                 "autoconf")
+                                      "/bin/autoconf"))
+               (setenv "CONFIG_SHELL" bash)
+               (setenv "QA_CONFIGURE_OPTIONS" ".*")
+               (setenv "MOZBUILD_STATE_PATH"
+                       (string-append (getcwd) "/mach_state"))
+               (setenv "MOZCONFIG"
+                       (string-append (getcwd) "/.mozconfig"))
+               (setenv "CC" "gcc")
+               (setenv "MOZ_NOSPAM" "1")
+               (setenv "PYTHON"
+                       (string-append (assoc-ref inputs "python2")
+                                      "/bin/python"))
+               (setenv "MOZ_BUILD_DATE" ,%icedove-build-id) ; avoid timestamp
+               (setenv "LDFLAGS" (string-append "-Wl,-rpath="
+                                                (assoc-ref outputs "out")
+                                                "/lib/icedove"))
+               (mkdir-p (string-append (getcwd) "/builddir"))
+               (with-output-to-file mozconfig
+                 (lambda ()
+                   (display
+                    (string-append
+                     "ac_add_options --disable-crashreporter\n"
+                     "ac_add_options --disable-debug\n"
+                     "ac_add_options --disable-debug-symbols\n"
+                     "ac_add_options --disable-elf-hack\n"
+                     "ac_add_options --disable-gconf\n"
+                     "ac_add_options --disable-ion\n"
+                     "ac_add_options --disable-necko-wifi\n"
+                     "ac_add_options --disable-official-branding\n"
+                     "ac_add_options --disable-tests\n"
+                     "ac_add_options --disable-updater\n"
+                     "ac_add_options --disable-webrtc\n"
+                     "ac_add_options --enable-application=comm/mail\n"
+                     "ac_add_options --enable-calendar\n"
+                     "ac_add_options --enable-content-sandbox\n"
+                     "ac_add_options --enable-default-toolkit=\"cairo-gtk3\"\n"
+                     "ac_add_options --enable-optimize\n"
+                     "ac_add_options --enable-pulseaudio\n"
+                     "ac_add_options --enable-release\n"
+                     "ac_add_options --enable-startup-notification\n"
+                     "ac_add_options --enable-strip\n"
+                     "ac_add_options --enable-system-ffi\n"
+                     "ac_add_options --enable-system-pixman\n"
+                     "ac_add_options --enable-system-sqlite\n"
+                     "ac_add_options --prefix=" out "\n"
+                     "ac_add_options --with-clang-path=" (assoc-ref %build-inputs "clang") "/bin/clang\n"
+                     "ac_add_options --with-distribution-id=org.gnu\n"
+                     "ac_add_options --with-libclang-path=" (assoc-ref %build-inputs "clang") "/lib\n"
+                     "ac_add_options --with-system-bz2\n"
+                     "ac_add_options --with-system-icu\n"
+                     "ac_add_options --with-system-jpeg\n"
+                     "ac_add_options --with-system-libevent\n"
+                     "ac_add_options --with-system-nspr\n"
+                     "ac_add_options --with-system-nss\n"
+                     "ac_add_options --with-system-zlib\n"
+                     "ac_add_options --with-user-appdir=\\.icedove\n"))))
+               (display (getcwd))
+               (newline)
+               (display "mach configure")
+               (invoke "./mach" "configure"))))
+         (replace 'build
+           (lambda _ (invoke "./mach" "build")))
+         (replace 'install
+           (lambda _ (invoke "./mach" "install")))
+         ;; Thunderbird doesn't provide any .desktop file.
+         ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1637575
+         (add-after 'install 'install-desktop-file
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (apps (string-append out "/share/applications")))
+               (mkdir-p apps)
+               (with-output-to-file (string-append apps "/icedove.desktop")
+                 (lambda _
+                   (format #t
+                           "[Desktop Entry]~@
+                            Name=Icedove~@
+                            Exec=~a/bin/icedove~@
+                            Icon=icedove~@
+                            GenericName=Mail/News Client~@
+                            Categories=Network;Email;~@
+                            Terminal=false~@
+                            StartupNotify=true~@
+                            MimeType=x-scheme-handler/mailto;~@
+                            Type=Application~@
+                            Actions=ComposeMessage;~@
+                            [Desktop Action ComposeMessage]~@
+                            Name=Write new message~@
+                            Exec=~@*~a/bin/icedove -compose~%"
+                           out))))
+             #t))
+         (add-after 'install 'wrap-program
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (lib (string-append out "/lib"))
+                    (gtk (assoc-ref inputs "gtk+"))
+                    (gtk-share (string-append gtk "/share"))
+                    (pulseaudio (assoc-ref inputs "pulseaudio"))
+                    (pulseaudio-lib (string-append pulseaudio "/lib")))
+               (wrap-program (car (find-files lib "^icedove$"))
+                 `("XDG_DATA_DIRS" prefix (,gtk-share))
+                 `("LD_LIBRARY_PATH" prefix (,pulseaudio-lib)))
+               #t))))))
+    (inputs
+     `(("bzip2" ,bzip2)
+       ("cairo" ,cairo)
+       ("cups" ,cups)
+       ("dbus-glib" ,dbus-glib)
+       ("ffmpeg" ,ffmpeg)
+       ("freetype" ,freetype)
+       ("gdk-pixbuf" ,gdk-pixbuf)
+       ("glib" ,glib)
+       ("gtk+" ,gtk+)
+       ("gtk+-2" ,gtk+-2)
+       ("hunspell" ,hunspell)
+       ("icu4c" ,icu4c)
+       ("libcanberra" ,libcanberra)
+       ("libevent" ,libevent)
+       ("libffi" ,libffi)
+       ("libgnome" ,libgnome)
+       ("libjpeg-turbo" ,libjpeg-turbo)
+       ("libpng-apng" ,libpng-apng)
+       ("libvpx" ,libvpx)
+       ("libxcomposite" ,libxcomposite)
+       ("libxft" ,libxft)
+       ("libxinerama" ,libxinerama)
+       ("libxscrnsaver" ,libxscrnsaver)
+       ("libxt" ,libxt)
+       ("mesa" ,mesa)
+       ("mit-krb5" ,mit-krb5)
+       ("nspr" ,nspr)
+       ("nss" ,nss)
+       ("pango" ,pango)
+       ("pixman" ,pixman)
+       ("pulseaudio" ,pulseaudio)
+       ("sqlite" ,sqlite)
+       ("startup-notification" ,startup-notification)
+       ("unzip" ,unzip)
+       ("zip" ,zip)
+       ("zlib" ,zlib)))
+    (native-inputs
+     `(("thunderbird-sources"
+        ;; The changeset identifier is taken from the file "sourcestamp.txt"
+        ;; in the Thunderbird release tarball.  We don't use the release
+        ;; tarball because it duplicates the Icecat sources and only adds the
+        ;; "comm" directory, which is provided by this repository.
+        ,(let ((changeset "b41cdff70b185358d9c4c1d4a36cfad15a24f001"))
+           (origin
+             (method hg-fetch)
+             (uri (hg-reference
+                   (url "https://hg.mozilla.org/releases/comm-esr68")
+                   (changeset changeset)))
+             (file-name (string-append "thunderbird-" version "-checkout"))
+             (sha256
+              (base32
+               "1xvky8p5r41mxdyg9amydy94p51wmmdwdz0zq2vzspr9viixf7xm")))))
+       ("autoconf" ,autoconf-2.13)
+       ("cargo" ,rust "cargo")
+       ("clang" ,clang)
+       ("llvm" ,llvm)
+       ("nasm" ,nasm)
+       ("node" ,node)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python)
+       ("python2" ,python-2.7)
+       ("rust" ,rust)
+       ("rust-cbindgen" ,rust-cbindgen)
+       ("which" ,which)
+       ("yasm" ,yasm)))
+    (home-page "https://www.thunderbird.net")
+    (synopsis "Rebranded Mozilla Thunderbird email client")
+    (description
+     "This package provides an email client built based on Mozilla
+Thunderbird.  It supports email, news feeds, chat, calendar and contacts.")
+    (license license:mpl2.0)))
+
+(define-public firefox-decrypt
+  (package
+    (name "firefox-decrypt")
+    (version "0.7.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/Unode/firefox_decrypt")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "17yyyxp47z4m8hnflcq34rc1y871515kr3f1y42j1l0yx3g0il07"))))
+    (build-system trivial-build-system)
+    (inputs
+     `(("nss" ,nss)
+       ("python" ,python)))
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+       (begin
+         (use-modules (guix build utils))
+         (setenv "PATH"
+                 (string-append
+                  (assoc-ref %build-inputs "python") "/bin"))
+         (copy-file (string-append (assoc-ref %build-inputs "source")
+                                   "/firefox_decrypt.py")
+                    "firefox_decrypt.py")
+         (substitute* "firefox_decrypt.py"
+           (("/usr/bin/env python") (which "python3"))
+           (("libnss3.so") (string-append (assoc-ref %build-inputs "nss")
+                                          "/lib/nss/libnss3.so")))
+         (install-file "firefox_decrypt.py" (string-append %output "/bin"))
+         #t)))
+    (home-page "https://github.com/Unode/firefox_decrypt/")
+    (synopsis "Tool to extract passwords from Mozilla profiles")
+    (description "Firefox Decrypt is a tool to extract passwords from
+Mozilla (Firefox, Waterfox, Thunderbird, SeaMonkey) profiles.")
+    (license license:gpl3+)))