2020-12-22 01:02:47 +00:00
|
|
|
{ stdenv, lib, fetchurl, config, makeWrapper
|
2014-04-12 16:29:14 +01:00
|
|
|
, alsaLib
|
2018-02-25 02:23:58 +00:00
|
|
|
, at-spi2-atk
|
2014-04-12 16:29:14 +01:00
|
|
|
, atk
|
|
|
|
, cairo
|
2020-12-22 01:02:47 +00:00
|
|
|
, coreutils
|
2014-04-12 16:29:14 +01:00
|
|
|
, cups
|
|
|
|
, curl
|
2018-07-17 21:11:16 +01:00
|
|
|
, dbus
|
2020-12-22 01:02:47 +00:00
|
|
|
, dbus-glib
|
2014-04-12 16:29:14 +01:00
|
|
|
, fontconfig
|
|
|
|
, freetype
|
2019-05-22 12:03:39 +01:00
|
|
|
, gdk-pixbuf
|
2014-04-12 16:29:14 +01:00
|
|
|
, glib
|
|
|
|
, glibc
|
2021-05-07 22:18:14 +01:00
|
|
|
, gnome
|
2020-12-22 01:02:47 +00:00
|
|
|
, gnugrep
|
|
|
|
, gnupg
|
|
|
|
, gnused
|
|
|
|
, gpgme
|
2016-09-11 22:24:51 +01:00
|
|
|
, gtk2
|
2017-04-04 14:02:14 +01:00
|
|
|
, gtk3
|
2021-03-14 16:11:48 +00:00
|
|
|
, libkrb5
|
2020-12-22 01:02:47 +00:00
|
|
|
, libcanberra
|
|
|
|
, libGL
|
|
|
|
, libGLU
|
2014-04-12 16:29:14 +01:00
|
|
|
, libX11
|
2020-12-22 01:02:47 +00:00
|
|
|
, libxcb
|
2015-06-16 14:20:25 +01:00
|
|
|
, libXcomposite
|
2019-08-29 12:51:54 +01:00
|
|
|
, libXcursor
|
2015-06-16 14:20:25 +01:00
|
|
|
, libXdamage
|
2014-04-12 16:29:14 +01:00
|
|
|
, libXext
|
2015-06-16 14:20:25 +01:00
|
|
|
, libXfixes
|
2019-08-29 12:51:54 +01:00
|
|
|
, libXi
|
2014-04-12 16:29:14 +01:00
|
|
|
, libXinerama
|
|
|
|
, libXrender
|
2020-12-22 01:02:47 +00:00
|
|
|
, libXScrnSaver
|
2014-04-12 16:29:14 +01:00
|
|
|
, libXt
|
|
|
|
, nspr
|
|
|
|
, nss
|
|
|
|
, pango
|
2020-12-22 01:02:47 +00:00
|
|
|
, runtimeShell
|
2016-12-16 15:34:25 +00:00
|
|
|
, writeScript
|
|
|
|
, xidel
|
2014-04-12 16:29:14 +01:00
|
|
|
}:
|
|
|
|
|
2014-10-15 14:46:42 +01:00
|
|
|
# imports `version` and `sources`
|
2017-06-15 19:28:02 +01:00
|
|
|
with (import ./release_sources.nix);
|
2014-04-12 16:29:14 +01:00
|
|
|
|
2014-10-15 14:46:42 +01:00
|
|
|
let
|
2018-08-20 20:11:29 +01:00
|
|
|
arch = if stdenv.hostPlatform.system == "i686-linux"
|
2014-04-12 16:29:14 +01:00
|
|
|
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";
|
|
|
|
|
2020-12-22 01:02:47 +00:00
|
|
|
defaultSource = lib.findFirst (sourceMatches "en-US") {} sources;
|
2014-04-12 16:29:14 +01:00
|
|
|
|
2020-12-22 01:02:47 +00:00
|
|
|
source = lib.findFirst (sourceMatches systemLocale) defaultSource sources;
|
2014-04-12 16:29:14 +01:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2021-01-30 10:58:55 +00:00
|
|
|
pname = "thunderbird-bin";
|
|
|
|
inherit version;
|
2014-04-12 16:29:14 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-06-28 19:43:35 +01:00
|
|
|
url = "https://download-installer.cdn.mozilla.net/pub/thunderbird/releases/${version}/${source.arch}/${source.locale}/thunderbird-${version}.tar.bz2";
|
2020-07-15 07:12:22 +01:00
|
|
|
inherit (source) sha256;
|
2014-04-12 16:29:14 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
phases = "unpackPhase installPhase";
|
|
|
|
|
2020-12-22 01:02:47 +00:00
|
|
|
libPath = lib.makeLibraryPath
|
2015-01-15 04:25:26 +00:00
|
|
|
[ stdenv.cc.cc
|
2014-04-12 16:29:14 +01:00
|
|
|
alsaLib
|
2018-02-25 02:23:58 +00:00
|
|
|
at-spi2-atk
|
2014-04-12 16:29:14 +01:00
|
|
|
atk
|
|
|
|
cairo
|
|
|
|
cups
|
|
|
|
curl
|
2018-02-25 02:23:58 +00:00
|
|
|
dbus-glib
|
2018-07-17 21:11:16 +01:00
|
|
|
dbus
|
2014-04-12 16:29:14 +01:00
|
|
|
fontconfig
|
|
|
|
freetype
|
2019-05-22 12:03:39 +01:00
|
|
|
gdk-pixbuf
|
2014-04-12 16:29:14 +01:00
|
|
|
glib
|
|
|
|
glibc
|
2016-09-11 22:24:51 +01:00
|
|
|
gtk2
|
2017-04-04 14:02:14 +01:00
|
|
|
gtk3
|
2021-03-14 16:11:48 +00:00
|
|
|
libkrb5
|
2014-04-12 16:29:14 +01:00
|
|
|
libX11
|
|
|
|
libXScrnSaver
|
2015-06-16 14:20:25 +01:00
|
|
|
libXcomposite
|
2019-08-29 12:51:54 +01:00
|
|
|
libXcursor
|
2015-06-16 14:20:25 +01:00
|
|
|
libXdamage
|
2014-04-12 16:29:14 +01:00
|
|
|
libXext
|
2015-06-16 14:20:25 +01:00
|
|
|
libXfixes
|
2019-08-29 12:51:54 +01:00
|
|
|
libXi
|
2014-04-12 16:29:14 +01:00
|
|
|
libXinerama
|
|
|
|
libXrender
|
|
|
|
libXt
|
2019-08-29 12:51:54 +01:00
|
|
|
libxcb
|
2020-06-20 21:41:19 +01:00
|
|
|
libcanberra
|
2019-11-10 16:44:34 +00:00
|
|
|
libGLU libGL
|
2014-04-12 16:29:14 +01:00
|
|
|
nspr
|
|
|
|
nss
|
|
|
|
pango
|
2020-12-22 01:02:47 +00:00
|
|
|
] + ":" + lib.makeSearchPathOutput "lib" "lib64" [
|
2015-01-15 04:25:26 +00:00
|
|
|
stdenv.cc.cc
|
2014-04-12 16:29:14 +01:00
|
|
|
];
|
|
|
|
|
2021-05-07 22:18:14 +01:00
|
|
|
buildInputs = [ gtk3 gnome.adwaita-icon-theme ];
|
2017-04-04 14:02:14 +01:00
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
2020-12-22 00:49:45 +00:00
|
|
|
# See "Note on GPG support" in `../thunderbird/default.nix` for explanations
|
|
|
|
# on adding `gnupg` and `gpgme` into PATH/LD_LIBRARY_PATH.
|
|
|
|
|
2014-04-12 16:29:14 +01:00
|
|
|
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 \
|
2015-06-16 14:20:25 +01:00
|
|
|
thunderbird crashreporter thunderbird-bin plugin-container updater
|
2014-04-12 16:29:14 +01:00
|
|
|
do
|
2014-12-17 18:11:30 +00:00
|
|
|
patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
2014-04-12 16:29:14 +01:00
|
|
|
"$out/usr/lib/thunderbird-bin-${version}/$executable"
|
|
|
|
done
|
|
|
|
|
2015-06-16 14:20:25 +01:00
|
|
|
find . -executable -type f -exec \
|
2014-04-12 16:29:14 +01:00
|
|
|
patchelf --set-rpath "$libPath" \
|
2015-06-16 14:20:25 +01:00
|
|
|
"$out/usr/lib/thunderbird-bin-${version}/{}" \;
|
2014-04-12 16:29:14 +01:00
|
|
|
|
|
|
|
# Create a desktop item.
|
|
|
|
mkdir -p $out/share/applications
|
|
|
|
cat > $out/share/applications/thunderbird.desktop <<EOF
|
|
|
|
[Desktop Entry]
|
|
|
|
Type=Application
|
|
|
|
Exec=$out/bin/thunderbird
|
2015-08-03 18:46:11 +01:00
|
|
|
Icon=$out/usr/lib/thunderbird-bin-${version}/chrome/icons/default/default256.png
|
2014-04-12 16:29:14 +01:00
|
|
|
Name=Thunderbird
|
|
|
|
GenericName=Mail Reader
|
|
|
|
Categories=Application;Network;
|
|
|
|
EOF
|
2017-04-04 14:02:14 +01:00
|
|
|
|
2019-08-29 12:51:54 +01:00
|
|
|
# SNAP_NAME: https://github.com/NixOS/nixpkgs/pull/61980
|
2019-10-26 07:53:36 +01:00
|
|
|
# MOZ_LEGACY_PROFILES and MOZ_ALLOW_DOWNGRADE:
|
|
|
|
# commit 87e261843c4236c541ee0113988286f77d2fa1ee
|
2017-04-04 14:02:14 +01:00
|
|
|
wrapProgram "$out/bin/thunderbird" \
|
|
|
|
--argv0 "$out/bin/.thunderbird-wrapped" \
|
|
|
|
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH:" \
|
2019-08-29 12:51:54 +01:00
|
|
|
--suffix XDG_DATA_DIRS : "$XDG_ICON_DIRS" \
|
2019-10-26 07:53:36 +01:00
|
|
|
--set SNAP_NAME "thunderbird" \
|
|
|
|
--set MOZ_LEGACY_PROFILES 1 \
|
2020-12-22 00:49:45 +00:00
|
|
|
--set MOZ_ALLOW_DOWNGRADE 1 \
|
2020-12-22 01:02:47 +00:00
|
|
|
--prefix PATH : "${lib.getBin gnupg}/bin" \
|
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.getLib gpgme}/lib"
|
2014-04-12 16:29:14 +01:00
|
|
|
'';
|
|
|
|
|
2016-12-16 15:34:25 +00:00
|
|
|
passthru.updateScript = import ./../../browsers/firefox-bin/update.nix {
|
2021-01-30 10:58:55 +00:00
|
|
|
inherit writeScript xidel coreutils gnused gnugrep curl gnupg runtimeShell;
|
|
|
|
name = "thunderbird-bin-${version}";
|
2016-12-16 15:34:25 +00:00
|
|
|
baseName = "thunderbird";
|
2017-06-15 19:28:02 +01:00
|
|
|
channel = "release";
|
2016-12-16 15:34:25 +00:00
|
|
|
basePath = "pkgs/applications/networking/mailreaders/thunderbird-bin";
|
|
|
|
baseUrl = "http://archive.mozilla.org/pub/thunderbird/releases/";
|
|
|
|
};
|
2020-12-22 01:02:47 +00:00
|
|
|
meta = with lib; {
|
2014-11-25 15:28:55 +00:00
|
|
|
description = "Mozilla Thunderbird, a full-featured email client (binary package)";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://www.mozilla.org/thunderbird/";
|
2014-04-12 16:29:14 +01:00
|
|
|
license = {
|
2014-11-25 15:28:55 +00:00
|
|
|
free = false;
|
2020-04-01 02:11:51 +01:00
|
|
|
url = "http://www.mozilla.org/en-US/foundation/trademarks/policy/";
|
2014-04-12 16:29:14 +01:00
|
|
|
};
|
2020-12-22 01:02:47 +00:00
|
|
|
maintainers = with lib.maintainers; [ ];
|
2014-04-12 16:29:14 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|