diff --git a/pkgs/applications/networking/mailreaders/thunderbird-bin/68.nix b/pkgs/applications/networking/mailreaders/thunderbird-bin/68.nix new file mode 100644 index 000000000000..847864f1a28f --- /dev/null +++ b/pkgs/applications/networking/mailreaders/thunderbird-bin/68.nix @@ -0,0 +1,191 @@ +{ stdenv, fetchurl, config, makeWrapper +, gconf +, alsaLib +, at-spi2-atk +, atk +, cairo +, cups +, curl +, dbus-glib +, dbus +, fontconfig +, freetype +, gdk-pixbuf +, glib +, glibc +, gst-plugins-base +, gstreamer +, gtk2 +, gtk3 +, kerberos +, libX11 +, libXScrnSaver +, libXcomposite +, libXcursor +, libXdamage +, libXext +, libXfixes +, libXi +, libXinerama +, libXrender +, libXt +, libxcb +, libcanberra-gtk2 +, libgnome +, libgnomeui +, gnome3 +, libGLU, libGL +, nspr +, nss +, pango +, writeScript +, xidel +, coreutils +, gnused +, gnugrep +, gnupg +, runtimeShell +}: + +# imports `version` and `sources` +with (import ./68_sources.nix); + +let + arch = if stdenv.hostPlatform.system == "i686-linux" + then "linux-i686" + else "linux-x86_64"; + + isPrefixOf = prefix: string: + builtins.substring 0 (builtins.stringLength prefix) string == prefix; + + sourceMatches = locale: source: + (isPrefixOf source.locale locale) && source.arch == arch; + + systemLocale = config.i18n.defaultLocale or "en-US"; + + defaultSource = stdenv.lib.findFirst (sourceMatches "en-US") {} sources; + + source = stdenv.lib.findFirst (sourceMatches systemLocale) defaultSource sources; + + name = "thunderbird-bin-${version}"; +in + +stdenv.mkDerivation { + inherit name; + + src = fetchurl { + url = "https://download-installer.cdn.mozilla.net/pub/thunderbird/releases/${version}/${source.arch}/${source.locale}/thunderbird-${version}.tar.bz2"; + inherit (source) sha512; + }; + + phases = "unpackPhase installPhase"; + + libPath = stdenv.lib.makeLibraryPath + [ stdenv.cc.cc + gconf + alsaLib + at-spi2-atk + atk + cairo + cups + curl + dbus-glib + dbus + fontconfig + freetype + gdk-pixbuf + glib + glibc + gst-plugins-base + gstreamer + gtk2 + gtk3 + kerberos + libX11 + libXScrnSaver + libXcomposite + libXcursor + libXdamage + libXext + libXfixes + libXi + libXinerama + libXrender + libXt + libxcb + libcanberra-gtk2 + libgnome + libgnomeui + libGLU libGL + nspr + nss + pango + ] + ":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" [ + stdenv.cc.cc + ]; + + buildInputs = [ gtk3 gnome3.adwaita-icon-theme ]; + + nativeBuildInputs = [ makeWrapper ]; + + installPhase = + '' + mkdir -p "$prefix/usr/lib/thunderbird-bin-${version}" + cp -r * "$prefix/usr/lib/thunderbird-bin-${version}" + + mkdir -p "$out/bin" + ln -s "$prefix/usr/lib/thunderbird-bin-${version}/thunderbird" "$out/bin/" + + for executable in \ + thunderbird crashreporter thunderbird-bin plugin-container updater + do + patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ + "$out/usr/lib/thunderbird-bin-${version}/$executable" + done + + find . -executable -type f -exec \ + patchelf --set-rpath "$libPath" \ + "$out/usr/lib/thunderbird-bin-${version}/{}" \; + + # Create a desktop item. + mkdir -p $out/share/applications + cat > $out/share/applications/thunderbird.desktop < gtk3Support == true; + +stdenv.mkDerivation rec { + pname = "thunderbird"; + version = "68.11.0"; + + src = fetchurl { + url = + "mirror://mozilla/thunderbird/releases/${version}/source/thunderbird-${version}.source.tar.xz"; + sha512 = + "1rdxizg1mpagh17fhnrbkilyv1i2zfcr6z62jf3ng31ns94za9kdg9f580srkp63png67jaj3b1kc33v5vb8wavl09n5d38g113x2m9"; + }; + + nativeBuildInputs = [ + autoconf213 + cargo + gnused + llvmPackages.llvm + m4 + nasm + nodejs + perl + pkgconfig + python2 + python3 + rust-cbindgen + rustc + which + yasm + ] ++ lib.optional gtk3Support wrapGAppsHook; + + buildInputs = [ + bzip2 + dbus + dbus-glib + file + fontconfig + freetype + glib + gtk2 + icu + jemalloc + libGL + libGLU + libIDL + libevent + libjpeg + libnotify + libpng + libstartup_notification + libvpx + libwebp + nspr + nss + pango + perl + sqlite + unzip + xorg.libX11 + xorg.libXScrnSaver + xorg.libXcursor + xorg.libXext + xorg.libXft + xorg.libXi + xorg.libXrender + xorg.libXt + xorg.pixman + xorg.xorgproto + zip + zlib + ] ++ lib.optional alsaSupport alsaLib + ++ lib.optional gtk3Support gtk3 + ++ lib.optional pulseaudioSupport libpulseaudio + ++ lib.optional waylandSupport libxkbcommon; + + NIX_CFLAGS_COMPILE =[ + "-I${glib.dev}/include/gio-unix-2.0" + "-I${nss.dev}/include/nss" + ]; + + patches = [ + ./no-buildconfig-68.patch + ]; + + postPatch = '' + rm -rf obj-x86_64-pc-linux-gnu + ''; + + hardeningDisable = [ "format" ]; + + preConfigure = '' + # remove distributed configuration files + rm -f configure + rm -f js/src/configure + rm -f .mozconfig* + + configureScript="$(realpath ./mach) configure" + # AS=as in the environment causes build failure https://bugzilla.mozilla.org/show_bug.cgi?id=1497286 + unset AS + + export MOZCONFIG=$(pwd)/mozconfig + + # Set C flags for Rust's bindgen program. Unlike ordinary C + # compilation, bindgen does not invoke $CC directly. Instead it + # uses LLVM's libclang. To make sure all necessary flags are + # included we need to look in a few places. + # TODO: generalize this process for other use-cases. + + BINDGEN_CFLAGS="$(< ${stdenv.cc}/nix-support/libc-cflags) \ + $(< ${stdenv.cc}/nix-support/cc-cflags) \ + ${stdenv.cc.default_cxx_stdlib_compile} \ + ${ + lib.optionalString stdenv.cc.isClang + "-idirafter ${stdenv.cc.cc}/lib/clang/${ + lib.getVersion stdenv.cc.cc + }/include" + } \ + ${ + lib.optionalString stdenv.cc.isGNU + "-isystem ${stdenv.cc.cc}/include/c++/${ + lib.getVersion stdenv.cc.cc + } -isystem ${stdenv.cc.cc}/include/c++/${ + lib.getVersion stdenv.cc.cc + }/$(cc -dumpmachine)" + } \ + $NIX_CFLAGS_COMPILE" + + echo "ac_add_options BINDGEN_CFLAGS='$BINDGEN_CFLAGS'" >> $MOZCONFIG + ''; + + configureFlags = let + toolkitSlug = if gtk3Support then + "3${lib.optionalString waylandSupport "-wayland"}" + else + "2"; + toolkitValue = "cairo-gtk${toolkitSlug}"; + in [ + "--enable-application=comm/mail" + + "--with-system-bz2" + "--with-system-icu" + "--with-system-jpeg" + "--with-system-libevent" + "--with-system-nspr" + "--with-system-nss" + "--with-system-png" # needs APNG support + "--with-system-icu" + "--with-system-zlib" + "--with-system-webp" + "--with-system-libvpx" + + "--enable-rust-simd" + "--enable-crashreporter" + "--enable-default-toolkit=${toolkitValue}" + "--enable-js-shell" + "--enable-necko-wifi" + "--enable-startup-notification" + "--enable-system-ffi" + "--enable-system-pixman" + "--enable-system-sqlite" + + "--disable-gconf" + "--disable-tests" + "--disable-updater" + "--enable-jemalloc" + ] ++ (if debugBuild then [ + "--enable-debug" + "--enable-profiling" + ] else [ + "--disable-debug" + "--enable-release" + "--disable-debug-symbols" + "--enable-optimize" + "--enable-strip" + ]) ++ lib.optionals (!stdenv.hostPlatform.isi686) [ + # on i686-linux: --with-libclang-path is not available in this configuration + "--with-libclang-path=${llvmPackages.libclang}/lib" + "--with-clang-path=${llvmPackages.clang}/bin/clang" + ] ++ lib.optional alsaSupport "--enable-alsa" + ++ lib.optional calendarSupport "--enable-calendar" + ++ lib.optional enableOfficialBranding "--enable-official-branding" + ++ lib.optional pulseaudioSupport "--enable-pulseaudio"; + + enableParallelBuilding = true; + + postConfigure = '' + cd obj-* + ''; + + makeFlags = lib.optionals enableOfficialBranding [ + "MOZILLA_OFFICIAL=1" + "BUILD_OFFICIAL=1" + ]; + + doCheck = false; + + postInstall = let + desktopItem = makeDesktopItem { + categories = lib.concatStringsSep ";" [ "Application" "Network" ]; + desktopName = "Thunderbird"; + genericName = "Mail Reader"; + name = "thunderbird"; + exec = "thunderbird %U"; + icon = "$out/lib/thunderbird/chrome/icons/default/default256.png"; + mimeType = lib.concatStringsSep ";" [ + # Email + "x-scheme-handler/mailto" + "message/rfc822" + # Feeds + "x-scheme-handler/feed" + "application/rss+xml" + "application/x-extension-rss" + # Newsgroups + "x-scheme-handler/news" + "x-scheme-handler/snews" + "x-scheme-handler/nntp" + ]; + }; + in '' + # TODO: Move to a dev output? + rm -rf $out/include $out/lib/thunderbird-devel-* $out/share/idl + + ${desktopItem.buildCommand} + ''; + + preFixup = '' + # Needed to find Mozilla runtime + gappsWrapperArgs+=( + --argv0 "$out/bin/thunderbird" + --set MOZ_APP_LAUNCHER thunderbird + # https://github.com/NixOS/nixpkgs/pull/61980 + --set SNAP_NAME "thunderbird" + --set MOZ_LEGACY_PROFILES 1 + --set MOZ_ALLOW_DOWNGRADE 1 + ) + ''; + + # FIXME: This can probably be removed as soon as we package a + # Thunderbird >=71.0 since XUL shouldn't be anymore (in use)? + postFixup = '' + local xul="$out/lib/thunderbird/libxul.so" + patchelf --set-rpath "${libnotify}/lib:$(patchelf --print-rpath $xul)" $xul + ''; + + doInstallCheck = true; + installCheckPhase = '' + "$out/bin/thunderbird" --version + ''; + + disallowedRequisites = [ + stdenv.cc + ]; + + passthru.updateScript = import ./../../browsers/firefox/update.nix { + attrPath = "thunderbird"; + baseUrl = "http://archive.mozilla.org/pub/thunderbird/releases/"; + inherit writeScript lib common-updater-scripts xidel coreutils gnused + gnugrep curl runtimeShell; + }; + + meta = with stdenv.lib; { + description = "A full-featured e-mail client"; + homepage = "https://www.thunderbird.net"; + maintainers = with maintainers; [ + eelco + lovesegfault + pierron + ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/applications/networking/mailreaders/thunderbird/default.nix b/pkgs/applications/networking/mailreaders/thunderbird/default.nix index 0fe603fe91e9..bf88881d5100 100644 --- a/pkgs/applications/networking/mailreaders/thunderbird/default.nix +++ b/pkgs/applications/networking/mailreaders/thunderbird/default.nix @@ -18,7 +18,6 @@ , lib , libGL , libGLU -, libIDL , libevent , libjpeg , libnotify @@ -43,6 +42,7 @@ , rustc , sqlite , stdenv +, systemd , unzip , which , writeScript @@ -72,13 +72,13 @@ assert waylandSupport -> gtk3Support == true; stdenv.mkDerivation rec { pname = "thunderbird"; - version = "68.9.0"; + version = "78.1.1"; src = fetchurl { url = "mirror://mozilla/thunderbird/releases/${version}/source/thunderbird-${version}.source.tar.xz"; sha512 = - "3q0dikgkfr72hhz39pxi2f0cljn09lw4940qcn9kzfwfid2h290j7pihx6gs0z6h82fl78f9fl1598d064lwl1i2434dzx6bg4p4549"; + "1lf15zl3p8y1vxv4s04y088flkspf0r0c6j8gfrlfzla5ckfcsbad3zbygh6y73m35j882g7fbacby5a4hiw891zq2kji5dn3nbahyi"; }; nativeBuildInputs = [ @@ -112,7 +112,6 @@ stdenv.mkDerivation rec { jemalloc libGL libGLU - libIDL libevent libjpeg libnotify @@ -191,7 +190,7 @@ stdenv.mkDerivation rec { lib.getVersion stdenv.cc.cc } -isystem ${stdenv.cc.cc}/include/c++/${ lib.getVersion stdenv.cc.cc - }/$(cc -dumpmachine)" + }/${stdenv.hostPlatform.config}" } \ $NIX_CFLAGS_COMPILE" @@ -207,14 +206,12 @@ stdenv.mkDerivation rec { in [ "--enable-application=comm/mail" - "--with-system-bz2" "--with-system-icu" "--with-system-jpeg" "--with-system-libevent" "--with-system-nspr" "--with-system-nss" "--with-system-png" # needs APNG support - "--with-system-icu" "--with-system-zlib" "--with-system-webp" "--with-system-libvpx" @@ -224,12 +221,9 @@ stdenv.mkDerivation rec { "--enable-default-toolkit=${toolkitValue}" "--enable-js-shell" "--enable-necko-wifi" - "--enable-startup-notification" "--enable-system-ffi" "--enable-system-pixman" - "--enable-system-sqlite" - "--disable-gconf" "--disable-tests" "--disable-updater" "--enable-jemalloc" @@ -305,11 +299,11 @@ stdenv.mkDerivation rec { ) ''; - # FIXME: This can probably be removed as soon as we package a - # Thunderbird >=71.0 since XUL shouldn't be anymore (in use)? + # FIXME: The XUL portion of this can probably be removed as soon as we + # package a Thunderbird >=71.0 since XUL shouldn't be anymore (in use)? postFixup = '' local xul="$out/lib/thunderbird/libxul.so" - patchelf --set-rpath "${libnotify}/lib:$(patchelf --print-rpath $xul)" $xul + patchelf --set-rpath "${libnotify}/lib:${systemd.lib}/lib:$(patchelf --print-rpath $xul)" $xul ''; doInstallCheck = true; @@ -322,7 +316,7 @@ stdenv.mkDerivation rec { ]; passthru.updateScript = import ./../../browsers/firefox/update.nix { - attrPath = "thunderbird"; + attrPath = "thunderbird-78"; baseUrl = "http://archive.mozilla.org/pub/thunderbird/releases/"; inherit writeScript lib common-updater-scripts xidel coreutils gnused gnugrep curl runtimeShell; @@ -337,5 +331,6 @@ stdenv.mkDerivation rec { pierron ]; platforms = platforms.linux; + license = licenses.mpl20; }; } diff --git a/pkgs/applications/networking/mailreaders/thunderbird/no-buildconfig-68.patch b/pkgs/applications/networking/mailreaders/thunderbird/no-buildconfig-68.patch new file mode 100644 index 000000000000..fe3a93ebda7b --- /dev/null +++ b/pkgs/applications/networking/mailreaders/thunderbird/no-buildconfig-68.patch @@ -0,0 +1,35 @@ +diff -ru -x '*~' a/docshell/base/nsAboutRedirector.cpp b/docshell/base/nsAboutRedirector.cpp +--- a/docshell/base/nsAboutRedirector.cpp 2017-07-31 18:20:51.000000000 +0200 ++++ b/docshell/base/nsAboutRedirector.cpp 2017-09-26 22:02:00.814151731 +0200 +@@ -32,8 +32,6 @@ + {"about", "chrome://global/content/aboutAbout.xhtml", 0}, + {"addons", "chrome://mozapps/content/extensions/extensions.xul", + nsIAboutModule::ALLOW_SCRIPT}, +- {"buildconfig", "chrome://global/content/buildconfig.html", +- nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT}, + {"checkerboard", "chrome://global/content/aboutCheckerboard.xhtml", + nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | + nsIAboutModule::ALLOW_SCRIPT}, +diff -ru -x '*~' a/toolkit/content/jar.mn b/toolkit/content/jar.mn +--- a/toolkit/content/jar.mn 2017-07-31 18:20:52.000000000 +0200 ++++ b/toolkit/content/jar.mn 2017-09-26 22:01:42.383350314 +0200 +@@ -39,7 +39,6 @@ + content/global/plugins.css + content/global/browser-child.js + content/global/browser-content.js +-* content/global/buildconfig.html + content/global/buildconfig.css + content/global/contentAreaUtils.js + content/global/datepicker.xhtml +--- a/comm/mail/base/jar.mn ++++ b/comm/mail/base/jar.mn +@@ -117,9 +117,7 @@ + % override chrome://mozapps/content/profile/profileDowngrade.js chrome://messenger/content/profileDowngrade.js + % override chrome://mozapps/content/profile/profileDowngrade.xul chrome://messenger/content/profileDowngrade.xul + +-* content/messenger/buildconfig.html (content/buildconfig.html) + content/messenger/buildconfig.css (content/buildconfig.css) +-% override chrome://global/content/buildconfig.html chrome://messenger/content/buildconfig.html + % override chrome://global/content/buildconfig.css chrome://messenger/content/buildconfig.css + + # L10n resources and overrides. diff --git a/pkgs/applications/networking/mailreaders/thunderbird/no-buildconfig.patch b/pkgs/applications/networking/mailreaders/thunderbird/no-buildconfig.patch index fe3a93ebda7b..efbddd3fba81 100644 --- a/pkgs/applications/networking/mailreaders/thunderbird/no-buildconfig.patch +++ b/pkgs/applications/networking/mailreaders/thunderbird/no-buildconfig.patch @@ -1,31 +1,32 @@ diff -ru -x '*~' a/docshell/base/nsAboutRedirector.cpp b/docshell/base/nsAboutRedirector.cpp ---- a/docshell/base/nsAboutRedirector.cpp 2017-07-31 18:20:51.000000000 +0200 -+++ b/docshell/base/nsAboutRedirector.cpp 2017-09-26 22:02:00.814151731 +0200 -@@ -32,8 +32,6 @@ - {"about", "chrome://global/content/aboutAbout.xhtml", 0}, - {"addons", "chrome://mozapps/content/extensions/extensions.xul", +--- a/docshell/base/nsAboutRedirector.cpp ++++ b/docshell/base/nsAboutRedirector.cpp +@@ -63,8 +63,6 @@ + {"about", "chrome://global/content/aboutAbout.html", 0}, + {"addons", "chrome://mozapps/content/extensions/extensions.xhtml", nsIAboutModule::ALLOW_SCRIPT}, - {"buildconfig", "chrome://global/content/buildconfig.html", - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT}, - {"checkerboard", "chrome://global/content/aboutCheckerboard.xhtml", + {"checkerboard", "chrome://global/content/aboutCheckerboard.html", nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | nsIAboutModule::ALLOW_SCRIPT}, diff -ru -x '*~' a/toolkit/content/jar.mn b/toolkit/content/jar.mn ---- a/toolkit/content/jar.mn 2017-07-31 18:20:52.000000000 +0200 -+++ b/toolkit/content/jar.mn 2017-09-26 22:01:42.383350314 +0200 -@@ -39,7 +39,6 @@ - content/global/plugins.css +--- a/toolkit/content/jar.mn ++++ b/toolkit/content/jar.mn +@@ -35,7 +35,6 @@ + content/global/plugins.js content/global/browser-child.js content/global/browser-content.js -* content/global/buildconfig.html content/global/buildconfig.css content/global/contentAreaUtils.js content/global/datepicker.xhtml +diff -ru -x '*~' a/comm/mail/base/jar.mn b/comm/mail/base/jar.mn --- a/comm/mail/base/jar.mn +++ b/comm/mail/base/jar.mn -@@ -117,9 +117,7 @@ +@@ -119,9 +119,7 @@ % override chrome://mozapps/content/profile/profileDowngrade.js chrome://messenger/content/profileDowngrade.js - % override chrome://mozapps/content/profile/profileDowngrade.xul chrome://messenger/content/profileDowngrade.xul + % override chrome://mozapps/content/profile/profileDowngrade.xhtml chrome://messenger/content/profileDowngrade.xhtml -* content/messenger/buildconfig.html (content/buildconfig.html) content/messenger/buildconfig.css (content/buildconfig.css) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d7558618af9d..c29a75868ed1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -21815,7 +21815,18 @@ in thonny = callPackage ../applications/editors/thonny { }; - thunderbird = callPackage ../applications/networking/mailreaders/thunderbird { + thunderbird-78 = callPackage ../applications/networking/mailreaders/thunderbird { + inherit (rustPackages_1_44) cargo rustc; + rust-cbindgen = rust-cbindgen_latest; + nodejs = nodejs-13_x; + nss = nss_latest; + libpng = libpng_apng; + icu = icu67; + libvpx = libvpx_1_8; + gtk3Support = true; + }; + + thunderbird = callPackage ../applications/networking/mailreaders/thunderbird/68.nix { inherit (gnome2) libIDL; libpng = libpng_apng; gtk3Support = true; @@ -21823,7 +21834,9 @@ in thunderbolt = callPackage ../os-specific/linux/thunderbolt {}; - thunderbird-bin = callPackage ../applications/networking/mailreaders/thunderbird-bin { + thunderbird-bin-78 = callPackage ../applications/networking/mailreaders/thunderbird-bin { }; + + thunderbird-bin = callPackage ../applications/networking/mailreaders/thunderbird-bin/68.nix { gconf = pkgs.gnome2.GConf; inherit (pkgs.gnome2) libgnome libgnomeui; };