unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: 40959@debbugs.gnu.org
Cc: Ricardo Wurmus <rekado@elephly.net>, Nikita <nikita@n0.is>,
	Adrian Malacoda <malacoda@monarch-pass.net>,
	Jonathan Brielmaier <jonathan.brielmaier@web.de>
Subject: [bug#40959] [PATCH v2] gnu: Add icedove.
Date: Sat,  2 May 2020 12:08:42 +0200	[thread overview]
Message-ID: <20200502100842.29566-1-rekado@elephly.net> (raw)
In-Reply-To: <20200429105614.11517-1-jonathan.brielmaier@web.de>

From: Jonathan Brielmaier <jonathan.brielmaier@web.de>

* gnu/packages/gnuzilla.scm (%icedove-build-id, icedove): New variables.

Co-authored-by: Nikita <nikita@n0.is>
Co-authored-by: Adrian Malacoda <malacoda@monarch-pass.net>
Co-authored-by: Ricardo Wurmus <rekado@elephly.net>
---
 gnu/local.mk              |   1 +
 gnu/packages/gnuzilla.scm | 248 +++++++++++++++++++++++++++++++++++++-
 2 files changed, 247 insertions(+), 2 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 26d26ee215..98eaf11db8 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -265,6 +265,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/hyperledger.scm			\
   %D%/packages/i2p.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/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index 06d855ee3e..d05c707293 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -6,12 +6,14 @@
 ;;; 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 Nikita <nikita@n0.is>
 ;;; Copyright © 2017, 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
-;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; 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.
 ;;;
@@ -1142,6 +1144,248 @@ standards of the IceCat project.")
        (cpe-name . "firefox_esr")
        (cpe-version . ,(first (string-split version #\-)))))))
 
+;; Update this together with icecat!
+(define %icedove-build-id "20200428000000")
+(define-public icedove
+  (package
+    (name "icedove")
+    (version "68.7.0")
+    (source icecat-source)
+    (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
+                  (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")
+             ;; The build scripts does not like files from 1970
+             (let ((circa-1980 (* 10 366 24 60 60)))
+               (for-each (lambda (file)
+                           (utime file circa-1980 circa-1980))
+                         (find-files "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")
+               (("MOZ_APP_NAME=thunderbird")
+                "MOZ_APP_NAME=icedove")
+               (("MOZ_UPDATER=1")
+                "MOZ_UPDATER=0"))
+             (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)))
+             #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")))
+         (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"
+        ,(let ((changeset "f7099fd16d6f5dff22154eab3161674142501739"))
+           (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
+               "1x0351wy0i1560893kzclyimpvj7cykavrkzsfrhgd8kycp4mf92")))))
+       ("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")
-- 
2.25.1






  parent reply	other threads:[~2020-05-02 10:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29 10:56 [bug#40959] [PATCH 0/1] WIP: Add icedove Jonathan Brielmaier
2020-04-29 11:00 ` [bug#40959] [PATCH 1/1] gnu: " Jonathan Brielmaier
2020-04-29 11:12   ` Nikita Gillmann
2020-04-29 15:05   ` Ricardo Wurmus
2020-04-29 19:47     ` Efraim Flashner
2020-04-30 13:47     ` Ricardo Wurmus
2020-04-30 13:50       ` Ricardo Wurmus
2020-04-30 20:41         ` Ricardo Wurmus
2020-05-02 10:08 ` Ricardo Wurmus [this message]
2020-05-02 10:48   ` [bug#40959] [PATCH v2] " Ricardo Wurmus
2020-05-03 21:41 ` [bug#40959] [PATCH] " Ricardo Wurmus
2020-05-03 21:47   ` Ricardo Wurmus
2020-05-03 21:50   ` Ricardo Wurmus
2020-05-05 19:04     ` Adrian Malacoda
2020-05-06 11:32       ` Ricardo Wurmus
2020-05-06 20:32         ` Adrian Malacoda
2020-05-07 13:44           ` bug#40959: " Ricardo Wurmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200502100842.29566-1-rekado@elephly.net \
    --to=rekado@elephly.net \
    --cc=40959@debbugs.gnu.org \
    --cc=jonathan.brielmaier@web.de \
    --cc=malacoda@monarch-pass.net \
    --cc=nikita@n0.is \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).