mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-28 23:32:24 -05:00
gnu: icedove: Compute a self-contained source.
This refactoring work is to prepare for adding a icedove-l10n package, which will reuse that source. * gnu/packages/gnuzilla.scm (comm-source->locales+changset): New procedure. (thunderbird-source): Rename to... (thunderbird-comm-source): ... here. (icedove-source): New variable. (icedove) [source]: Use it. [phases]: Remove the prepare-thunderbird-sources and rename-to-icedove phases.
This commit is contained in:
parent
f4a932cbd7
commit
456e98ad6f
1 changed files with 140 additions and 70 deletions
|
@ -47,6 +47,7 @@ (define-module (gnu packages gnuzilla)
|
||||||
#:use-module (guix hg-download)
|
#:use-module (guix hg-download)
|
||||||
#:use-module (guix gexp)
|
#:use-module (guix gexp)
|
||||||
#:use-module (guix store)
|
#:use-module (guix store)
|
||||||
|
#:use-module (guix modules)
|
||||||
#:use-module (guix monads)
|
#:use-module (guix monads)
|
||||||
#:use-module (guix utils)
|
#:use-module (guix utils)
|
||||||
#:use-module (guix build-system gnu)
|
#:use-module (guix build-system gnu)
|
||||||
|
@ -1119,7 +1120,7 @@ (define %icedove-version "102.7.2")
|
||||||
|
|
||||||
;; Provides the "comm" folder which is inserted into the icecat source.
|
;; Provides the "comm" folder which is inserted into the icecat source.
|
||||||
;; Avoids the duplication of Icecat's source tarball.
|
;; Avoids the duplication of Icecat's source tarball.
|
||||||
(define thunderbird-source
|
(define thunderbird-comm-source
|
||||||
(origin
|
(origin
|
||||||
(method hg-fetch)
|
(method hg-fetch)
|
||||||
(uri (hg-reference
|
(uri (hg-reference
|
||||||
|
@ -1130,65 +1131,74 @@ (define thunderbird-source
|
||||||
(base32
|
(base32
|
||||||
"071q0pcfvfpzx741ly1sl8anlmzx02h17w4ylfnrkwrpaclq3p6p"))))
|
"071q0pcfvfpzx741ly1sl8anlmzx02h17w4ylfnrkwrpaclq3p6p"))))
|
||||||
|
|
||||||
(define-public icedove
|
(define (comm-source->locales+changeset source)
|
||||||
(package
|
"Given SOURCE, a checkout of the Thunderbird 'comm' component, return the
|
||||||
(name "icedove")
|
list of languages supported as well as the currently used changeset."
|
||||||
(version %icedove-version)
|
(match (update-mozilla-locales
|
||||||
(source icecat-source)
|
(string-append source "/mail/locales/l10n-changesets.json"))
|
||||||
(properties
|
(((_ changeset locale) ...)
|
||||||
`((cpe-name . "thunderbird_esr")))
|
(values locale (first changeset)))))
|
||||||
(build-system gnu-build-system)
|
|
||||||
(arguments
|
;;; To find out which changeset to use for the comm-l10n repo, use the
|
||||||
(list
|
;;; 'comm-source->locales+changeset' procedure on the thunderbird-comm-source
|
||||||
#:tests? #f ;no check target
|
;;; checkout directory. The complete localization data should be released as
|
||||||
#:imported-modules %cargo-utils-modules ;for `generate-all-checksums'
|
;;; a tarball in the next release (see:
|
||||||
#:modules `((guix build utils) ;find-files
|
;;; https://bugzilla.mozilla.org/show_bug.cgi?id=1817086). When this tarball
|
||||||
(sxml simple)
|
;;; is available, it should replace the complete 'l10n' directory at the root
|
||||||
(ice-9 regex)
|
;;; of the IceCat source, instead of only the 'calendar', chat and mail
|
||||||
,@%gnu-build-system-modules)
|
;;; directories that it provides.
|
||||||
#:phases
|
(define thunderbird-comm-l10n
|
||||||
#~(modify-phases %standard-phases
|
(let* ((changeset "5b6788295358")
|
||||||
(add-after 'unpack 'prepare-thunderbird-sources
|
(version (git-version %icedove-version "0" changeset)))
|
||||||
(lambda _
|
(origin
|
||||||
|
(method hg-fetch)
|
||||||
|
(uri (hg-reference
|
||||||
|
(url "https://hg.mozilla.org/projects/comm-l10n")
|
||||||
|
(changeset changeset)))
|
||||||
|
(file-name (git-file-name "comm-l10n" version))
|
||||||
|
(sha256
|
||||||
|
(base32
|
||||||
|
"1jrsmkscjjllcfawi3788vwm53wn25inbhdis5nk4vfpr7wk5ill")))))
|
||||||
|
|
||||||
|
(define icedove-source
|
||||||
|
(let ((name (string-append "icedove-" %icedove-version)))
|
||||||
|
(origin
|
||||||
|
(method computed-origin-method)
|
||||||
|
(file-name (string-append name ".tar.xz"))
|
||||||
|
(sha256 #f)
|
||||||
|
(uri
|
||||||
|
(delay
|
||||||
|
(with-imported-modules (source-module-closure '((guix build utils)))
|
||||||
|
#~(begin
|
||||||
|
(use-modules (guix build utils)
|
||||||
|
(sxml simple))
|
||||||
|
|
||||||
|
(set-path-environment-variable
|
||||||
|
"PATH" '("bin")
|
||||||
|
(list #+(canonical-package tar)
|
||||||
|
#+(canonical-package xz)))
|
||||||
|
|
||||||
|
;; Extract the base Icecat tarball, renaming its top-level
|
||||||
|
;; directory.
|
||||||
|
(invoke "tar" "--transform" (string-append "s,[^/]*," #$name ",")
|
||||||
|
"-xf" #$icecat-source)
|
||||||
|
(chdir #$name)
|
||||||
|
|
||||||
|
;; Merge the Thunderdbird localization data.
|
||||||
|
(copy-recursively #$thunderbird-comm-l10n "l10n")
|
||||||
|
|
||||||
|
;; Add the Thunderbird-specific "comm" directory..
|
||||||
(mkdir "comm")
|
(mkdir "comm")
|
||||||
(copy-recursively #$thunderbird-source "comm")
|
(copy-recursively #$thunderbird-comm-source "comm")
|
||||||
(delete-file "sourcestamp.txt")))
|
(delete-file "sourcestamp.txt")
|
||||||
(add-after 'patch-source-shebangs 'patch-cargo-checksums
|
|
||||||
(lambda _
|
;; Adjust the application name.
|
||||||
(use-modules (guix build cargo-utils))
|
|
||||||
(let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934\
|
|
||||||
ca495991b7852b855"))
|
|
||||||
(for-each (lambda (file)
|
|
||||||
(format #t "patching checksums in ~a~%" file)
|
|
||||||
(substitute* file
|
|
||||||
(("^checksum = \".*\"")
|
|
||||||
(string-append "checksum = \"" null-hash "\""))))
|
|
||||||
(find-files "." "Cargo.lock$"))
|
|
||||||
(for-each generate-all-checksums
|
|
||||||
'("third_party/rust"
|
|
||||||
"toolkit/library/rust")))))
|
|
||||||
(add-after 'patch-cargo-checksums 'remove-cargo-frozen-flag
|
|
||||||
(lambda _
|
|
||||||
;; Remove --frozen flag from cargo invokation, otherwise it'll
|
|
||||||
;; complain that it's not able to change Cargo.lock.
|
|
||||||
;; https://bugzilla.mozilla.org/show_bug.cgi?id=1726373
|
|
||||||
(substitute* "build/RunCbindgen.py"
|
|
||||||
(("\"--frozen\",") ""))))
|
|
||||||
;; Fixes issue where each installation directory generates its own
|
|
||||||
;; profile (see:
|
|
||||||
;; 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"))))
|
|
||||||
(add-after 'prepare-thunderbird-sources 'rename-to-icedove
|
|
||||||
(lambda _
|
|
||||||
(substitute* "comm/mail/confvars.sh"
|
(substitute* "comm/mail/confvars.sh"
|
||||||
(("MOZ_APP_NAME=thunderbird")
|
(("MOZ_APP_NAME=thunderbird")
|
||||||
"MOZ_APP_NAME=icedove")
|
"MOZ_APP_NAME=icedove")
|
||||||
(("MOZ_UPDATER=1")
|
(("MOZ_UPDATER=1")
|
||||||
"MOZ_UPDATER=0"))
|
"MOZ_UPDATER=0"))
|
||||||
|
|
||||||
;; Remove branding to comply with Mozilla's trademark policy
|
;; Remove branding to comply with Mozilla's trademark policy
|
||||||
(with-directory-excursion "comm/mail/branding/nightly"
|
(with-directory-excursion "comm/mail/branding/nightly"
|
||||||
(delete-file "content/about-wordmark.svg")
|
(delete-file "content/about-wordmark.svg")
|
||||||
|
@ -1244,7 +1254,67 @@ (define-public icedove
|
||||||
(("(pref\\(\"extensions.systemAddon.update.enabled\").*" _ m)
|
(("(pref\\(\"extensions.systemAddon.update.enabled\").*" _ m)
|
||||||
(string-append m ", false);"))
|
(string-append m ", false);"))
|
||||||
(("(pref\\(\"lightweightThemes.update.enabled\").*" _ m)
|
(("(pref\\(\"lightweightThemes.update.enabled\").*" _ m)
|
||||||
(string-append m ", false);")))))
|
(string-append m ", false);")))
|
||||||
|
|
||||||
|
;; Step out of the directory and create the tarball.
|
||||||
|
(chdir "..")
|
||||||
|
(format #t "Packing Icedove source tarball...~%")
|
||||||
|
(force-output)
|
||||||
|
(setenv "XZ_DEFAULTS" (string-join (%xz-parallel-args)))
|
||||||
|
(invoke "tar" "cfa" #$output
|
||||||
|
"--mtime=@315619200" ;1980-01-02 UTC
|
||||||
|
"--owner=root:0"
|
||||||
|
"--group=root:0"
|
||||||
|
"--sort=name"
|
||||||
|
#$name))))))))
|
||||||
|
|
||||||
|
(define-public icedove
|
||||||
|
(package
|
||||||
|
(name "icedove")
|
||||||
|
(version %icedove-version)
|
||||||
|
(source icedove-source)
|
||||||
|
(properties
|
||||||
|
`((cpe-name . "thunderbird_esr")))
|
||||||
|
(build-system gnu-build-system)
|
||||||
|
(arguments
|
||||||
|
(list
|
||||||
|
#: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 'patch-source-shebangs 'patch-cargo-checksums
|
||||||
|
(lambda _
|
||||||
|
(use-modules (guix build cargo-utils))
|
||||||
|
(let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934\
|
||||||
|
ca495991b7852b855"))
|
||||||
|
(for-each (lambda (file)
|
||||||
|
(format #t "patching checksums in ~a~%" file)
|
||||||
|
(substitute* file
|
||||||
|
(("^checksum = \".*\"")
|
||||||
|
(string-append "checksum = \"" null-hash "\""))))
|
||||||
|
(find-files "." "Cargo.lock$"))
|
||||||
|
(for-each generate-all-checksums
|
||||||
|
'("third_party/rust"
|
||||||
|
"toolkit/library/rust")))))
|
||||||
|
(add-after 'patch-cargo-checksums 'remove-cargo-frozen-flag
|
||||||
|
(lambda _
|
||||||
|
;; Remove --frozen flag from cargo invokation, otherwise it'll
|
||||||
|
;; complain that it's not able to change Cargo.lock.
|
||||||
|
;; https://bugzilla.mozilla.org/show_bug.cgi?id=1726373
|
||||||
|
(substitute* "build/RunCbindgen.py"
|
||||||
|
(("\"--frozen\",") ""))))
|
||||||
|
;; Fixes issue where each installation directory generates its own
|
||||||
|
;; profile (see:
|
||||||
|
;; 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"))))
|
||||||
(add-after 'build 'neutralize-store-references
|
(add-after 'build 'neutralize-store-references
|
||||||
(lambda _
|
(lambda _
|
||||||
;; Mangle the store references to compilers & other build tools in
|
;; Mangle the store references to compilers & other build tools in
|
||||||
|
|
Loading…
Reference in a new issue