Toggle quote (354 lines)
> * gnu/packages/icedove.scm: New module.
> * gnu/local.mk (GNU_SYSTEM_MODULES): Register it.
> Co-authored-by: ng0 <gillmann@infotropique.org>
> Co-authored-by: Adrian Malacoda <malacoda@monarch-pass.net>
> gnu/packages/icedove.scm | 322 +++++++++++++++++++++++++++++++++++++++
> 2 files changed, 323 insertions(+)
> create mode 100644 gnu/packages/icedove.scm
> diff --git a/gnu/local.mk b/gnu/local.mk
> index 4af79f0caf..3c09649111 100644
> @@ -264,6 +264,7 @@ GNU_SYSTEM_MODULES = \
> %D%/packages/hyperledger.scm \
> %D%/packages/ibus.scm \
> + %D%/packages/icedove.scm \
> %D%/packages/icu4c.scm \
> %D%/packages/idris.scm \
> %D%/packages/idutils.scm \
> diff --git a/gnu/packages/icedove.scm b/gnu/packages/icedove.scm
> index 0000000000..5e699898ac
> +++ b/gnu/packages/icedove.scm
> +;;; GNU Guix --- Functional package management for GNU
> +;;; Copyright (C) 2017, 2018 ng0 <gillmann@infotropique.org>
> +;;; Copyright (C) 2019, 2020 Adrian Malacoda <malacoda@monarch-pass.net>
> +;;; Copyright (C) 2020 Jonathan Brielmaier <jonathan.brielmaier@web.de>
> +;;; This file is part of GNU Guix.
> +;;; GNU Guix is free software; you can redistribute it and/or modify it
> +;;; under the terms of the GNU General Public License as published by
> +;;; the Free Software Foundation; either version 3 of the License, or (at
> +;;; your option) any later version.
> +;;; GNU Guix is distributed in the hope that it will be useful, but
> +;;; WITHOUT ANY WARRANTY; without even the implied warranty of
> +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +;;; GNU General Public License for more details.
> +;;; You should have received a copy of the GNU General Public License
> +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
> +(define-module (gnu packages icedove)
> + #:use-module (guix download)
> + #:use-module ((guix licenses) #:prefix license:)
> + #:use-module (guix packages)
> + #:use-module (guix utils)
> + #:use-module (guix build-system gnu)
> + #:use-module (guix build-system cargo)
> + #:use-module (gnu packages)
> + #:use-module (gnu packages autotools)
> + #:use-module (gnu packages assembly)
> + #:use-module (gnu packages base)
> + #:use-module (gnu packages commencement)
> + #:use-module (gnu packages compression)
> + #:use-module (gnu packages crates-io)
> + #:use-module (gnu packages cups)
> + #:use-module (gnu packages databases)
> + #:use-module (gnu packages fontutils)
> + #:use-module (gnu packages gcc)
> + #:use-module (gnu packages gl)
> + #:use-module (gnu packages glib)
> + #:use-module (gnu packages gnome)
> + #:use-module (gnu packages gtk)
> + #:use-module (gnu packages icu4c)
> + #:use-module (gnu packages image)
> + #:use-module (gnu packages kerberos)
> + #:use-module (gnu packages libcanberra)
> + #:use-module (gnu packages libevent)
> + #:use-module (gnu packages libffi)
> + #:use-module (gnu packages libreoffice) ;for hunspell
> + #:use-module (gnu packages linux)
> + #:use-module (gnu packages llvm)
> + #:use-module (gnu packages node)
> + #:use-module (gnu packages nss)
> + #:use-module (gnu packages perl)
> + #:use-module (gnu packages pkg-config)
> + #:use-module (gnu packages pulseaudio)
> + #:use-module (gnu packages python)
> + #:use-module (gnu packages readline)
> + #:use-module (gnu packages rust)
> + #:use-module (gnu packages rust-apps)
> + #:use-module (gnu packages sqlite)
> + #:use-module (gnu packages video)
> + #:use-module (gnu packages xdisorg)
> + #:use-module (gnu packages xorg))
> +(define %icedove-build-id "20200428000000")
> +(define-public icedove
> + (uri (string-append "https://archive.mozilla.org/pub/"
> + "thunderbird/releases/"
> + version "/source/thunderbird-" version
> + "112by5xzy9f28fj35yz644vby3c957apj5by2xm8b3qxxqpzsbmw"))))
> + (build-system gnu-build-system)
> + `(#:tests? #f ; no check target
> + ;; XXX: There are RUNPATH issues such as
> + ;; $prefix/lib/icecat-31.6.0/plugin-container NEEDing libmozalloc.so,
> + ;; which is not in its RUNPATH, but they appear to be harmless in
> + ;; practice somehow. See <http://hydra.gnu.org/build/378133>.
> + #:validate-runpath? #f
> + #:imported-modules ,%cargo-utils-modules ;for `generate-checksums'
> + #:modules ((guix build utils) ;find-files
> + ,@%gnu-build-system-modules)
> + (modify-phases %standard-phases
> + (add-after 'unpack 'remove-bundled-libraries
> + ;; Remove bundled libraries that we don't use.
> + (for-each (lambda (file)
> + (format #t "deleting '~a'...~%" file)
> + (delete-file-recursively file))
> + '(;; UNBUNDLE-ME! icu
> + (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)))
> + (add-after 'patch-source-shebangs 'patch-cargo-checksums
> + (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 "\"")))
> + (delete-file filename)
> + (let ((dir (dirname filename)))
> + (display (string-append
> + "patch-cargo-checksums: generate-checksums for "
> + (generate-checksums dir)))
> + (find-files "third_party/rust" ".cargo-checksum.json")))
> + ; 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
> + (let ((mozconfigure "comm/mail/moz.configure"))
> + (substitute* mozconfigure
> + (("'MOZ_DEDICATED_PROFILES', True")
> + "'MOZ_DEDICATED_PROFILES', False")))))
> + (add-after 'build 'neutralise-store-references
> + ;; 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
> + ;; 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)))
> + "<!-- Guix: not a runtime dependency -->"
> + (string-drop hash 8))))
> + (lambda* (#:key 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)
> + (mozconfig (string-append (getcwd) "/.mozconfig")))
> + (setenv "SHELL" bash)
> + (string-append (assoc-ref %build-inputs
> + (setenv "CONFIG_SHELL" bash)
> + (setenv "QA_CONFIGURE_OPTIONS" ".*")
> + (setenv "MOZBUILD_STATE_PATH"
> + (string-append (getcwd) "/mach_state"))
> + (string-append (getcwd) "/.mozconfig"))
> + (setenv "MOZ_NOSPAM" "1")
> + (string-append (assoc-ref %build-inputs
> + (setenv "MOZ_BUILD_DATE" ,%icedove-build-id) ; avoid timestamp
> + ;; (setenv "builddir" (string-append (getcwd) "/build"))
> + ;; (mkdir-p (getenv "MOZBUILD_STATE_PATH"))
> + (mkdir-p (string-append (getcwd) "/builddir"))
> + (with-output-to-file mozconfig
> + "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-alsa\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=\\.thunderbird\n"))))
> + (display "mach configure")
> + (delete-file-recursively "obj-x86_64-pc-linux-gnu")
> + (zero? (system* "./mach" "configure")))))
> + (zero? (system* "./mach" "build"))))
> + (zero? (system* "./mach" "install"))))
> + (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 "^thunderbird$"))
> + `("XDG_DATA_DIRS" prefix (,gtk-share))
> + `("LD_LIBRARY_PATH" prefix (,pulseaudio-lib)))
> + `(("alsa-lib" ,alsa-lib)
> + ("dbus-glib" ,dbus-glib)
> + ("freetype" ,freetype)
> + ("gdk-pixbuf" ,gdk-pixbuf)
> + ("hunspell" ,hunspell)
> + ("libcanberra" ,libcanberra)
> + ("libevent" ,libevent)
> + ("libgnome" ,libgnome)
> + ("libjpeg-turbo" ,libjpeg-turbo)
> + ("libpng-apng" ,libpng-apng)
> + ("libxcomposite" ,libxcomposite)
> + ("libxinerama" ,libxinerama)
> + ("libxscrnsaver" ,libxscrnsaver)
> + ("mit-krb5" ,mit-krb5)
> + ("pulseaudio" ,pulseaudio)
> + ("startup-notification" ,startup-notification)
> + `(("autoconf" ,autoconf-2.13)
> + ("cargo" ,rust "cargo")
> + ("pkg-config" ,pkg-config)
> + ("python2" ,python-2.7)
> + ("python2-pysqlite" ,python2-pysqlite)
> + ("rust-cbindgen" ,rust-cbindgen)
> + (home-page "https://www.thunderbird.net")
> + (synopsis "Trademarkless version of Mozilla Thunderbird")
> + "Full-featured email client built from Thunderbird source tree. It
> +supports email, news feeds, chat, calendar and contacts.")
> + (license license:mpl2.0))) ;and others, see toolkit/content/license.html