- (alist-replace
- 'configure
- ;; configure does not work followed by both "SHELL=..." and
- ;; "CONFIG_SHELL=..."; set environment variables instead
- (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)
- ,(string-append "--with-l10n-base="
- abs-srcdir "/l10n")
- ,@configure-flags)))
- (setenv "SHELL" bash)
- (setenv "CONFIG_SHELL" bash)
- (mkdir "../build")
- (chdir "../build")
- (format #t "build directory: ~s~%" (getcwd))
- (format #t "configure flags: ~s~%" flags)
- (zero? (apply system* bash
- (string-append srcdir "/configure")
- flags))))
- %standard-phases)))
+ (modify-phases %standard-phases
+ (add-after
+ 'unpack 'ensure-no-mtimes-pre-1980
+ (lambda _
+ ;; Without this, the 'source/test/addons/packed.xpi' and
+ ;; 'source/test/addons/simple-prefs.xpi' targets fail while trying
+ ;; to create zip archives.
+ (let ((early-1980 315619200)) ; 1980-01-02 UTC
+ (ftw "." (lambda (file stat flag)
+ (unless (<= early-1980 (stat:mtime stat))
+ (utime file early-1980 early-1980))
+ #t))
+ #t)))
+ (add-after
+ 'unpack 'remove-h264parse-from-blacklist
+ (lambda _
+ ;; Remove h264parse from gstreamer format helper blacklist. It
+ ;; was put there to work around a bug in a pre-1.0 version of
+ ;; gstreamer. See:
+ ;; https://www.mozilla.org/en-US/security/advisories/mfsa2015-47/
+ (substitute* "dom/media/gstreamer/GStreamerFormatHelper.cpp"
+ (("^ \"h264parse\",\n") ""))
+ #t))
+ (add-after
+ 'unpack 'arrange-to-link-libxul-with-libraries-it-might-dlopen
+ (lambda _
+ ;; libxul.so dynamically opens libraries, so here we explicitly
+ ;; link them into libxul.so instead.
+ ;;
+ ;; TODO: It might be preferable to patch in absolute file names in
+ ;; calls to dlopen or PR_LoadLibrary, but that didn't seem to
+ ;; work. More investigation is needed.
+ (substitute* "toolkit/library/moz.build"
+ (("^# This needs to be last")
+ "OS_LIBS += [
+ 'GL', 'gnome-2', 'canberra', 'Xss', 'cups', 'gssapi_krb5',
+ 'gstreamer-1.0', 'gstapp-1.0', 'gstvideo-1.0' ]\n\n"))
+ #t))
+ (replace
+ 'configure
+ ;; configure does not work followed by both "SHELL=..." and
+ ;; "CONFIG_SHELL=..."; set environment variables instead
+ (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)
+ ,(string-append "--with-l10n-base="
+ abs-srcdir "/l10n")
+ ,@configure-flags)))
+ (setenv "SHELL" bash)
+ (setenv "CONFIG_SHELL" bash)
+ (mkdir "../build")
+ (chdir "../build")
+ (format #t "build directory: ~s~%" (getcwd))
+ (format #t "configure flags: ~s~%" flags)
+ (zero? (apply system* bash
+ (string-append srcdir "/configure")
+ flags))))))))