thunderbird: fix default mail client detection
This commit is contained in:
parent
f5fa05677d
commit
eb8f604456
@ -6,7 +6,7 @@
|
|||||||
, cairo, gstreamer, gst-plugins-base, icu, libpng, jemalloc
|
, cairo, gstreamer, gst-plugins-base, icu, libpng, jemalloc
|
||||||
, autoconf213, which, m4
|
, autoconf213, which, m4
|
||||||
, writeScript, xidel, common-updater-scripts, coreutils, gnused, gnugrep, curl
|
, writeScript, xidel, common-updater-scripts, coreutils, gnused, gnugrep, curl
|
||||||
, enableGTK3 ? false, gtk3, wrapGAppsHook
|
, enableGTK3 ? false, gtk3, wrapGAppsHook, makeWrapper
|
||||||
, enableCalendar ? true
|
, enableCalendar ? true
|
||||||
, debugBuild ? false
|
, debugBuild ? false
|
||||||
, # If you want the resulting program to call itself "Thunderbird" instead
|
, # If you want the resulting program to call itself "Thunderbird" instead
|
||||||
@ -18,7 +18,9 @@
|
|||||||
, makeDesktopItem
|
, makeDesktopItem
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
let
|
||||||
|
wrapperTool = if enableGTK3 then wrapGAppsHook else makeWrapper;
|
||||||
|
in stdenv.mkDerivation rec {
|
||||||
name = "thunderbird-${version}";
|
name = "thunderbird-${version}";
|
||||||
version = "52.0";
|
version = "52.0";
|
||||||
|
|
||||||
@ -47,8 +49,8 @@ stdenv.mkDerivation rec {
|
|||||||
]
|
]
|
||||||
++ lib.optional enableGTK3 gtk3;
|
++ lib.optional enableGTK3 gtk3;
|
||||||
|
|
||||||
# from firefox + m4
|
# from firefox + m4 + wrapperTool
|
||||||
nativeBuildInputs = [ m4 autoconf213 which gnused pkgconfig perl python ] ++ lib.optional enableGTK3 wrapGAppsHook;
|
nativeBuildInputs = [ m4 autoconf213 which gnused pkgconfig perl python wrapperTool ];
|
||||||
|
|
||||||
configureFlags =
|
configureFlags =
|
||||||
[ # from firefox, but without sound libraries (alsa, libvpx, pulseaudio)
|
[ # from firefox, but without sound libraries (alsa, libvpx, pulseaudio)
|
||||||
@ -101,20 +103,42 @@ stdenv.mkDerivation rec {
|
|||||||
paxmark m ../objdir/dist/bin/xpcshell
|
paxmark m ../objdir/dist/bin/xpcshell
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
dontWrapGApps = true; # we do it ourselves
|
||||||
postInstall =
|
postInstall =
|
||||||
''
|
''
|
||||||
# For grsecurity kernels
|
# For grsecurity kernels
|
||||||
paxmark m $out/lib/thunderbird-[0-9]*/thunderbird
|
paxmark m $out/lib/thunderbird-[0-9]*/thunderbird
|
||||||
|
|
||||||
# Needed to find Mozilla runtime
|
|
||||||
gappsWrapperArgs+=(--argv0 "$out/bin/.thunderbird-wrapped")
|
|
||||||
|
|
||||||
# TODO: Move to a dev output?
|
# TODO: Move to a dev output?
|
||||||
rm -rf $out/include $out/lib/thunderbird-devel-* $out/share/idl
|
rm -rf $out/include $out/lib/thunderbird-devel-* $out/share/idl
|
||||||
|
|
||||||
|
# $binary is a symlink to $target.
|
||||||
|
# We wrap $target by replacing the $binary symlink.
|
||||||
|
local target="$out/lib/thunderbird-${version}/thunderbird"
|
||||||
|
local binary="$out/bin/thunderbird"
|
||||||
|
|
||||||
|
# Wrap correctly, this is needed to
|
||||||
|
# 1) find Mozilla runtime, because argv0 must be the real thing,
|
||||||
|
# or a symlink thereto. It cannot be the wrapper itself
|
||||||
|
# 2) detect itself as the default mailreader across builds
|
||||||
|
gappsWrapperArgs+=(
|
||||||
|
--argv0 "$target"
|
||||||
|
--set MOZ_APP_LAUNCHER thunderbird
|
||||||
|
)
|
||||||
|
${
|
||||||
|
# We wrap manually because wrapGAppsHook does not detect the symlink
|
||||||
|
# To mimic wrapGAppsHook, we run it with dontWrapGApps, so
|
||||||
|
# gappsWrapperArgs gets defined correctly
|
||||||
|
lib.optionalString enableGTK3 "wrapGAppsHook"
|
||||||
|
}
|
||||||
|
|
||||||
|
# "$binary" is a symlink, replace it by the wrapper
|
||||||
|
rm "$binary"
|
||||||
|
makeWrapper "$target" "$binary" "''${gappsWrapperArgs[@]}"
|
||||||
|
|
||||||
${ let desktopItem = makeDesktopItem {
|
${ let desktopItem = makeDesktopItem {
|
||||||
name = "thunderbird";
|
name = "thunderbird";
|
||||||
exec = "$out/bin/thunderbird %U";
|
exec = "thunderbird %U";
|
||||||
desktopName = "Thunderbird";
|
desktopName = "Thunderbird";
|
||||||
icon = "$out/lib/thunderbird-${version}/chrome/icons/default/default256.png";
|
icon = "$out/lib/thunderbird-${version}/chrome/icons/default/default256.png";
|
||||||
genericName = "Main Reader";
|
genericName = "Main Reader";
|
||||||
|
Loading…
Reference in New Issue
Block a user